svn switch --relocate svn.openfoundry.org/pugs svn.pugscode.org/pugs/ | run.pugscode.org | spec.pugscode.org | paste: sial.org/pbot/perl6 | pugs.blogs.com Set by avar on 16 November 2006. |
|||
00:08
turrepurre joined
00:17
neonse left
00:23
avar joined
00:41
hexmode joined
00:43
diakopter joined
01:41
kanru joined
02:02
buetow joined
02:16
xinming joined
02:18
nipotaway is now known as nipotan
02:19
bonesss joined
02:27
nipra joined
02:29
nipra is now known as nipra_
02:41
dmq joined
02:47
mjk joined
02:50
mjk joined
02:54
xinming joined
02:59
xinming joined
03:32
xinming joined
|
|||
pasteling | "beppu_" at 72.134.38.155 pasted "svk sync problem" (5 lines, 210B) at sial.org/pbot/22036 | 03:37 | |
beppu_ | I thought I'd give svk another try, but when I tried to svk sync the pugs svn repository, I get the error message I posted at revision 12102. | 03:38 | |
clkao | upgrade your svn::mirror | ||
beppu_ | I'll try that. | ||
clkao | or upgrade to svk 2.0 ;) | ||
beppu_ | one step at a time. ;) | 03:39 | |
looks like it's working. Thanks. clkao. | 03:43 | ||
03:44
xinming joined
03:55
xinming joined
04:05
luqui joined
04:22
xinming joined
04:27
xinming_ joined
04:40
luqui joined
04:49
xinming__ joined
04:57
rizen joined
04:59
xinming joined
05:02
kanru joined
05:07
xinming joined
05:21
xinming_ joined
05:26
imperator joined
05:28
nipra joined
05:32
baest_ joined
05:38
xinming joined
05:44
xinming joined
05:50
xinming joined
05:58
Dr_Pi joined
06:02
drbean left
06:04
Dr_Pi_ joined
06:12
BooK joined
06:15
baest_ is now known as baest
06:30
xinming joined
06:42
xinming joined
06:53
RHainsworth joined
06:54
RHainsworth left
07:21
ayrnieu joined
07:24
araujo joined
07:31
pstickne joined
|
|||
pstickne | hello | 07:31 | |
wolverian | welcome! | 07:33 | |
it's a bit quiet now as our project lead (audreyt) has been away for a while, but I hope it'll pick up again soon. :) until then, see topic, have fun, and ask if you have any questions. | |||
pstickne | in Perl6 are classes objects or are they still tied to a namespace? | 07:34 | |
integral | Yes. | ||
wolverian | namespaces are objects too... | ||
see the relevant synopses on spec.pugscode.org | |||
pstickne | I guess a better question; are classes definitions or are they executable in their own notion of 'self'? | 07:35 | |
wolverian, heh | |||
wolverian | those are still not quite exclusive.. :) | ||
pstickne | uhh. | ||
wolverian | but yes, everything is an object, and classes are pseudoprototypical. | ||
see S12 for the OO stuff. | |||
pstickne | ooh. | ||
And it's just a message-based OO system? | 07:36 | ||
wolverian | the synopsis explains it better than I do! really! | ||
:) | |||
pstickne | okay, okay :P | ||
wolverian | you'll probably have questions even after reading it | ||
those are the ones you should ask :) | |||
TimToady | Whenever you say "it's just a" about some aspect of Perl 6, it's usually true that you can view it that way, and usually false that it really is "just a". | 07:38 | |
07:39
ruz_ joined
07:59
canine_kouji joined
08:04
dolmans joined
08:16
iblechbot joined
08:28
Psyche^ joined
08:37
xinming joined
08:38
devogon joined
08:44
Psyche^ is now known as Patterner
|
|||
luqui | ?eval (10**309)**2 | 09:04 | |
evalbot_r14941 | Inf | ||
luqui | ?eval (10**309)*(10**309) | ||
evalbot_r14941 | 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 | ||
luqui | that doesn't seem like reasonable behavior | ||
(I think the first one is wrong) | |||
canine_kouji | scary | 09:06 | |
09:06
canine_kouji left
|
|||
pstickne | The 2nd doesn't seem correct either. | 09:15 | |
Ohh, I guess eval-bot truncation. | |||
gaal | > (10**309)**2 | 09:17 | |
lambdabot | Infinity | 09:18 | |
gaal | > (10**309)*(10**309) | ||
lambdabot | Infinity | ||
luqui | > (10^309)^2 | ||
lambdabot | 1000000000000000000000000000000000000000000000000000000000000000000000000000... | ||
gaal | @type (^) | ||
@type (**) | |||
lambdabot | forall a b. (Integral b, Num a) => a -> b -> a | ||
forall a. (Floating a) => a -> a -> a | |||
wolverian | @type (10**309)**2 | 09:19 | |
lambdabot | forall a. (Floating a) => a | ||
wolverian | I suppose it defaults to a finite one. :) | ||
luqui | right. I think perl was smart not to have a **, ^, and ^^ | ||
but it makes these semantics a little tricky | |||
09:20
kattana_ joined
09:22
b_jonas joined
|
|||
wolverian | toInteger is a bit long too.. | 09:24 | |
on that note, I don't think I've ever needed it. | |||
luqui | ?eval ((10/1)**(309/1))**(2/1) | ||
evalbot_r14941 | Inf | 09:25 | |
luqui | okay good | ||
whew | |||
wolverian | that's good? :) | ||
luqui | well, no | ||
but it's different on my local copy | |||
so I was determining whether it was my change that did it | |||
The exponential operator definitely needs some work | 09:26 | ||
it stringifies the number and then sees if it ends in ".0" to determine if it is an integer | |||
but I need to clarify the semantics | |||
wolverian | heh | ||
I compiled ghc 6.6 yesterday, ran out of space, then realised the development version of ubuntu I have already has ghc 6.6 | 09:27 | ||
wolverian checkouts pugs | |||
luqui, shouldn't that actually be done by the (hypothetical) type inferencer? given an appopriate (mmd) signature for the operator, of course.. | 09:28 | ||
luqui | it doesn't work for Haskell | ||
wolverian | good point. | 09:29 | |
gaal | haskell has a 'default' keyword for this | 09:30 | |
09:30
xinming joined
|
|||
gaal | regarding pugs, well once we finally complete the transition to newVal, you wouldn't need to stringify the operand to tell if it's a float | 09:30 | |
luqui | you don't have to right now either | 09:31 | |
fromIntegral (floor x) == x | 09:32 | ||
but the test suite didn't like that one very much | |||
09:35
xinming_ joined
|
|||
gaal | quirk-compat with p5? | 09:36 | |
09:42
elmex joined
09:52
ofer0 joined
09:53
penk joined
10:27
chris2 joined
10:36
xinming joined
10:42
wilx` joined
10:53
wilx` is now known as wilx
11:05
nipra joined
11:06
xinming joined
11:16
lovecoder joined
11:22
buetow joined
11:24
BooK_ joined
11:41
lovecoder left
11:45
lovec0der joined
11:49
xinming joined
12:45
nipotan is now known as nipotaway
13:00
kanru joined
13:22
bonesss joined
|
|||
b_jonas | would you mind if I asked a few more beginner perl6 questions? | 13:31 | |
When does an Array flatten in list context? Always? Or only when it comes from an @variable? | 13:32 | ||
13:43
ruz joined
|
|||
gaal | not an authoritative answer, but "always in list context" makes way more sense to em | 13:43 | |
wolverian | right. put it in a Capture otherwise. | 13:44 | |
(hmm.. no feature <flatten>;) | 13:45 | ||
13:54
b_jonas joined
14:11
weinig|bbl is now known as weinig
14:12
turrepurre joined
|
|||
b_jonas | (if anyone answered my Array question, please repeat it because I lost the irc) | 14:16 | |
wolverian | b_jonas, colabti.de/irclogger/irclogger_log/...-12-29,Fri :) | 14:20 | |
lambdabot | Title: #perl6 2006-12-29,Fri, tinyurl.com/y59fnf | ||
buubot | xrl.us/t26s | ||
lambdabot | Title: #perl6 2006-12-29,Fri | ||
wolverian | eek | ||
14:36
nipra_ is now known as nipra,
penk joined
14:37
weinig joined
|
|||
b_jonas | wolverian: thanks | 14:38 | |
that's wierd. so how do you make one not flatten? such as if you want to build an array of arrays like @aoa = (@a1, @a2); | 14:39 | ||
I know that the | operator flattens explicitly | 14:41 | ||
ah wait | 14:42 | ||
S03 says | |||
"In list context, a Scalar holding an Array object does not flatten." | |||
so it's not the silgil what counts but the container | |||
I was reading the wrong S (it's not always easy to know which one to read) | |||
wolverian | b_jonas, yeah, that's a problem (which spec to read). the specs aren't really in a Q&A format. | 14:44 | |
(which makes sense, since they're specs. but that sort of docs would be nice too.) | 14:45 | ||
b_jonas | I'd like a reference docs format, not a Q&A format docs. | 14:47 | |
[particle] | we have a wiki | ||
b_jonas | Just like the reference docs perldocs. | ||
In perl5 I mean. | |||
wolverian | perldocs are a bit bloated too, nowadays.. | 14:49 | |
b_jonas | yes I know | ||
wolverian | but, anyway. yeah, the wiki is a good idea. | ||
b_jonas | they don't explain some things about perl5. | ||
Or thy don't explain them the way I'd like. | 14:50 | ||
wolverian | I think the more you try to explain perl5 the farther you push it. | ||
(from you) | |||
[particle] | even if you just create a wishlist on the wiki, and list that item with a good description, it'd help | ||
wolverian | uncertainty principle, of sorts.. | ||
b_jonas | I can understand. I'm lazy to write good docs too. | 14:51 | |
(and it's still much better than the ruby docs, though the readable ruby source sort of compensates that) | 14:53 | ||
(the ruby standard library is documented pretty well, but the language itself isn't) | 14:54 | ||
[particle] | ruby is also *very* young | ||
b_jonas | sure | 14:56 | |
but perl1 was already well documented | |||
:) | 14:57 | ||
ruby isn't that young now btw | |||
[particle] | well, perl can vote | ||
b_jonas | ruby is more than 10 years old now | 14:58 | |
I can't see how these perl6 context variables are better than plain temp/local variables. | 15:20 | ||
15:32
vel joined
|
|||
allbery_b | I thought context vars were to deal with various kinds of magic, e.g. the variables set by doing matches. perl5 does the same thing but there's no structure to it. | 15:47 | |
b_jonas | I think the of-type of multi functions is matched with the context | 15:52 | |
and most operators will be of-typed | |||
but even in a normal function, I guess the last expression and the argument to return is evaluated in that context | 15:53 | ||
the differenct is, perl6 will have a plethora of contexts, not just 3 as perl5 did | |||
wolverian | perl5 has lots of contexts too | 15:54 | |
b_jonas | not really | ||
I mean, they are used only in a few places | |||
wolverian | (perldoc overload) | 15:55 | |
yeah, but perl5 doesn't have a real type system either :) | |||
b_jonas | hmm, I sort of see what you mean | ||
wolverian | perl5's "context" is a very vague concept. in perl6 it's just type inference (or at least, can be viewed as such) | 15:56 | |
or MMD if you like to think of it that way | 15:57 | ||
(vague from a theoretical viewpoint) | |||
b_jonas | yeah | ||
allbery_b | perhaps the more key point is that in perl5 it was all ad hoc and could pop up in unexpected circumstances, but in perl6 it's been regularized. doesn't necessarily mean it will be used, just that things are cleaner in perl6 | 16:12 | |
(see also: magic handling of $a and $b with sort) | |||
16:24
Dr_Pi joined
16:29
spoop joined
|
|||
b_jonas | If I have a plain array such as 'my @x; @x[0] = "foo";' then is the element of the array a Scalar or just a Str? In general, can an array hold various capitalized types as elements or it can only be homogenous? | 16:32 | |
allbery_b | IIRC the container type is Scalar and the value type is Str. a Scalar container can hold any scalar, or a reference to a different container type | 16:41 | |
unless you specifically tell it otherwise, e.g.. my @x is Str; | 16:42 | ||
or something like that | |||
[particle] | of Str iirc | 16:43 | |
allbery_b | yeh, was just checking that because it looked not quite right | ||
or my Str @x; | 16:44 | ||
(per S09) | |||
16:50
hexmode joined
|
|||
[particle] | really? that creates an array of Str? | 16:51 | |
hrm, so it seems | 16:53 | ||
allbery_b | S09 implied it. might be leftover syntax like TimToady found the other day | ||
[particle] | according to S02, i think that's right. | 16:54 | |
the type constraint is on the value in my Str @x | |||
there are also container constraints, like my @x is MyArray | |||
allbery_b | yeh | 16:58 | |
17:01
nipra joined
17:03
Dr_Pi_ joined
17:18
diotalevi joined
17:22
BooK joined
17:24
araujo joined
|
|||
diotalevi | When I say my $x; any( $x ), why do I get the VUndef in VJunc any( VUndef )? I expected to see $x there. | 17:41 | |
allbery_b | presumably it's using the value of $x, which (being uninitialized) is undef | 17:42 | |
17:43
RHainsworth joined
|
|||
allbery_b | (whether it's supposed to be lazy or not is a question for the experts...) | 17:43 | |
[particle] | hint: the experts are lazy, too | 17:44 | |
diotalevi | Ok, but any(\$x) also leaves me with VUndef. Am I taking a reference the wrong way? | ||
17:44
RHainsworth left
|
|||
[particle] | reference? | 17:49 | |
what are you trying to get? | |||
s/get/do/ | |||
17:53
polettix joined,
zgh joined
|
|||
diotalevi | Globally, I'm trying to think about mapping prolog or other logic programming onto Perl 6. Locally, I'm trying to curry some computation into a junction and I think it has to be lazy because I'm not going to supply some of the data needed for the computation til later. I want to make the junction now and have it know to refer back to $x which I'm not providing now but promise to before I ask the junction to run. | 17:55 | |
?eval my $x; my $y = any( $x ); $x = 1; $y == 1; | 17:56 | ||
evalbot_r14941 | (Bool::False) | ||
diotalevi | ?eval my $x; my $y = any( \ $x ); $x = 1; $y == 1; | ||
evalbot_r14941 | (Bool::False) | ||
[particle] | ?eval my $x; my $y = list any($x); $x = 1; $y == 1; | 17:59 | |
evalbot_r14941 | (Bool::False) | ||
diotalevi | ?eval my $x; my $y = any( ->{$x} ); $x = 1; $y == 1 # so capture $x instead | ||
evalbot_r14941 | (*** Cannot cast from VCode (MkCode {isMulti = False, subName = "<anon>", subType = SubPointy, subEnv = Just (MkEnv {envContext = CxtSlurpy (mkType "Any"), envLValue = False, envLexical = MkPad (padToList [("$x",[(<ref:0xb68e3ec0>,<ref:0xb68e3eb8>)]),("$_",[(<ref:0xb6827214>,<ref:0xb682720c>)]),("$?1",[(<ref:0xb68e6028>,<ref:0xb68e6020>)]),("$__evalbot_print",[(<ref:0xb6672e94>,<ref:0xb6672e8c>)]),("$y",[(<ref:0xb68e3ed0>,<ref:0xb68e3ec8>)])]), en | ||
allbery_b | (gesundheit :p) | ||
[particle] | evalbot go boom | ||
diotalevi | ?eval my $x; my $y = any( ->{$x} ); $x = 1; $y->() == 1 | ||
evalbot_r14941 | Error: ā¤Unexpected "->()"ā¤expecting "::", term postfix or operator | ||
diotalevi | ?eval my $x; my $y = any( ->{$x} ); $x = 1; $y == ->{$x} | 18:00 | |
evalbot_r14941 | (*** Cannot cast from VCode (MkCode {isMulti = False, subName = "<anon>", subType = SubPointy, subEnv = Just (MkEnv {envContext = CxtSlurpy (mkType "Any"), envLValue = False, envLexical = MkPad (padToList [("$x",[(<ref:0xb683d19c>,<ref:0xb683d194>)]),("$_",[(<ref:0xb672bca0>,<ref:0xb672bc98>)]),("$?1",[(<ref:0xb67d38c4>,<ref:0xb67d38bc>)]),("$__evalbot_print",[(<ref:0xb6672a40>,<ref:0xb6672a38>)]),("$y",[(<ref:0xb683d1ac>,<ref:0xb683d1a4>)])]), en | ||
diotalevi | So. | ||
allbery_b | ?eval my $x; my $y = any( ->{$x} ); $x = 1; $y() == 1 | ||
evalbot_r14941 | Error: Cannot cast from VJunc any(VCode (MkCode {isMulti = False, subName = "<anon>", subType = SubPointy, subEnv = Just (MkEnv {envContext = CxtSlurpy (mkType "Any"), envLValue = False, envLexical = MkPad (padToList [("$x",[(<ref:0xb67d3714>,<ref:0xb67d370c>)]),("$_",[(<ref:0xb672a2c0>,<ref:0xb672a2b8>)]),("$?1",[(<ref:0xb67d8ea8>,<ref:0xb67d8ea0>)]),("$__evalbot_print",[(<ref:0xb6571908>,<ref:0xb6571900>)]),("$y",[(<ref:0xb67d3724>,<ref:0xb67d37 | ||
allbery_b | oh well | ||
diotalevi | Oh that's an interesting error. | 18:01 | |
[particle] | ?eval my $x; my $y = any(list($x)); $x = 1; $y == 1; | ||
evalbot_r14941 | (Bool::False) | 18:02 | |
b_jonas | of Str? just because I assigned a single Str element? | 18:06 | |
that sounds strange to me | |||
but what I'd like to know not the declarations but whether it really contains scalars or not | 18:07 | ||
diotalevi | ?eval my $x; sub{$x} eqv sub{$x} # returns false but probably shouldn't? | ||
evalbot_r14941 | Bool::False | ||
b_jonas | for example, whether I can take a reference to one element of the array and assign to that such that it modifies the contents of the array, like in perl5 | ||
[particle] | b_jonas: it's not type constrained unless specified during declaration | 18:08 | |
it == the variable (container) | |||
allbery_b | diotalevy: it's not clear to me that comparing two closures for equivalence is sensible | 18:10 | |
b_jonas | the problem could be in my question | ||
diotalevi | It's perfectly sensible. They are the same data, they should be able to be compared for equivalence. | ||
?eval [1..4] eqv [1..4] # those are two different containers of equivalent value. | 18:12 | ||
evalbot_r14941 | Bool::True | ||
allbery_b | they should be identical in that particular case. but consider: my $x; my $a = sub { $x }; sub g { sub { $x } }; $a eqv g() | ||
[particle] | ?eval any(1) == 1 | ||
evalbot_r14941 | (Bool::True) | 18:13 | |
allbery_b | potentially they're not because closures can capture variables form their context | ||
diotalevi | that's just a recursive check then, allbery_b. You now test the lexical environment for equivalence. | ||
allbery_b | better example: my ($x, $y); my $a = sub { ($x, $y) }; sub g { my $y; sub { ($x, $y) } }; $a eqv g() | 18:14 | |
18:14
BooK joined
|
|||
allbery_b | $y is different in both cases. and checking contexts can become difficult (and potentially exponential) as the code becomes more complex | 18:14 | |
lumi | Halting problem? | 18:15 | |
allbery_b | I could imagine it if there's something defined circularly in some context | ||
b_jonas | I think the equalty check for closures should just be address equalty. | 18:17 | |
allbery_b | I'm more worried about "unreasonably expensive" | ||
18:17
wilx left
|
|||
allbery_b | ==b_jonas | 18:17 | |
diotalevi | So what happens in scheme or other lisps when I say (equal (lambda () 1) (lambda () 1))? | ||
b_jonas | diotalevi: scheme allows either output there | ||
diotalevi | b_jonas: there's a different operator for identity/address equality. | 18:18 | |
b_jonas | yes, but for procedures they're the same | ||
I mean in scheme | |||
allbery_b | depends on whether it recognizes that they have the same context and unifies them, I suspect | ||
b_jonas | I think it's basically intended to be address equalty but even in perl5 some closures may be optimized not to be recreated eg when none of the bound variables have changed | 18:19 | |
allbery_b | (CSE, which only works in the same expression) | ||
b_jonas | like, sub f { sub {} } will always return the same sub as an optimization | ||
diotalevi | See, referencing further above if I have any(sub{$x}) then I'd like to be able to compare whether I have sub{$x}, sub{$y}, sub{wow. something loony here.}, sub {whatever}. | 18:21 | |
So some kind of equality comparison becomes important to me pretty quickly. | |||
eqv seemed like a pretty obvious choice. | 18:22 | ||
b_jonas | so you want eqv to do a deep comparision on the subs? | 18:25 | |
diotalevi | Yes. | ||
Or some other operator probably named 'equal'. | |||
b_jonas | and, for example, if currently $a eqv $b, then sub { $a} would be eqv to sub { $b } | 18:26 | |
diotalevi | eqv has a nicer name though since equivalent is closer. | ||
yes, likely b_jonas. If eqv is defined as doing a snapshot of "now" then the values stored in the lexical environments are being compared. | 18:27 | ||
So yes, if $a eqv $b then also sub { $a } eqv sub { $b }. | 18:28 | ||
b_jonas | you have to take care with the names because, for some stupid reason, ruby messed them up and defined equal? as equal identity | ||
diotalevi | Ruby matters? | ||
b_jonas | no | ||
just like with $/ | |||
diotalevi | Their bug is their bug. They can fix it. | ||
b_jonas | perl6 calls the regexp match variable $/, just to be different. ($~ in ruby) | 18:29 | |
$/ will also confuse all the perl5ers as well, so it's a very bad name imo. | 18:32 | ||
diotalevi | It's not a *bad* name, it's just dissonant with what I already know. I can already guess a nice reason for $/ which makes it easy to remember and describe: The '/' is named after the '/' in /.../. | 18:34 | |
Almost no one used the regexp variables in perl 5: @- and @+. | 18:36 | ||
b_jonas | and the $~ is named after the =~ with which you match regexps | ||
as for @- and @+, they're currently not used much because they were new in 5.8 I think | |||
diotalevi | they're new in 5.6.0, b_jonas. | 18:37 | |
Or perhaps farther back. | 18:38 | ||
b_jonas | maybe | ||
diotalevi uses those in 5.6. | |||
b_jonas | indeed, it's in 5.6.1 | 18:39 | |
diotalevi | you found the perldelta entry? | ||
b_jonas | no, just tried an 5.6.1 | ||
and 5.6.1 I had on some machine | |||
diotalevi | So anyway, I don't see it in the spec that my($x,$y);sub{$x} eqv sub{$y} isn't supposed to work so I'm making it a test. | 18:42 | |
I mean, it does seem pretty obvious (to me). | 18:44 | ||
b_jonas | It doesn't to me because I think the insides of closures should usually be treated opaqe. | 18:49 | |
TimToady | We need to see a use case. | ||
my gut feeling is that sub{$x} and sub{$y} cannot be eqv unless $x and $y are aliases, regardless of their values. | 18:50 | ||
eqv is comparing serializations, and I don't think bindings necessarily serialize the value of what they happen to bind to if those bindings are external. | 18:53 | ||
diotalevi thinks the insides of closures are data and can't be opaque. | |||
TimToady thinks opacity is a red herring | 18:54 | ||
diotalevi | So bindings are just references to more data and that problem is well within eqv's grasp. | ||
TimToady | only if serialization would serialize the referenced data. | 18:55 | |
b_jonas | serialization? [\@a, \@a] and [\@b, \@a] serialize differently but they should be eqv, shouldn't they? | ||
TimToady | so it's a question of ownership, which I'll admit is complex | 18:56 | |
why would those be eqv? | |||
diotalevi | So what is this "serialization" thing here? Why is the data being serialized at all? When you say "serialization" you mean it's getting flattened into a string and compared that way? | ||
b_jonas | because both are two-element arrays and their respective arrays are eqv | 18:57 | |
18:57
Odin-LAP joined
|
|||
TimToady | eqv is defined in terms of "if it were serialized" | 18:57 | |
b_jonas | hmm | ||
TimToady | and just as there are various ways to serialize | ||
there are various ways to compute eqv. | |||
eqv takes optional arguments specifying that. | 18:58 | ||
b_jonas | uh | ||
TimToady | just as cmp does | ||
b_jonas | ok | ||
TimToady | we have to pick a default, but that's all it is--a default. | ||
so I'd like to see a use case for picking any particular default. | 18:59 | ||
diotalevi | The text next to eqv in the spec says it makes a "canonical representation" of it's operands and uses === on those. That's the serialization? | ||
TimToady | it's attempting to say the same thing | 19:00 | |
but it's still a subjunctive "if I *were* to canonicalize this..." | 19:01 | ||
the eqv and cmp don't actually have to do the canonicalization. | |||
just produce results consistent with it. | |||
basically comes down to that you have to compare the bits in the same order that a canonicalizer would visit. | 19:02 | ||
but you can short circuit | |||
probably we could go as far as to make different defaults in different lexical scopes via pragma | 19:03 | ||
diotalevi | Ok. Is code as an operand to eqv even defined then? I don't know what it's even doing differently than === in this case. | ||
TimToady | === doesn't have variants like eqv does | 19:04 | |
=== always compares identity, which for value types is the value | |||
but for mutable types is always the address | |||
19:04
neonse joined
|
|||
TimToady | if you can serialize a closure, you can eqv it. | 19:05 | |
diotalevi | So I don't see why a closure has to be serialized. Can't a closure or any other code be looked at as plain old data? you know, lisp? | 19:06 | |
Even Perl 5 had that much. | |||
allbery_b | er? sub {} is an opaque coderef in perl5 | 19:07 | |
diotalevi | No it isn't, allbery_b. B::*. | ||
TimToady | that is *one* serialization method | 19:08 | |
see also YAML | |||
(which happens to attempt to use B::* underneath, iirc) | |||
allbery_b tends to think of B::* as grotting around in internals one really isn't supposed to mess with | 19:09 | ||
TimToady too | |||
diotalevi | allbery_b: there's a trick to it. You just have to declare that you're supposed to be there. | ||
allbery_b | and, well, if you want Scheme, perhaps you should use Scheme. | ||
allbery_b can do regexp foo in C, that doesn't mean C is really appropriate for it | 19:10 | ||
diotalevi | You tend to also expect a more violently mutable world then too... | ||
were I in C and wanting to use a regexp, I'd include a library for that like pcre, boost if I was lucky to be in C++ or "just" perl. | 19:12 | ||
allbery_b | I have libraries. it's still horribly clunky compared to Perl | 19:13 | |
likewise, what you're trying to do is clunky and "unnatural" in Perl | 19:14 | ||
diotalevi | Anyhow, i've gotten very used to thinking of perl as a very ugly lisp and I'd be... I dunno. Inconsolable or something like that if Perl 6 were less than Perl 5 in that regard. Extreme introspection is a wonderful thing and a large part of why I love perl 5. | 19:15 | |
That's purely about my feeling though. | |||
allbery_b | I'd be surprised if there weren't some hack like B::* for perl6. (in fact, I think there is; the ugs prelude is serialized with YAML) | 19:16 | |
er, pugs | |||
but for it to be the default is questionable at best | 19:17 | ||
diotalevi | Well no.. most code doesn't need that kind of feature. Some does. | 19:18 | |
allbery_b | ?eval (sub {}).yaml | ||
evalbot_r14941 | "--- sub \{Syn \"block\" \{Noop}}\n" | ||
allbery_b | ?eval my $x; (sub { $x }).yaml | 19:19 | |
evalbot_r14941 | "--- sub \{Syn \"block\" \{Var \"\$x\"}}\n" | ||
allbery_b | good enough for you? | ||
hm. come to think of it... | 19:20 | ||
diotalevi | Uh... sure. | ||
allbery_b | ?eval my $x; (sub { $x }).perl | ||
evalbot_r14941 | "sub \{Syn \"block\" \{Var \"\$x\"}}" | ||
allbery_b | heh | ||
19:33
araujo joined
19:34
hugues23 joined
|
|||
diotalevi | &?BLOCK(...) rocks. Kinda ugly though. | 19:38 | |
araujo | ugliness is just other term for beauty | ||
PerlJam | no, ugliness is ugliness. It's just that everyone has their own personal threshhold for such things. | 19:42 | |
TimToady | we make some thing ugly on purpose to discourage people from using htem. | 19:48 | |
*them | |||
diotalevi | I was thinking that &?BLOCK is deliberately ugly to make it stand out especially since it's important as "unusual" flow control. | ||
araujo | No, ugliness is beauty. i can prove you that PerlJam | 19:49 | |
PerlJam | araujo: go for it! :-) | ||
araujo | PerlJam, You only say something is ugly when you know something 'more' beauty than it. | 19:51 | |
:-) | |||
TimToady | in other words, an ugly something has beauty, it's just negative. :) | 19:52 | |
araujo | yeah :-) | 19:53 | |
araujo always wins beer beats with this :-) | 19:57 | ||
argh, bet* | |||
TimToady | lunch & | 19:59 | |
araujo | enjoy TimToady | ||
20:08
weinig is now known as weinig|bbl
20:14
weinig|bbl is now known as weinig
|
|||
b_jonas | diotalevi: I don't think procedures of something that are just a fancy list in scheme either | 20:25 | |
(clarify) diotalevi: I don't think of procedures as just a fancy list in scheme either | 20:26 | ||
I think they're an opaque structure. | |||
on the other hand, perl doesn't usually have opaque structures, it's so dynamic it always provides a way to circumvent protection | 20:27 | ||
so maybe your view is better suited for perl6 | |||
TimToady | one could argue that eqv should tell you whether two routines "desugar" to the same AST. | 20:30 | |
that is, they're eqv if they have the same semantics | 20:31 | ||
though as with other forms of eqv, it depends on how good your canonicalization is. | 20:32 | ||
for instance, Perl 5 has an optimization that removes unneeded block scopes. | |||
but if that optimization were missing, it would change the canonicalizatoin | 20:33 | ||
or the C14n for those of us who can't type. :) | |||
[particle] | or C\d+n for those of us who can't spell ;) | 20:35 | |
TimToady | just as two hashes may or may not be eqv depending on whether the c14n sorts the entries. | ||
jrockway | heh, "can<M-/>" | 20:37 | |
TimToady | of course, %a eqv %b is unlikely to perform two sorts. | 20:39 | |
first it looks to see if the number of keys are the same. | 20:40 | ||
then it probably just looks up all the keys of %a in %b. | |||
and quits on the first mismatch | |||
(also comparing values at the same time) | 20:41 | ||
and if there's any way to guess which keys are likely to falsify earlier, it should do those first. :) | |||
b_jonas | g'night | 20:48 | |
diotalevi | TimToady: I didn't see where in the synopsis that the "alternate" version of eqv is spec'd. | 20:51 | |
?eval *eqv( 1, 1 ) # isn't the eqv infix operator. | 20:52 | ||
evalbot_r14941 | Bool::False | ||
TimToady | look for the bit in S03 that starts "If that's not enough flexibility" | 20:58 | |
diotalevi | Well yes, I tried that. | ||
Maybe it's just that Pugs didn't have eqv() yet that I was confused. | 20:59 | ||
?eval eqv( 1, 1 ) # no compatible subroutine found | 21:01 | ||
evalbot_r14941 | Error: No compatible subroutine found: "&eqv" | ||
TimToady | Pugs isn't the definition of Perl 6. :) | ||
diotalevi | Right... but it looks like it occasionally. | ||
21:06
bonsai joined
21:08
elmex joined
21:40
perlDreamer joined
|
|||
perlDreamer | I was wondering why all the perl6 efforts (pugs, parrot and p6-on-p5) don't use a centralized test suite instead of each having their own? | 21:44 | |
There would be less duplication of effort and it would help guarantee compliance to the synopses. | 21:46 | ||
[particle] | we haven't gotten there yet | 21:47 | |
perlDreamer | not enough tuits? | ||
[particle] | perl6 on parrot is *almost* ready to use Test.pm, which is written in perl6 | ||
...and in the pugs repo | |||
once we can 'use Test'; we can run the pugs test suite | 21:48 | ||
there will always be tests specific to each virtual machine | 21:49 | ||
so, parrot has its own suite for that, as does perl5 and haskell | |||
perlDreamer | sure, "quirks" testing | 21:50 | |
[particle] | no, compiler/vm testing | ||
not perl6 compiler | |||
but what's beneath it | |||
perl6 is a high level language. we're working toward a common test suite for perl6. | 21:51 | ||
but it's not possible to share a test suite for what's under the covers (the virtual machine) | |||
the virtual machine is where io/events/threading/exceptions/etc are implemented | 21:53 | ||
perlDreamer | What is the right way for a newbie to get involved in the common test suite for perl6? | ||
[particle] | get a pugs commit bit | ||
(that's easy) | |||
then start writing tests, and committing them :) | 21:54 | ||
perlDreamer | and will the parrot team be using the pugs test suite? | ||
allbery_b | if audrey were around she would have already offered you one just for showing up :) | ||
[particle] | i'll offer you one now | ||
perlDreamer | okay, thank you! | 21:55 | |
[particle] | all i need is your email address... here or by private message | ||
bit sent | 21:59 | ||
perl6-on-parrot will use the pugs test suite, yes | 22:01 | ||
he pugs test suite will probably (someday) be put in its own repository. for now, it lives in the pugs repo | 22:03 | ||
*the perl6 test suite... | |||
22:13
Aankhen`` joined
22:18
xdg joined
|
|||
svnbot6 | r14942 | perlDreamer++ | testing commit bit | 22:24 | |
[particle] | perlDreamer++ | 22:26 | |
[particle] heads off to do some errands | |||
diotalevi | Someone, send me a commit bit. | 22:48 | |
diotalevi lost his after the move and didn't bother to get a new one. | 22:49 | ||
22:58
diakopter joined
23:09
Psyche^ joined
23:18
nperez joined
23:22
Psyche^ is now known as Patterner
23:23
nanonyme joined
23:54
drbean joined
|