Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2007-12-02

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:06 theorbtwo joined #perl6
00:17 lambdabot joined #perl6
00:22 avar joined #perl6
00:28 turrepurre joined #perl6
00:29 gan joined #perl6
00:35 gan joined #perl6
00:44 gan left #perl6
01:56 meppl good night
02:10 Notrix joined #perl6
02:17 [particle] joined #perl6
02:25 akreal good morning, meppl! :)
02:55 mjk joined #perl6
02:56 * akreal is away: Отошёл.
03:00 ispy_ joined #perl6
03:07 jjore-m joined #perl6
03:47 ispy_ so does perl6 support complex-data structures just yet?
04:21 PerlJam Perl 6 does.  But it sounds more like you're asking about a particular implementation.  :)
04:23 ispy_ I want to know the equiv of @{ $struct{key} }
04:27 allbery_b @struct<key> I think
04:27 lambdabot Unknown command, try @list
04:27 PerlJam ispy_: you mean %hash<key>   ?
04:27 Khisanth heh
04:28 allbery_b <- been not thinking p6ish for too long, sigh
04:30 ispy_ ahh...
04:33 ispy_ hmm... @hash<key> doesn't work either...
04:34 allbery_b no, it won't
04:34 PerlJam %hash<key>  # note the punctuation.
04:34 allbery_b hence my "not thinking p6ish for too long":
04:35 allbery_b I think if %struct<key> contains an array then you get it
04:35 ispy_ but %hash<key> returns the array in scalar context.
04:35 allbery_b unlike p5 where yu get an arrayref you need to manually deref
04:35 PerlJam ispy_: not if you use it in a list/array context.
04:35 allbery_b ==PerlJam
04:35 allbery_b p6 is smarter about such things
04:35 PerlJam ispy_: if you want to force the listiness, you could surround it in @()
04:35 ispy_ that's what I figured, but it doesn't seem that way.
04:35 ispy_ ok.
04:36 ispy_ that's what I was wondering, if p6 had the equiv. of @{
04:36 ispy_ so that's it? @(
04:38 allbery_b yes
04:39 allbery_b it's a function-like thing now instead of special syntax
04:39 ispy_ I can hang with that.
04:39 ispy_ :)
04:39 ispy_ it's consistant.
04:40 ispy_ I was sorta thinking p6 had dynamic ref determination but, oh well :)
04:40 PerlJam "dynamic ref determination"?
04:40 allbery_b it does, usually, if I understand you correctly
04:40 PerlJam it does the right thing when used in the right context and you get the option to force a context.
04:41 allbery_b that said, some implementations may not support it properly yet
04:41 allbery_b p6 is still prerelease and in active development, after all
04:41 PerlJam for instance, %hash<key>[0..6] should work fine.
04:41 PerlJam no need for @() there
04:42 ispy_ right.
04:42 ispy_ also %hash<key>.[0] works too...
04:42 ispy_ which is nice.
04:42 ispy_ I'm really into p6 right now for some reason...
04:43 ispy_ just started fooling around with it last week.
05:05 neuromu joined #perl6
05:17 jisom joined #perl6
05:19 neuromu joined #perl6
05:29 neuromu joined #perl6
05:35 neuromu joined #perl6
06:55 diakopter joined #perl6
06:55 ether0 joined #perl6
07:44 cathyal joined #perl6
08:02 Psyche^ joined #perl6
08:40 Aankhen`` joined #perl6
09:33 drrho joined #perl6
09:34 luqui joined #perl6
09:38 barney joined #perl6
10:06 bw_hb joined #perl6
10:13 elmex joined #perl6
10:22 tokuhirom joined #perl6
10:22 iblechbot joined #perl6
11:02 ludan joined #perl6
11:03 ludan hi
11:04 moritz_ hi all, good localtime() ;)
11:22 * Aankhen`` waves at moritz_ and ludan.
11:25 bw_hb left #perl6
11:28 zester joined #perl6
11:46 hanekomu joined #perl6
11:50 hanekomu_ joined #perl6
11:58 pmurias joined #perl6
11:59 * pmurias waves at Aankhen``,moritz_ and ludan
11:59 * elmex waves at noone
12:00 * Aankhen`` surreptitiously waves at pmurias and elmex too.
12:00 Aankhen`` Yay, lots of waving action.
12:07 hanekomu joined #perl6
12:08 theorbtwo joined #perl6
13:24 hareldvd joined #perl6
13:29 pmurias Aankhen``: if it's nothing private why did you decide it will be better if you don't work on kp6-lisp?
13:34 hakobe joined #perl6
13:35 aindilis joined #perl6
13:38 Notrix joined #perl6
13:42 iblechbot joined #perl6
13:58 Aankhen`` pmurias: Basically, because I felt the way I work is very inappropriate for KP6. KP6 needs the "get as much done as you can right now" style whereas I'm obsessed with getting it done right and complete straight off the bat.
13:59 Aankhen`` (Which is naturally pretty much impossible, so I move at a glacial pace.)
14:00 pmurias Aankhen``: ok
14:32 syle2 joined #perl6
14:54 FurnaceBoy joined #perl6
15:16 kanru joined #perl6
15:23 hareldvd joined #perl6
15:39 masak joined #perl6
15:54 penk joined #perl6
15:56 devogon joined #perl6
16:04 chris2 joined #perl6
16:23 penk left #perl6
16:25 Psyche^ joined #perl6
16:25 penk joined #perl6
16:43 riffraff joined #perl6
16:44 [particle] joined #perl6
16:47 hanekomu joined #perl6
17:15 neuromu joined #perl6
17:32 thoughtpolice joined #perl6
17:34 pmurias pugs: my @array = [];say @array.perl;
17:34 exp_evalbot OUTPUT[[[],]␤]
17:35 moritz_ that looks a bit buggy
17:36 masak it's an array of an array
17:36 masak that shouldn't happen, right?
17:36 moritz_ masak: that would be ([],) or plain [],
17:36 Tene pugs: my @array = 1; say @array.perl;
17:36 exp_evalbot OUTPUT[[1,]␤]
17:36 Tene pugs: my @array = (); say @array.perl;
17:36 exp_evalbot OUTPUT[[]␤]
17:37 Tene pugs: my @array := []; say @array.perl;
17:37 exp_evalbot OUTPUT[[[],]␤]
17:37 moritz_ pugs: () ~~ [] ?? say "yes" !! say "no" ;
17:37 exp_evalbot OUTPUT[yes␤]
17:37 masak moritz_: I thought parentheses were only used for grouping in perl 6
17:37 moritz_ masak: yes, that's why ([],) and [], are the same thing
17:37 masak moritz_: yes
17:38 masak I suspect we're agreeing violently
17:39 masak moritz_: the output was `[[],]`, which looks like an array of an (empty) array to me
17:39 Aankhen`` Needs moar violence.
17:40 masak actually, pugs probably needs more tender care :)
17:41 Tene masak: I think that's accurate... what would you expect this to do:
17:41 Tene pugs: my @array = ([],); say @array.perl;
17:41 exp_evalbot OUTPUT[[[],]␤]
17:41 masak hm
17:41 masak Tene: still, in your example it feels like you're talking about two arrays
17:42 masak not pecause of the () but because of the ,
17:42 masak s/p/b/
17:42 Tene mugs my @a = 1,2; my @b = @a; @a.perl
17:42 Tene pugs: my @a = 1,2; my @b = @a; @a.perl
17:42 exp_evalbot RESULT["[1, 2]"␤]
17:42 moritz_ we need more mugs!
17:43 masak Tene: my intuition agrees with that last one
17:43 ahmadz joined #perl6
17:43 masak but not with
17:43 ahmadz left #perl6
17:43 masak pugs @a = []; @a.perl
17:43 masak pugs: @a = []; @a.perl
17:43 exp_evalbot OUTPUT[*** ␤    Unexpected " ="␤    expecting "::"␤    Variable "@a" requires predeclaration or explicit package name␤    at /tmp/NNtOrcbois line 1, column 3␤]
17:43 Tene pugs: my @a = 1,2; my @b = [@a]; @a.perl
17:43 exp_evalbot RESULT["[1, 2]"␤]
17:43 masak pugs: my @a = []; @a.perl
17:43 exp_evalbot RESULT["[[],]"␤]
17:44 Tene pugs: my @a = 1,2; my @b = [@a]; say @a.perl;
17:44 exp_evalbot OUTPUT[[1, 2]␤]
17:45 Tene pugs: my @a = 1,2; my @b = ([@a],); say @a.perl;
17:45 exp_evalbot OUTPUT[[1, 2]␤]
17:45 pugs_svn r19005 | moritz++ | [evalbot] no newline in RESULT[...]
17:45 Tene Hm.
17:45 exp_evalbot joined #perl6
17:45 masak I read `@a = []` as 'assign an empty array to @a', not as 'assign an empty array to the first element of @a'
17:46 masak moritz_++
17:46 Tene masak: how do you read: @a = 1
17:46 Tene ?
17:46 masak that newline really was unnecessary
17:46 masak Tene: that's different
17:46 pmurias masak: kp6 used to treat @a = [] as @a = () but it was changed
17:46 Tene masak: not as I understand it...
17:46 Tene [] is different from ()
17:46 masak hm
17:47 masak if we were talking about perl 5, I'd definitely agree
17:47 masak but I've had to relearn some things about arrays that perl 6 does
17:47 masak I thought this was one of them
17:47 pugs_svn r19006 | pmurias++ | [kp6] the multis are back
17:48 Tene However, I would not pbe surprised if pugs has this one case wrong.
17:48 Tene I can't get it to do the same thing with: @a = [@b];
17:48 Tene pugs: my @a = [1,2]; print @a.perl;
17:48 exp_evalbot OUTPUT[[[1, 2],]]
17:49 Tene pugs: my @a = 1,2; my @b = [@a]; say @b.perl;
17:49 exp_evalbot OUTPUT[[[1, 2],]␤]
17:49 Tene ... helps if I print the right array. ><
17:49 Tene Yes, it does the same thing with =[@]
17:49 masak Tene: my rationale would go something like this: in perl 6, every array is really a reference (as in perl 5's backslash). assigning [] to an array variable means giving it a reference to a new empty array
17:50 masak ...whereas assigning 1 to it would mean first packing it into an array and then assigning the reference for that
17:50 Tene Hm.
17:50 Tene masak: but it's already in array context because you're assigning to an array.
17:51 Tene consider:
17:51 Tene my @a = 1, 2; my $b = [@a]; print $b;
17:51 Tene my @a = 1, 2; my $b = [@a]; print $b.perl;
17:51 Tene pugs: my @a = 1, 2; my $b = [@a]; print $b.perl;
17:51 exp_evalbot OUTPUT[[1, 2]]
17:51 masak Tene: yes I know
17:51 masak I'm just not sure that applies in perl 6
17:51 Tene pugs: my @a = 1, 2; my @b = @a; print @b.perl;
17:51 exp_evalbot OUTPUT[[1, 2]]
17:52 Tene pugs: my @a = 1, 2; my @b = [@a]; print @b.perl;
17:52 exp_evalbot OUTPUT[[[1, 2],]]
17:52 Tene Should there be a difference between the second two?
17:52 Tene pugs: my @a = 1, 2; my @b := [@a]; print @b.perl;
17:52 exp_evalbot OUTPUT[[[1, 2],]]
17:53 masak Tene: I don't know. my brain hurts thinking about it
17:53 Tene masak: I don't know if it's what we should want or if matches the spec, but it seems consistent to me.
17:54 masak @ask TimToady what `my @a = []` should put in @a, [] or [[]]? pugs now does the latter
17:54 lambdabot Consider it noted.
17:54 masak @thx
17:54 lambdabot you are welcome
17:54 pmurias masak: i think you rationale proves that @array = []; sets the first element to []
17:55 masak pmurias: go on
17:55 Tene masak: you can think of anything in list context as being wrapped in ( ... )
17:56 pmurias it wouldn't be possible to recognise what @bar = $foo does with knowing the type of $foo
17:56 pmurias which would be bad
17:56 masak agreed.
17:59 pmurias eval: my @a = (1,2,3);@b = @a;say @a;
18:00 Tene pugs: my @a = (1,2,3); @b = @a; say @b.perl;
18:00 exp_evalbot OUTPUT[*** ␤    Unexpected " ="␤    expecting "::"␤    Variable "@b" requires predeclaration or explicit package name␤    at /tmp/6Y6oG6GSE6 line 1, column 20␤]
18:00 Tene pugs: my @a = (1,2,3); my @b = @a; say @b.perl;
18:00 exp_evalbot OUTPUT[[1, 2, 3]␤]
18:00 pmurias kp6: my @a = (1,2,3);@b = @a;say @a;
18:00 Tene pugs: my @a = [1,2,3]; say @a.perl;
18:01 exp_evalbot r19006: OUTPUT[invalid type on Array.BIND at compiled/perl5-kp6-mp6/lib/KindaPerl6/Runtime/Perl5/Container.pm line 297.␤data: undef␤type: Undef␤]
18:01 exp_evalbot OUTPUT[[[1, 2, 3],]␤]
18:02 pmurias kp6: my @a = (1,2,3);my @b = @a;say @a;
18:03 exp_evalbot r19006: OUTPUT[123␤]
18:03 pmurias good ;)
18:11 TimToady [] always produces a scalar value, even in list context
18:11 lambdabot TimToady: You have 1 new message. '/msg lambdabot @messages' to read it.
18:11 Tene That's what I thought.
18:25 masak ah, so pugs's output [[]] was correct, and y'all were right. I stand corrected.
18:25 Ace__ joined #perl6
18:36 kanru joined #perl6
18:39 Notrix joined #perl6
18:50 pmurias exp_evalbot: help
18:50 exp_evalbot pmurias: Usage: <(nqp|perl6|pugs|p6|kp6): $perl6_program>
18:50 pmurias p6: my @a = (1,2,3);my @b=@a;say @b.perl;
18:50 exp_evalbot OUTPUT[Method 'perl' not found␤current instr.: 'parrot;Perl6::Compiler;main' pc 138 (perl6.pir:98)␤]
18:51 pmurias perl6: my @a = (1,2,3);my @b=@a;say @b.perl;
18:51 exp_evalbot kp6: OUTPUT[[ 1, 2, 3 ]␤]
18:51 exp_evalbot ..pugs: OUTPUT[[1, 2, 3]␤]
18:51 exp_evalbot ..p6: OUTPUT[Method 'perl' not found␤current instr.: 'parrot;Perl6::Compiler;main' pc 138 (perl6.pir:98)␤]
18:51 exp_evalbot ..nqp: OUTPUT[src/pmc_freeze.c:1254: failed assertion 'must_have_seen'␤Backtrace - Obtained 19 stack frames (max trace depth is 32).␤  Parrot_print_backtrace␤    Parrot_confess␤      (unknown)␤        (unknown)␤          (unknown)␤            (unknown)␤              Parrot_thaw␤
18:51 exp_evalbot ..PackFile_Constant_unpack_pmc␤                  PackFile_Con...
18:51 pmurias perl6: my @a = (1,2,3);my @b=@a;say @b;
18:51 exp_evalbot kp6: OUTPUT[123␤]
18:51 exp_evalbot ..pugs: OUTPUT[123␤]
18:51 exp_evalbot ..p6: OUTPUT[1 2 3␤]
18:51 exp_evalbot ..nqp: OUTPUT[src/pmc_freeze.c:1254: failed assertion 'must_have_seen'␤Backtrace - Obtained 19 stack frames (max trace depth is 32).␤  Parrot_print_backtrace␤    Parrot_confess␤      (unknown)␤        (unknown)␤          (unknown)␤            (unknown)␤              Parrot_thaw␤
18:51 exp_evalbot ..PackFile_Constant_unpack_pmc␤                  PackFile_Con...
18:53 pmurias it's a fun way to flood the channel ;)
18:54 Tene perl6: "hi pmurias!"
18:54 exp_evalbot kp6: RESULT['hi pmurias!'␤]
18:54 exp_evalbot ..pugs: RESULT["hi pmurias!"␤]
18:54 exp_evalbot ..p6: RESULT[Null PMC access in invoke()␤current instr.: 'parrot;Perl6::Compiler;main' pc 138 (perl6.pir:98)␤]
18:54 exp_evalbot ..nqp: OUTPUT[src/pmc_freeze.c:1254: failed assertion 'must_have_seen'␤Backtrace - Obtained 19 stack frames (max trace depth is 32).␤  Parrot_print_backtrace␤    Parrot_confess␤      (unknown)␤        (unknown)␤          (unknown)␤            (unknown)␤              Parrot_thaw␤
18:54 exp_evalbot ..PackFile_Constant_unpack_pmc␤                  PackFile_Con...
18:55 pmurias parrot dosn't like me ;(
18:56 pmurias perl6: say "hi Tene!"
18:56 exp_evalbot kp6: OUTPUT[hi Tene!␤]
18:56 exp_evalbot ..pugs: OUTPUT[hi Tene!␤]
18:56 exp_evalbot ..p6: OUTPUT[hi Tene!␤]
18:56 exp_evalbot ..nqp: OUTPUT[src/pmc_freeze.c:1254: failed assertion 'must_have_seen'␤Backtrace - Obtained 19 stack frames (max trace depth is 32).␤  Parrot_print_backtrace␤    Parrot_confess␤      (unknown)␤        (unknown)␤          (unknown)␤            (unknown)␤              Parrot_thaw␤
18:56 exp_evalbot ..PackFile_Constant_unpack_pmc␤                  PackFile_Con...
18:56 Tene perl6: say("omg whats up pmurias???")
18:56 exp_evalbot kp6: OUTPUT[omg whats up pmurias???␤]
18:56 exp_evalbot ..pugs: OUTPUT[omg whats up pmurias???␤]
18:56 exp_evalbot ..p6: OUTPUT[omg whats up pmurias???␤]
18:56 exp_evalbot ..nqp: OUTPUT[src/pmc_freeze.c:1254: failed assertion 'must_have_seen'␤Backtrace - Obtained 19 stack frames (max trace depth is 32).␤  Parrot_print_backtrace␤    Parrot_confess␤      (unknown)␤        (unknown)␤          (unknown)␤            (unknown)␤              Parrot_thaw␤
18:56 exp_evalbot ..PackFile_Constant_unpack_pmc␤                  PackFile_Con...
19:12 wolverian ouch
19:29 pmurias sorry
19:36 pmurias how should be perl5 and perl6 modules be seperated at use time in kp6 (a different PERL6LIB env variable?)
19:38 pmurias and possibly failing back on PERL5LIB?
19:45 jjore-m joined #perl6
19:49 [particle1 joined #perl6
20:02 DarkWolf84 joined #perl6
20:36 rindolf joined #perl6
20:47 devogon joined #perl6
21:31 theorb joined #perl6
21:43 jisom joined #perl6
22:06 jisom_ joined #perl6
22:32 nothingmuch joined #perl6
22:56 Free_maN joined #perl6

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

Perl 6 | Reference Documentation | Rakudo