Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2006-12-29

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:08 turrepurre joined perl6
00:17 neonse left perl6
00:23 avar joined perl6
00:23 avar joined perl6
00:41 hexmode joined perl6
00:43 diakopter joined perl6
01:41 kanru joined perl6
02:02 buetow joined perl6
02:16 xinming joined perl6
02:18 nipotaway is now known as nipotan
02:19 bonesss joined perl6
02:27 nipra joined perl6
02:29 nipra is now known as nipra_
02:41 dmq joined perl6
02:47 mjk joined perl6
02:50 mjk joined perl6
02:54 xinming joined perl6
02:59 xinming joined perl6
03:32 xinming joined perl6
03:37 pasteling "beppu_" at 72.134.38.155 pasted "svk sync problem" (5 lines, 210B) at http://sial.org/pbot/22036
03:38 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
03:38 beppu_ I'll try that.
03:38 clkao or upgrade to svk 2.0 ;)
03:39 beppu_ one step at a time.  ;)
03:43 beppu_ looks like it's working.  Thanks. clkao.
03:44 xinming joined perl6
03:55 xinming joined perl6
04:05 luqui joined perl6
04:22 xinming joined perl6
04:27 xinming_ joined perl6
04:40 luqui joined perl6
04:49 xinming__ joined perl6
04:57 rizen joined perl6
04:59 xinming joined perl6
05:02 kanru joined perl6
05:07 xinming joined perl6
05:21 xinming_ joined perl6
05:26 imperator joined perl6
05:28 nipra joined perl6
05:32 baest_ joined perl6
05:38 xinming joined perl6
05:44 xinming joined perl6
05:50 xinming joined perl6
05:58 Dr_Pi joined perl6
06:02 drbean left perl6
06:04 Dr_Pi_ joined perl6
06:12 BooK joined perl6
06:15 baest_ is now known as baest
06:30 xinming joined perl6
06:42 xinming joined perl6
06:53 RHainsworth joined perl6
06:54 RHainsworth left perl6
07:21 ayrnieu joined perl6
07:24 araujo joined perl6
07:31 pstickne joined perl6
07:31 pstickne hello
07:33 wolverian welcome!
07:33 wolverian 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.
07:34 pstickne in Perl6 are classes objects or are they still tied to a namespace?
07:34 integral Yes.
07:34 wolverian namespaces are objects too...
07:34 wolverian see the relevant synopses on spec.pugscode.org
07:35 pstickne I guess a better question; are classes definitions or are they executable in their own notion of 'self'?
07:35 pstickne wolverian, heh
07:35 wolverian those are still not quite exclusive.. :)
07:35 pstickne uhh.
07:35 wolverian but yes, everything is an object, and classes are pseudoprototypical.
07:35 wolverian see S12 for the OO stuff.
07:35 pstickne ooh.
07:36 pstickne And it's just a message-based OO system?
07:36 wolverian the synopsis explains it better than I do! really!
07:36 wolverian :)
07:36 pstickne okay, okay :P
07:36 wolverian you'll probably have questions even after reading it
07:36 wolverian those are the ones you should ask :)
07:38 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:39 ruz_ joined perl6
07:59 canine_kouji joined perl6
08:04 dolmans joined perl6
08:16 iblechbot joined perl6
08:28 Psyche^ joined perl6
08:37 xinming joined perl6
08:38 devogon joined perl6
08:44 Psyche^ is now known as Patterner
09:04 luqui ?eval (10**309)**2
09:04 evalbot_r14941 Inf
09:04 luqui ?eval (10**309)*(10**309)
09:04 evalbot_r14941 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
09:04 luqui that doesn't seem like reasonable behavior
09:04 luqui (I think the first one is wrong)
09:06 canine_kouji scary
09:06 canine_kouji left perl6
09:15 pstickne The 2nd doesn't seem correct either.
09:15 pstickne Ohh, I guess eval-bot truncation.
09:17 gaal > (10**309)**2
09:18 lambdabot Infinity
09:18 gaal > (10**309)*(10**309)
09:18 lambdabot Infinity
09:18 luqui > (10^309)^2
09:18 lambdabot 1000000000000000000000000000000000000000000000000000000000000000000000000000...
09:18 gaal @type (^)
09:18 gaal @type (**)
09:18 lambdabot forall a b. (Integral b, Num a) => a -> b -> a
09:18 lambdabot forall a. (Floating a) => a -> a -> a
09:19 wolverian @type (10**309)**2
09:19 lambdabot forall a. (Floating a) => a
09:19 wolverian I suppose it defaults to a finite one. :)
09:19 luqui right.  I think perl was smart not to have a **, ^, and ^^
09:19 luqui but it makes these semantics a little tricky
09:20 kattana_ joined perl6
09:22 b_jonas joined perl6
09:24 wolverian toInteger is a bit long too..
09:24 wolverian on that note, I don't think I've ever needed it.
09:24 luqui ?eval ((10/1)**(309/1))**(2/1)
09:25 evalbot_r14941 Inf
09:25 luqui okay good
09:25 luqui whew
09:25 wolverian that's good? :)
09:25 luqui well, no
09:25 luqui but it's different on my local copy
09:25 luqui so I was determining whether it was my change that did it
09:26 luqui The exponential operator definitely needs some work
09:26 luqui it stringifies the number and then sees if it ends in ".0" to determine if it is an integer
09:26 luqui but I need to clarify the semantics
09:26 wolverian heh
09:27 wolverian 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
09:28 wolverian 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
09:29 wolverian good point.
09:30 gaal haskell has a 'default' keyword for this
09:30 xinming joined perl6
09:30 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:31 luqui you don't have to right now either
09:32 luqui fromIntegral (floor x) == x
09:32 luqui but the test suite didn't like that one very much
09:35 xinming_ joined perl6
09:36 gaal quirk-compat with p5?
09:42 elmex joined perl6
09:52 ofer0 joined perl6
09:53 penk joined perl6
10:27 chris2 joined perl6
10:36 xinming joined perl6
10:42 wilx` joined perl6
10:53 wilx` is now known as wilx
11:05 nipra joined perl6
11:06 xinming joined perl6
11:16 lovecoder joined perl6
11:22 buetow joined perl6
11:24 BooK_ joined perl6
11:41 lovecoder left perl6
11:45 lovec0der joined perl6
11:49 xinming joined perl6
12:45 nipotan is now known as nipotaway
13:00 kanru joined perl6
13:22 bonesss joined perl6
13:31 b_jonas would you mind if I asked a few more beginner perl6 questions?
13:32 b_jonas When does an Array flatten in list context? Always? Or only when it comes from an @variable?
13:43 ruz joined perl6
13:43 gaal not an authoritative answer, but "always in list context" makes way more sense to em
13:44 wolverian right. put it in a Capture otherwise.
13:45 wolverian (hmm.. no feature <flatten>;)
13:54 b_jonas joined perl6
14:11 weinig|bbl is now known as weinig
14:12 turrepurre joined perl6
14:16 b_jonas (if anyone answered my Array question, please repeat it because I lost the irc)
14:20 wolverian b_jonas, http://colabti.de/irclogger/irclogger_log/perl6?date=2006-12-29,Fri :)
14:20 lambdabot Title: #perl6 2006-12-29,Fri, http://tinyurl.com/y59fnf
14:20 buubot http://xrl.us/t26s
14:20 lambdabot Title: #perl6 2006-12-29,Fri
14:20 wolverian eek
14:36 nipra_ is now known as nipra
14:36 penk joined perl6
14:37 weinig joined perl6
14:38 b_jonas wolverian: thanks
14:39 b_jonas 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:41 b_jonas I know that the | operator flattens explicitly
14:42 b_jonas ah wait
14:42 b_jonas S03 says
14:42 b_jonas "In list context, a Scalar holding an Array object does not flatten."
14:42 b_jonas so it's not the silgil what counts but the container
14:42 b_jonas I was reading the wrong S (it's not always easy to know which one to read)
14:44 wolverian b_jonas, yeah, that's a problem (which spec to read). the specs aren't really in a Q&A format.
14:45 wolverian (which makes sense, since they're specs. but that sort of docs would be nice too.)
14:47 b_jonas I'd like a reference docs format, not a Q&A format docs.
14:47 [particle] we have a wiki
14:47 b_jonas Just like the reference docs perldocs.
14:47 b_jonas In perl5 I mean.
14:49 wolverian perldocs are a bit bloated too, nowadays..
14:49 b_jonas yes I know
14:49 wolverian but, anyway. yeah, the wiki is a good idea.
14:49 b_jonas they don't explain some things about perl5.
14:50 b_jonas 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.
14:50 wolverian (from you)
14:50 [particle] even if you just create a wishlist on the wiki, and list that item with a good description, it'd help
14:50 wolverian uncertainty principle, of sorts..
14:51 b_jonas I can understand. I'm lazy to write good docs too.
14:53 b_jonas (and it's still much better than the ruby docs, though the readable ruby source sort of compensates that)
14:54 b_jonas (the ruby standard library is documented pretty well, but the language itself isn't)
14:54 [particle] ruby is also *very* young
14:56 b_jonas sure
14:56 b_jonas but perl1 was already well documented
14:57 b_jonas :)
14:57 b_jonas ruby isn't that young now btw
14:57 [particle] well, perl can vote
14:58 b_jonas ruby is more than 10 years old now
15:20 b_jonas I can't see how these perl6 context variables are better than plain temp/local variables.
15:32 vel joined perl6
15:47 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:52 b_jonas I think the of-type of multi functions is matched with the context
15:52 b_jonas and most operators will be of-typed
15:53 b_jonas but even in a normal function, I guess the last expression and the argument to return is evaluated in that context
15:53 b_jonas the differenct is, perl6 will have a plethora of contexts, not just 3 as perl5 did
15:54 wolverian perl5 has lots of contexts too
15:54 b_jonas not really
15:54 b_jonas I mean, they are used only in a few places
15:55 wolverian (perldoc overload)
15:55 wolverian yeah, but perl5 doesn't have a real type system either :)
15:55 b_jonas hmm, I sort of see what you mean
15:56 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:57 wolverian or MMD if you like to think of it that way
15:57 wolverian (vague from a theoretical viewpoint)
15:57 b_jonas yeah
16:12 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 allbery_b (see also:  magic handling of $a and $b with sort)
16:24 Dr_Pi joined perl6
16:29 spoop joined perl6
16:32 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:41 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:42 allbery_b unless you specifically tell it otherwise, e.g.. my @x is Str;
16:42 allbery_b or something like that
16:43 [particle] of Str iirc
16:43 allbery_b yeh, was just checking that because it looked not quite right
16:44 allbery_b or my Str @x;
16:44 allbery_b (per S09)
16:50 hexmode joined perl6
16:51 [particle] really? that creates an array of Str?
16:53 [particle] hrm, so it seems
16:53 allbery_b S09 implied it.  might be leftover syntax like TimToady found the other day
16:54 [particle] according to S02, i think that's right.
16:54 [particle] the type constraint is on the value in my Str @x
16:54 [particle] there are also container constraints, like my @x is MyArray
16:58 allbery_b yeh
17:01 nipra joined perl6
17:03 Dr_Pi_ joined perl6
17:18 diotalevi joined perl6
17:22 BooK joined perl6
17:24 araujo joined perl6
17:41 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:42 allbery_b presumably it's using the value of $x, which (being uninitialized) is undef
17:43 RHainsworth joined perl6
17:43 allbery_b (whether it's supposed to be lazy or not is a question for the experts...)
17:44 [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 perl6
17:49 [particle] reference?
17:49 [particle] what are you trying to get?
17:49 [particle] s/get/do/
17:53 polettix joined perl6
17:53 zgh joined perl6
17:55 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:56 diotalevi ?eval my $x; my $y = any( $x ); $x = 1; $y == 1;
17:56 evalbot_r14941 (Bool::False)
17:56 diotalevi ?eval my $x; my $y = any( \ $x ); $x = 1; $y == 1;
17:56 evalbot_r14941 (Bool::False)
17:59 [particle] ?eval my $x; my $y = list any($x); $x = 1; $y == 1;
17:59 evalbot_r14941 (Bool::False)
17:59 diotalevi ?eval my $x; my $y = any( ->{$x} ); $x = 1; $y == 1 # so capture $x instead
17:59 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
17:59 allbery_b (gesundheit :p)
17:59 [particle] evalbot go boom
17:59 diotalevi ?eval my $x; my $y = any( ->{$x} ); $x = 1; $y->() == 1
17:59 evalbot_r14941 Error: ␤Unexpected "->()"␤expecting "::", term postfix or operator
18:00 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
18:00 diotalevi So.
18:00 allbery_b ?eval my $x; my $y = any( ->{$x} ); $x = 1; $y() == 1
18:00 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
18:00 allbery_b oh well
18:01 diotalevi Oh that's an interesting error.
18:01 [particle] ?eval my $x; my $y = any(list($x)); $x = 1; $y == 1;
18:02 evalbot_r14941 (Bool::False)
18:06 b_jonas of Str? just because I assigned a single Str element?
18:06 b_jonas that sounds strange to me
18:07 b_jonas 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?
18:07 evalbot_r14941 Bool::False
18:07 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
18:08 [particle] b_jonas: it's not type constrained unless specified during declaration
18:08 [particle] it == the variable (container)
18:10 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
18:10 diotalevi It's perfectly sensible. They are the same data, they should be able to be compared for equivalence.
18:12 diotalevi ?eval [1..4] eqv [1..4] # those are two different containers of equivalent value.
18:12 evalbot_r14941 Bool::True
18:12 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()
18:12 [particle] ?eval any(1) == 1
18:13 evalbot_r14941 (Bool::True)
18:13 allbery_b potentially they're not because closures can capture variables form their context
18:13 diotalevi that's just a recursive check then, allbery_b. You now test the lexical environment for equivalence.
18:14 allbery_b better example: my ($x, $y); my $a = sub { ($x, $y) }; sub g { my $y; sub { ($x, $y) } }; $a eqv g()
18:14 BooK joined perl6
18:14 allbery_b $y is different in both cases.  and checking contexts can become difficult (and potentially exponential) as the code becomes more complex
18:15 lumi Halting problem?
18:15 allbery_b I could imagine it if there's something defined circularly in some context
18:17 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 perl6
18:17 allbery_b ==b_jonas
18:17 diotalevi So what happens in scheme or other lisps when I say (equal (lambda () 1) (lambda () 1))?
18:17 b_jonas diotalevi: scheme allows either output there
18:18 diotalevi b_jonas: there's a different operator for identity/address equality.
18:18 b_jonas yes, but for procedures they're the same
18:18 b_jonas I mean in scheme
18:18 allbery_b depends on whether it recognizes that they have the same context and unifies them, I suspect
18:19 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)
18:19 b_jonas like, sub f { sub {} } will always return the same sub as an optimization
18:21 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 diotalevi So some kind of equality comparison becomes important to me pretty quickly.
18:22 diotalevi eqv seemed like a pretty obvious choice.
18:25 b_jonas so you want eqv to do a deep comparision on the subs?
18:25 diotalevi Yes.
18:25 diotalevi Or some other operator probably named 'equal'.
18:26 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.
18:27 diotalevi 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:28 diotalevi 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
18:28 diotalevi Ruby matters?
18:28 b_jonas no
18:28 b_jonas just like with $/
18:28 diotalevi Their bug is their bug. They can fix it.
18:29 b_jonas perl6 calls the regexp match variable $/, just to be different. ($~ in ruby)
18:32 b_jonas $/ will also confuse all the perl5ers as well, so it's a very bad name imo.
18:34 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:36 diotalevi 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
18:36 b_jonas as for @- and @+, they're currently not used much because they were new in 5.8 I think
18:37 diotalevi they're new in 5.6.0, b_jonas.
18:38 diotalevi Or perhaps farther back.
18:38 b_jonas maybe
18:38 * diotalevi uses those in 5.6.
18:39 b_jonas indeed, it's in 5.6.1
18:39 diotalevi you found the perldelta entry?
18:39 b_jonas no, just tried an 5.6.1
18:39 b_jonas and 5.6.1 I had on some machine
18:42 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:44 diotalevi I mean, it does seem pretty obvious (to me).
18:49 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.
18:50 TimToady my gut feeling is that sub{$x} and sub{$y} cannot be eqv unless $x and $y are aliases, regardless of their values.
18:53 TimToady 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.
18:54 * 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.
18:55 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?
18:56 TimToady so it's a question of ownership, which I'll admit is complex
18:56 TimToady why would those be eqv?
18:56 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?
18:57 b_jonas because both are two-element arrays and their respective arrays are eqv
18:57 Odin-LAP joined perl6
18:57 TimToady eqv is defined in terms of "if it were serialized"
18:57 b_jonas hmm
18:57 TimToady and just as there are various ways to serialize
18:57 TimToady there are various ways to compute eqv.
18:58 TimToady eqv takes optional arguments specifying that.
18:58 b_jonas uh
18:58 TimToady just as cmp does
18:58 b_jonas ok
18:58 TimToady we have to pick a default, but that's all it is--a default.
18:59 TimToady 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?
19:00 TimToady it's attempting to say the same thing
19:01 TimToady but it's still a subjunctive "if I *were* to canonicalize this..."
19:01 TimToady the eqv and cmp don't actually have to do the canonicalization.
19:01 TimToady just produce results consistent with it.
19:02 TimToady basically comes down to that you have to compare the bits in the same order that a canonicalizer would visit.
19:02 TimToady but you can short circuit
19:03 TimToady 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.
19:04 TimToady === doesn't have variants like eqv does
19:04 TimToady === always compares identity, which for value types is the value
19:04 TimToady but for mutable types is always the address
19:04 neonse joined perl6
19:05 TimToady if you can serialize a closure, you can eqv it.
19:06 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 diotalevi Even Perl 5 had that much.
19:07 allbery_b er?  sub {} is an opaque coderef in perl5
19:07 diotalevi No it isn't, allbery_b. B::*.
19:08 TimToady that is *one* serialization method
19:08 TimToady see also YAML
19:08 TimToady (which happens to attempt to use B::* underneath, iirc)
19:09 * allbery_b tends to think of B::* as grotting around in internals one really isn't supposed to mess with
19:09 * TimToady too
19:09 diotalevi allbery_b: there's a trick to it. You just have to declare that you're supposed to be there.
19:09 allbery_b and, well, if you want Scheme, perhaps you should use Scheme.
19:10 * 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...
19:12 diotalevi 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:13 allbery_b I have libraries.  it's still horribly clunky compared to Perl
19:14 allbery_b likewise, what you're trying to do is clunky and "unnatural" in Perl
19:15 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 diotalevi That's purely about my feeling though.
19:16 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 allbery_b er, pugs
19:17 allbery_b but for it to be the default is questionable at best
19:18 diotalevi Well no.. most code doesn't need that kind of feature. Some does.
19:18 allbery_b ?eval (sub {}).yaml
19:18 evalbot_r14941 "--- sub \{Syn \"block\" \{Noop}}\n"
19:19 allbery_b ?eval my $x; (sub { $x }).yaml
19:19 evalbot_r14941 "--- sub \{Syn \"block\" \{Var \"\$x\"}}\n"
19:19 allbery_b good enough for you?
19:20 allbery_b hm.  come to think of it...
19:20 diotalevi Uh... sure.
19:20 allbery_b ?eval my $x; (sub { $x }).perl
19:20 evalbot_r14941 "sub \{Syn \"block\" \{Var \"\$x\"}}"
19:20 allbery_b heh
19:33 araujo joined perl6
19:34 hugues23 joined perl6
19:38 diotalevi &?BLOCK(...) rocks. Kinda ugly though.
19:38 araujo ugliness is just other term for beauty
19:42 PerlJam no, ugliness is ugliness.  It's just that everyone has their own personal threshhold for such things.
19:48 TimToady we make some thing ugly on purpose to discourage people from using htem.
19:48 TimToady *them
19:48 diotalevi I was thinking that &?BLOCK is deliberately ugly to make it stand out especially since it's important as "unusual" flow control.
19:49 araujo No, ugliness is beauty. i can prove you that PerlJam
19:49 PerlJam araujo: go for it!  :-)
19:51 araujo PerlJam, You only say something is ugly when you know something 'more' beauty than it.
19:51 araujo :-)
19:52 TimToady in other words, an ugly something has beauty, it's just negative.  :)
19:53 araujo yeah :-)
19:57 * araujo always wins beer beats with this :-)
19:57 araujo argh, bet*
19:59 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
20:25 b_jonas diotalevi: I don't think procedures of something that are just a fancy list in scheme either
20:26 b_jonas (clarify) diotalevi: I don't think of procedures as just a fancy list in scheme either
20:26 b_jonas I think they're an opaque structure.
20:27 b_jonas 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 b_jonas so maybe your view is better suited for perl6
20:30 TimToady one could argue that eqv should tell you whether two routines "desugar" to the same AST.
20:31 TimToady that is, they're eqv if they have the same semantics
20:32 TimToady though as with other forms of eqv, it depends on how good your canonicalization is.
20:32 TimToady for instance, Perl 5 has an optimization that removes unneeded block scopes.
20:33 TimToady but if that optimization were missing, it would change the canonicalizatoin
20:33 TimToady or the C14n for those of us who can't type. :)
20:35 [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.
20:37 jrockway heh, "can<M-/>"
20:39 TimToady of course, %a eqv %b is unlikely to perform two sorts.
20:40 TimToady first it looks to see if the number of keys are the same.
20:40 TimToady then it probably just looks up all the keys of %a in %b.
20:40 TimToady and quits on the first mismatch
20:41 TimToady (also comparing values at the same time)
20:41 TimToady and if there's any way to guess which keys are likely to falsify earlier, it should do those first.  :)
20:48 b_jonas g'night
20:51 diotalevi TimToady: I didn't see where in the synopsis that the "alternate" version of eqv is spec'd.
20:52 diotalevi ?eval *eqv( 1, 1 ) # isn't the eqv infix operator.
20:52 evalbot_r14941 Bool::False
20:58 TimToady look for the bit in S03 that starts "If that's not enough flexibility"
20:58 diotalevi Well yes, I tried that.
20:59 diotalevi Maybe it's just that Pugs didn't have eqv() yet that I was confused.
21:01 diotalevi ?eval eqv( 1, 1 ) # no compatible subroutine found
21:01 evalbot_r14941 Error: No compatible subroutine found: "&eqv"
21:01 TimToady Pugs isn't the definition of Perl 6.  :)
21:01 diotalevi Right... but it looks like it occasionally.
21:06 bonsai joined perl6
21:08 elmex joined perl6
21:40 perlDreamer joined perl6
21:44 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:46 perlDreamer There would be less duplication of effort and it would help guarantee compliance to the synopses.
21:47 [particle] we haven't gotten there yet
21:47 perlDreamer not enough tuits?
21:47 [particle] perl6 on parrot is *almost* ready to use Test.pm, which is written in perl6
21:47 [particle] ...and in the pugs repo
21:48 [particle] once we can 'use Test'; we can run the pugs test suite
21:49 [particle] there will always be tests specific to each virtual machine
21:49 [particle] so, parrot has its own suite for that, as does perl5 and haskell
21:50 perlDreamer sure, "quirks" testing
21:50 [particle] no, compiler/vm testing
21:50 [particle] not perl6 compiler
21:50 [particle] but what's beneath it
21:51 [particle] perl6 is a high level language. we're working toward a common test suite for perl6.
21:51 [particle] but it's not possible to share a test suite for what's under the covers (the virtual machine)
21:53 [particle] 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?
21:53 [particle] get a pugs commit bit
21:53 [particle] (that's easy)
21:54 [particle] then start writing tests, and committing them :)
21:54 perlDreamer and will the parrot team be using the pugs test suite?
21:54 allbery_b if audrey were around she would have already offered you one just for showing up :)
21:54 [particle] i'll offer you one now
21:55 perlDreamer okay, thank you!
21:55 [particle] all i need is your email address... here or by private message
21:59 [particle] bit sent
22:01 [particle] perl6-on-parrot will use the pugs test suite, yes
22:03 [particle] he pugs test suite will probably (someday) be put in its own repository. for now, it lives in the pugs repo
22:03 [particle] *the perl6 test suite...
22:13 Aankhen`` joined perl6
22:18 xdg joined perl6
22:24 svnbot6 r14942 | perlDreamer++ | testing commit bit
22:26 [particle] perlDreamer++
22:26 * [particle] heads off to do some errands
22:48 diotalevi Someone, send me a commit bit.
22:49 * diotalevi lost his after the move and didn't bother to get a new one.
22:58 diakopter joined perl6
23:09 Psyche^ joined perl6
23:18 nperez joined perl6
23:22 Psyche^ is now known as Patterner
23:23 nanonyme joined perl6
23:54 drbean joined perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo