Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2010-04-13

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:00 thowe it seems uncommon though.
00:00 lue I personally put [ if thisandthat { \n code here... \n } ]
00:00 pausenclown i find myself being very differential in this matter
00:02 pausenclown i would like a 1 line non blocked version of if
00:02 snarkyboojum thowe: I tend to find I align my style with whatever I'm contributing to, e.g. the Perl 6 code in Rakudo, or what other guys are working on like masak++ :) That seems to feed back into my everyday coding which is kinda interesting
00:02 lue (basically, I consider the { part of the line (whether it's saying if, while, etc.), and I let } line up with the block.)
00:02 lue pausenclown: that makes clarity suffer, so that will likely never happen.
00:03 pausenclown its fine in Javascript.
00:04 snarkyboojum well, you have statement if (condition) :)
00:04 lue yes, there's that.
00:04 lue rakudo: my $true = True; say "hello" if $true
00:04 pausenclown true. but where do i put the fucking else? =)
00:04 p6eval rakudo b9aaa3: OUTPUT«hello␤»
00:04 snarkyboojum oh you didn't mention else :)
00:04 snarkyboojum in which case you have a ternary op :P
00:05 lue for if/else, use [conditon]??[success]!![failure]
00:05 pausenclown i think the ternary is only for when it has a lvalue
00:06 diakopter std: foo: sub bar() { }; goto bar;
00:06 p6eval std 30379: OUTPUT«ok 00:01 108m␤»
00:06 pausenclown not just for side effects
00:09 lue rakudo: my $true = True; $true ?? say "hi" !! say "boo"; say "hi" if $true else say "boo";
00:09 p6eval rakudo b9aaa3: OUTPUT«Confused at line 11, near "say \"hi\" i"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
00:09 lue rakudo: my $true = True; $true ?? say "hi" !! say "boo";
00:09 p6eval rakudo b9aaa3: OUTPUT«hi␤»
00:10 lue rakudo: my $true = True; say "hi" if $true else say "boo";
00:10 p6eval rakudo b9aaa3: OUTPUT«Confused at line 11, near "say \"hi\" i"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
00:11 colomon rakudo: rakudo: my $true = True; say $true ?? "hi" !! "boo";
00:11 p6eval rakudo b9aaa3: OUTPUT«Confused at line 11, near "rakudo: my"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
00:11 colomon rakudo: my $true = True; say $true ?? "hi" !! "boo";
00:11 p6eval rakudo b9aaa3: OUTPUT«hi␤»
00:12 pausenclown rakudo: say Bool::True
00:12 p6eval rakudo b9aaa3: OUTPUT«1␤»
00:12 pausenclown rakudo: say Bool::True.WHAT
00:12 p6eval rakudo b9aaa3: OUTPUT«Bool()␤»
00:13 pausenclown rakudo: say Bool::True + 2
00:13 p6eval rakudo b9aaa3: OUTPUT«3␤»
00:13 pausenclown rakudo: say 2 + -(Bool::True)
00:13 p6eval rakudo b9aaa3: OUTPUT«1␤»
00:14 pausenclown rakudo: say 1 == Bool::True
00:14 p6eval rakudo b9aaa3: OUTPUT«1␤»
00:15 pausenclown rakudo: my Bool $x; $x=1
00:15 p6eval rakudo b9aaa3: OUTPUT«Type check failed for assignment␤current instr.: '&die' pc 17293 (src/builtins/Junction.pir:404)␤»
00:15 pausenclown rakudo: my Bool $x; $x=Bool::True
00:15 p6eval rakudo b9aaa3:  ( no output )
00:15 pausenclown mmh
00:16 pausenclown not being able to assign 1|0 to Bool seems unperlish
00:16 lue you didn't say anything :)
00:16 snarkyboojum rakudo: say Bool::True ~~ Bool
00:16 p6eval rakudo b9aaa3: OUTPUT«1␤»
00:16 snarkyboojum rakudo: say Bool::True ~~ Int
00:16 p6eval rakudo b9aaa3: OUTPUT«0␤»
00:17 snarkyboojum unperl6ish perhaps :)
00:18 pausenclown no. i mean like
00:18 pausenclown rakudo: my Bool $x; $x=1
00:18 p6eval rakudo b9aaa3: OUTPUT«Type check failed for assignment␤current instr.: '&die' pc 17293 (src/builtins/Junction.pir:404)␤»
00:18 snarkyboojum well
00:18 snarkyboojum rakudo: my $x = True; $x = 1;
00:18 p6eval rakudo b9aaa3:  ( no output )
00:19 snarkyboojum rakudo: my $x = True; $x.WHAT.say; $x = 1; $x.WHAT.say;
00:19 p6eval rakudo b9aaa3: OUTPUT«Bool()␤Int()␤»
00:19 snarkyboojum makes sense to me
00:19 pausenclown rakudo: my Bool $x; $x=:bool(1)
00:19 p6eval rakudo b9aaa3: OUTPUT«Type check failed for assignment␤current instr.: '&die' pc 17293 (src/builtins/Junction.pir:404)␤»
00:20 snarkyboojum more importantly
00:20 snarkyboojum rakudo: say True ~~ 1
00:20 p6eval rakudo b9aaa3: OUTPUT«1␤»
00:20 snarkyboojum rakudo: say False ~~ 1
00:20 p6eval rakudo b9aaa3: OUTPUT«0␤»
00:20 lue I wonder...
00:20 lue rakudo: my Bool $x = True; $x ~ 1;
00:21 pausenclown <-- pillow listening
00:21 p6eval rakudo b9aaa3:  ( no output )
00:21 lue rakudo: my Bool $x = False; $x ~ 1; say $x
00:21 p6eval rakudo b9aaa3: OUTPUT«0␤»
00:21 lue so close :)
00:23 colomon why are you making the string "01" and then throwing it away?
00:25 lue I was assuming ~ was smart assign, like ~~ is smart match :)
00:25 snarkyboojum hehe - or smart concatenate? :P
00:26 colomon ~ is string concat
00:27 lue lemme guess, there is no smart assign :/
00:27 colomon There is no smart assign.
00:28 lue then at least let me assign 1 and 0 to a variable of type Bool :)
00:28 snarkyboojum but 1 and 0 aren't of type Bool :P
00:29 lue rakudo: say "hello" if true; say "snarkyboojum" if 1;
00:29 p6eval rakudo b9aaa3: OUTPUT«Could not find sub &true␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
00:29 lue rakudo: say "hello" if True; say "snarkyboojum" if 1;
00:29 p6eval rakudo b9aaa3: OUTPUT«hello␤snarkyboojum␤»
00:29 colomon say 1.Bool.WHAT
00:29 colomon rakudo: say 1.Bool.WHAT
00:29 * lue QED
00:29 p6eval rakudo b9aaa3: OUTPUT«Bool()␤»
00:30 colomon rakudo: my Bool $x = False; $x = 1.Bool; say $x
00:30 p6eval rakudo b9aaa3: OUTPUT«1␤»
00:30 snarkyboojum what colomon said :)
00:31 snarkyboojum rakudo: say "snarkyboojum" if 45
00:31 p6eval rakudo b9aaa3: OUTPUT«snarkyboojum␤»
00:31 snarkyboojum 45 isn't of type Bool either
00:31 lue how it typically works is 0 is false, and !0 is true.
00:31 colomon oh, hey, there's an operator for .Bool
00:32 colomon rakudo: my Bool $x = False; $x = ?1; say $x
00:32 p6eval rakudo b9aaa3: OUTPUT«1␤»
00:32 colomon rakudo: my Bool $x = False; $x = ?0; say $x
00:32 p6eval rakudo b9aaa3: OUTPUT«0␤»
00:32 lue :O
00:32 snarkyboojum also
00:32 snarkyboojum rakudo: say False ~~ 0
00:32 p6eval rakudo b9aaa3: OUTPUT«1␤»
00:32 snarkyboojum rakudo: say 0 ~~ False
00:32 p6eval rakudo b9aaa3: OUTPUT«0␤»
00:33 diakopter perlesque: my int $b; loop (my int $a=1;$a<5;$a+=1) { $b = $a; loop (my int $c = $b; $c < 9; $c+=$a) { System::Console.WriteLine($c) }  }; System::Console.WriteLine($b)
00:33 p6eval perlesque: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤2␤4␤6␤8␤3␤6␤4␤8␤4␤»
00:34 lue maybe that's a precendence bug?
00:34 diakopter rakudo: my Int $b; loop (my Int $a=1;$a<5;$a+=1) { $b = $a; loop (my Int $c = $b; $c < 9; $c+=$a) { say($c) }  }; say($b)
00:34 p6eval rakudo b9aaa3: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤2␤4␤6␤8␤3␤6␤4␤8␤4␤»
00:35 snarkyboojum or it's smart matching in Bool context in the first one but Int in the other (if that's the correct terminology)
00:36 lue rakudo: say (False ~~ 0).WHAT
00:36 p6eval rakudo b9aaa3: OUTPUT«Bool()␤»
00:36 lue rakudo: say (0 ~~ False).WHAT
00:36 p6eval rakudo b9aaa3: OUTPUT«Bool()␤»
00:37 snarkyboojum rakudo: say 0 ~~ +False
00:37 p6eval rakudo b9aaa3: OUTPUT«1␤»
00:37 snarkyboojum rakudo: say ?0 ~~ False
00:37 p6eval rakudo b9aaa3: OUTPUT«0␤»
00:38 snarkyboojum rakudo: say (?0).WHAT; say False.WHAT
00:38 p6eval rakudo b9aaa3: OUTPUT«Bool()␤Bool()␤»
00:39 snarkyboojum rakudo: say (?0) ~~ False
00:39 p6eval rakudo b9aaa3: OUTPUT«0␤»
00:39 snarkyboojum weird
00:39 diakopter ok, time for labels
00:39 diakopter deferring parameters/arguments for another day
00:39 diakopter :D
00:39 diakopter TimToady: what does this mean:
00:39 diakopter std: foo: sub bar() { }; goto bar;
00:39 p6eval std 30379: OUTPUT«ok 00:01 110m␤»
00:40 lue hopefully, you're talking about labels for perlesque, and not the whole of P6 ?
00:40 diakopter P6
00:40 diakopter P6 has labels/goto
00:41 diakopter perlesque should too, if it wants to be an efficient assembly language
00:41 snarkyboojum colomon: is it a bug that (?0) doesn't ~~ False, or am I misunderstanding something?
00:41 diakopter so the compiler writer isn't limited to the control structures built into the language
00:42 snarkyboojum heh oh dear
00:42 diakopter ?
00:42 colomon rakudo: say False ~~ False
00:42 p6eval rakudo b9aaa3: OUTPUT«0␤»
00:42 colomon ~~ False always returns false, and ~~ True always returns true.
00:43 * lue is running. He hates binary spaghetti /o\
00:43 colomon At least, that's how Rakudo appears to implement things.
00:43 snarkyboojum ok - I don't understand something :)
00:43 snarkyboojum false can't match anything can it :)
00:44 snarkyboojum d'oh
00:44 snarkyboojum rakudo: say (?0) ~~ Bool
00:44 p6eval rakudo b9aaa3: OUTPUT«1␤»
00:44 snarkyboojum ;)
00:44 * snarkyboojum is a bit slow since cutting out coffee of a morning
00:45 colomon I dunno, I'm not sure why it's done that way.]
00:46 snarkyboojum this reminds me of
00:47 snarkyboojum rakudo: say False ~~ True
00:47 p6eval rakudo b9aaa3: OUTPUT«1␤»
00:47 colomon rakudo: say Mu ~~ True
00:47 p6eval rakudo b9aaa3: OUTPUT«Nominal type check failed for parameter '$topic'; expected Any but got Mu instead␤current instr.: 'perl6;Bool;ACCEPTS' pc 362491 (src/gen/core.pir:26828)␤»
00:47 snarkyboojum True always matches, False never does
00:48 colomon hmmm.... so is Mu failure sensible or a bug?
00:48 lue rakudo: say 3 is 3
00:48 p6eval rakudo b9aaa3: OUTPUT«Confused at line 11, near "say 3 is 3"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
00:49 lue (i was hoping 'is' existed :/)
00:49 snarkyboojum rakudo: given False { when True { say "matched" } }
00:49 p6eval rakudo b9aaa3: OUTPUT«matched␤»
00:51 lue rakudo: say False == False
00:51 p6eval rakudo b9aaa3: OUTPUT«1␤»
00:51 lue rakudo: say False ~~ False
00:51 p6eval rakudo b9aaa3: OUTPUT«0␤»
00:51 lue so, "smart" match is telling me false isn't false?
00:52 colomon Any       True      ~~ True                 (parsewarn)
00:52 colomon Any       False     ~~ False match          (parsewarn)
00:52 colomon looks like it is supposed to generate a warning?
00:52 snarkyboojum lue: http://perlcabal.org/syn/S03.html#line_3705
00:52 snarkyboojum I think it's working like this
00:53 snarkyboojum "In any case, if you try to smartmatch with ~~ or when, it will recognize True or False syntactically and warn you that it won't do what you expect."
00:54 snarkyboojum colomon++
00:54 TimToady diakopter: it means call the goto function with the result of the bar function as its first argument.
00:55 diakopter o_O
00:55 diakopter oh.
00:55 diakopter heh
00:55 TimToady goto is just a function syntactically
00:55 TimToady which is why a forward goto requires quotes
00:55 lue it should tell me that smart match is so smart it knows false isn't false :/
00:56 diakopter std: foo: sub bar() { }; goto foo;
00:56 p6eval std 30379: OUTPUT«ok 00:01 108m␤»
00:57 diakopter hm, perlesque is going to support the subset of those goto function calls that don't have parens, and that have bare label names as the first argument ;)
00:57 colomon std: say False ~~ False
00:57 p6eval std 30379: OUTPUT«ok 00:01 109m␤»
00:57 diakopter and no forward gotos
00:57 snarkyboojum rakudo: sub A { ... }; A().WHAT.say
00:57 p6eval rakudo b9aaa3: OUTPUT«Failure()␤»
00:57 snarkyboojum rakudo: sub A { }; A().WHAT.say
00:57 diakopter actually no
00:57 p6eval rakudo b9aaa3: OUTPUT«Null PMC access in find_method('WHAT')␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
00:57 diakopter forward gotos are fine
00:58 snarkyboojum Null PMC access! :)
00:58 diakopter without quotes tho
00:58 ascent_ joined #perl6
00:58 TimToady not in Perl 6 they aren't fine
00:58 TimToady well, hmm, maybe they could be
00:59 TimToady std: goto foo; foo:
00:59 p6eval std 30379: OUTPUT«[31m===[0mSORRY![31m===[0m␤Bogus statement at /tmp/ePo8L4SvBq line 1 (EOF):␤------> [32mgoto foo; foo:[33m⏏[31m<EOL>[0m␤Illegally post-declared type:␤ 'foo' used at line 1␤Parse failed␤FAILED 00:01 107m␤»
00:59 TimToady std: goto foo; foo:;
00:59 p6eval std 30379: OUTPUT«[31m===[0mSORRY![31m===[0m␤Illegal use of colon as invocant marker at /tmp/GOPGIGm6LT line 1:␤------> [32mgoto foo; foo:[33m⏏[31m;[0m␤Undeclared routine:␤     'foo' used at line 1,1␤Check failed␤FAILED 00:01 108m␤»
00:59 TimToady std: goto foo; foo: ;
00:59 p6eval std 30379: OUTPUT«[31m===[0mSORRY![31m===[0m␤Illegally post-declared type:␤    'foo' used at line 1␤Check failed␤FAILED 00:01 106m␤»
01:00 TimToady probably not a good idea
01:00 TimToady since the 'foo' is officially parsing as a listop
01:00 TimToady though in the case of goto, it generally doesn't matter
01:01 TimToady could probably be forced to work
01:04 lue False isn't false, gotos exist... A bad day for me and P6 :)
01:05 TimToady it isn't that false isn't false, it's that smart matching is differently smart than you.  :)
01:05 quietfanatic joined #perl6
01:07 diakopter quietfanatic: o_O
01:07 lue I'm fine with false not false, but I'm not sure many others will be :)
01:08 lue In fact, I'd probably place False ~~ False as some sort of smart anti-theft code.
01:13 sorear lue: you seem to be under the impression (~~) is supposed to be an equivalence relation
01:13 sorear that's not at all what it does
01:14 sorear smart match is a pattern matching DSL
01:14 sorear like regex for any data type
01:14 sorear True is U, False is ø
01:19 quietfanatic diakopter: O      _      o
01:22 lue DSL? (you're saying it's a bit like Regex For Dummies (An operator for the rest of us!™))
01:24 diakopter perlesque: my int $a = 2; foo: $a += 1; if ($a < 20) { goto foo }; System::Console.WriteLine($a)
01:24 p6eval perlesque: OUTPUT«20␤»
01:24 diakopter perlesque: my int $a = 2; foo: $a += 1; if ($a < 10000000) { goto foo }; System::Console.WriteLine($a)
01:24 p6eval perlesque: OUTPUT«10000000␤»
01:25 diakopter perlesque: my int $a = 2; foo: $a += 1; if ($a < 1000000000) { goto foo }; System::Console.WriteLine($a)
01:25 p6eval perlesque: OUTPUT«1000000000␤»
01:25 quietfanatic System::Console::WriteLine?
01:25 diakopter CLR .net/mono builtins
01:25 quietfanatic Maybe you should shorten that to SCW
01:25 quietfanatic or, like say.
01:25 diakopter :P
01:26 diakopter that's for Perl 6
01:26 diakopter this is perlesque
01:26 diakopter perlesque is burlesque.  and assemblish
01:26 diakopter and werdy
01:26 quietfanatic And System::Console::WriteLn-ish
01:27 quietfanatic That's hard to say.
01:27 quietfanatic I'd say you need to write some builtin functions.
01:27 diakopter but.. I'm trying to discourage humans from typing it
01:27 quietfanatic That's saydistic.
01:27 diakopter it's supposed to be a ... target language, you see.
01:27 TimToady wait, why are you typing it?
01:28 * diakopter climbed back on the mushroom and nibbled a bit.
01:29 diakopter perlesque: goto blah;
01:29 p6eval perlesque: OUTPUT«␤Unhandled Exception: System.InvalidOperationException: Label blah not marked␤at TriAxis.RunSharp.CodeGen.Complete () <0x000db>␤at TriAxis.RunSharp.RoutineGen`1.TriAxis.RunSharp.IDelayedCompletion.Complete () <0x0003b>␤at TriAxis.RunSharp.TypeGen.FlushCompletionQueue ()
01:29 p6eval ..<0x0003c>␤a…
01:30 diakopter perlesque: 3; goto blah; sub foo() { blah: 4 };
01:30 p6eval perlesque: OUTPUT«␤Unhandled Exception: System.InvalidOperationException: Label blah not marked␤at TriAxis.RunSharp.CodeGen.Complete () <0x000db>␤at TriAxis.RunSharp.RoutineGen`1.TriAxis.RunSharp.IDelayedCompletion.Complete () <0x0003b>␤at TriAxis.RunSharp.TypeGen.FlushCompletionQueue ()
01:30 p6eval ..<0x0003c>␤a…
01:30 diakopter perlesque: 3; sub foo() { blah: 4 }; goto blah
01:30 p6eval perlesque: OUTPUT«␤Unhandled Exception: System.InvalidOperationException: Label blah not marked␤at TriAxis.RunSharp.CodeGen.Complete () <0x000db>␤at TriAxis.RunSharp.RoutineGen`1.TriAxis.RunSharp.IDelayedCompletion.Complete () <0x0003b>␤at TriAxis.RunSharp.TypeGen.FlushCompletionQueue ()
01:30 p6eval ..<0x0003c>␤a…
01:31 * diakopter 3-SATisfied
01:31 lue .oO(diakopter: I need a 1up, sorry)
01:32 diakopter hmm.  it would be a late commute if I went in now.
01:51 lue afk
01:56 Psyche^ joined #perl6
01:59 spinclad from the backscroll, /me likes [isso]<-=[isit]=->[isnot] for a one-line conditional <-= =->
02:04 garslo joined #perl6
02:05 spinclad diakopter: i want to suggest making calls be gotos with arguments, but i haven't got a clean syntax to suggest yet...
02:06 justatheory joined #perl6
02:07 f00li5h joined #perl6
02:08 nihiliad joined #perl6
02:08 spinclad perlesque: sub foo($ret, $a) { my $b = $a + 1; $ret($b) };      foo(1f, 1);  1f($v): System::Console.WriteLn($v);
02:08 p6eval perlesque: OUTPUT«parsefail␤»
02:08 diakopter no parameters yet
02:09 diakopter nor invocations of scalars
02:10 diakopter but a sub can be stored in a scalar now, I think
02:10 diakopter perlesque: my sub $foo = sub blah() { 444 }; System::Console.WriteLine($foo);
02:11 p6eval perlesque: OUTPUT«Sprixel.Runtime.sub␤»
02:11 diakopter it's actually implicitly typed
02:11 diakopter don't ask how.
02:11 diakopter it's some bottom-up way of doing type inference
02:12 sorear Sprixel?
02:12 spinclad the only tricky thing i do above is make the 1f label take arguments, and it seems fairly clean
02:12 diakopter sprixel, an anagram of perlsix
02:12 diakopter the engine/runtime that hosts perlesque
02:13 spinclad (if you like continuation-passing style)
02:13 diakopter heh.
02:13 diakopter don't you dare dare me.
02:13 sorear I thought sprixel was an implementation in its own right
02:13 diakopter it will be, eventually
02:13 sorear also, I thought perlesque was an engine
02:14 diakopter perlesque is what I'm calling theh assembly language
02:14 diakopter think of it as PIR, but with fewer line breaks
02:15 diakopter and with native types.
02:15 sorear so basically, NQP
02:15 diakopter actually I think next perlesque needs compact arrays
02:15 diakopter nqp doesn't have native types or compact arrays tho
02:16 spinclad yeah, arrays could help with args/params
02:16 diakopter spinclad: the reason I said "don't tempt me to add primitives/syntax for continuations" is that sprixel supports them.
02:16 diakopter just as powerfully as scheme.
02:18 spinclad well, there you go then.  i just think they would make sense broken out syntactically in a language that's meant to be completely low-level and only for compilers to talk to.
02:19 sorear diakopter: nqp is getting native types next month
02:19 sorear and nqp does have compact arrays
02:22 spinclad but... anyway, i haven't quite gotten to suggesting it, so you may utterly disregard my blather here
02:23 agentzh joined #perl6
02:25 sorear nqp: my @arr := pir::new__ps('FixedIntegerArray'); pir::assign__vpi(@arr, 50*1024*1024); say $arr[50000000]
02:25 p6eval nqp: OUTPUT«Confused at line 1, near "say $arr[5"␤current instr.: 'parrot;HLL;Grammar;panic' pc 500 (src/cheats/hll-grammar.pir:197)␤»
02:25 sorear nqp: my @arr := pir::new__ps('FixedIntegerArray'); pir::assign__vpi(@arr, 50*1024*1024); say($arr[50000000])
02:25 p6eval nqp: OUTPUT«Symbol '$arr' not predeclared in <anonymous>␤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 137 (compilers/pct/src/PCT/HLLCompiler.pir:101)␤»
02:25 sorear nqp: my @arr := pir::new__ps('FixedIntegerArray'); pir::assign__vpi(@arr, 50*1024*1024); say(@arr[50000000])
02:25 p6eval nqp: OUTPUT«0␤»
02:26 sorear nqp: my @arr := pir::new__ps('FixedIntegerArray'); pir::assign__vpi(@arr, 50*1024*1024); @arr[50000000] = 42; say(@arr[50000000])
02:26 p6eval nqp: OUTPUT«Assignment ("=") not supported in NQP, use ":=" instead at line 1, near " 42; say(@"␤current instr.: 'parrot;HLL;Grammar;panic' pc 500 (src/cheats/hll-grammar.pir:197)␤»
02:26 sorear nqp: my @arr := pir::new__ps('FixedIntegerArray'); pir::assign__vpi(@arr, 50*1024*1024); @arr[50000000] := 42; say(@arr[50000000])
02:26 p6eval nqp: OUTPUT«42␤»
02:26 sorear nqp: my @arr; @arr[50000000] := 42; say(@arr[50000000])
02:26 p6eval nqp: OUTPUT«42␤»
02:38 diakopter sorear: oh, by compact arrays, I meant arrays that are sequential in memory, and store native types.  What do you mean by compact arrays?
02:39 sorear arrays which store native types directly, without indirection through a polymorphic object
02:39 sorear which is what the built-in FixedIntegerArray and related classes do
02:39 sorear the last example was a non-compact array; I was trying to crash p6eval-nqp by allocating 50 million polymorphic objects
02:40 sorear (but it didn't work because the object array stores nulls directly, not via a Null object)
02:40 diakopter ok, but how could nqp have compact arrays without native types?
02:41 sorear the runtime which underlies NQP has native types
02:41 sorear NQP does not yet have the syntactic support for them, but it can use objects composed of them fine
02:41 diakopter oh
02:42 sorear adding native types to NQP is mostly a question of yak shaving the AST engine to add boxing and unboxing nodes wherever necessary
02:42 diakopter how do you know nqp is getting native types nxt month
02:43 sorear because it's on my todo list
02:43 sorear I might fail
02:43 diakopter oh; :)
02:43 diakopter yeah, boxing/unboxing
02:43 diakopter the compiler that underlies perlesque (RunSharp) does that for me
02:44 diakopter (adds the boxing/unboxing CIL instructions where needed)
02:48 diakopter perlesque things remaining: sub scaler invocations (named sub invocations work), parameters/arguments/return, next/last, while/until/unless/dowhile, class declarations, struct declarations, arrays (and other generic types such as hash[T])
02:48 diakopter exposing the compiler API to perlesque code in a better way
02:48 synth13204234234 joined #perl6
02:49 diakopter string eval
02:49 diakopter contextuals
02:50 mariano joined #perl6
02:51 diakopter I can't think of anything else at the moment
02:51 diakopter parameters/arguments/return is the only one that's not straightforward to me in my mind (that is, I haven't fully thought through how to do it)
02:52 diakopter I was certain it would work at one point :)
02:52 diakopter but I've forgotten.
02:52 diakopter (how)
02:52 * diakopter stops rambling.
02:53 synth13204234234 joined #perl6
02:56 diakopter perlesque: my int $a = 4; if ($a > 5) { goto bar }; System::Console.WriteLine(32342342); bar: 5;
02:56 p6eval perlesque: OUTPUT«32342342␤»
02:56 diakopter perlesque: my int $a = 6; if ($a > 5) { goto bar }; System::Console.WriteLine(32342342); bar: 5;
02:56 p6eval perlesque:  ( no output )
02:56 diakopter :)
03:02 synth joined #perl6
03:04 synth joined #perl6
03:38 molaf joined #perl6
03:43 thowe joined #perl6
03:43 thowe Can an array hold more than one type of object?
03:43 sorear sure
03:44 thowe OK, because the wikibook seems to avoid showing an array with a mix of types
03:44 thowe if "type" is the right word
03:44 bacek_at_work joined #perl6
03:44 sorear well, a type is really just a set of values
03:44 sorear and an array must have all of its elements drawn from the same set
03:45 sorear but there's nothing to stop that set from being 'Any'
03:45 sorear or 'Mu' which also includes junctions
03:45 thowe so you can't have @a = $b, @c, %d
03:45 sorear my @a; is shorthand for my @a of Mu
03:45 sorear $b, @c, and %d are all instances of subclasses of Any
03:45 sorear they can all fit into an Array of Any
03:46 thowe so, do you need to do anything special to say it is an array of Any?
03:46 sorear no
03:46 am0c joined #perl6
03:46 sorear Any is a subclass of Mu
03:47 thowe but you can say that the array can only contain integers if you want?
03:47 sorear yes
03:47 thowe what does that syntax look like?
03:47 sorear my int @a iirc
03:47 thowe Interesting.  Thanks.
03:48 sorear rakudo: my Int @a
03:48 p6eval rakudo b9aaa3:  ( no output )
03:48 sorear rakudo doesn't implement native types yet; you have to use the wrapper class Int
03:48 sorear like java.lang.Integer
04:08 alester joined #perl6
04:29 dj_goku joined #perl6
04:30 _jaldhar_ joined #perl6
04:34 JimmyZ joined #perl6
04:48 snarkyboojum joined #perl6
04:49 am0c joined #perl6
05:11 szabgab joined #perl6
05:35 JimmyZ joined #perl6
05:35 alester joined #perl6
05:35 thowe joined #perl6
05:35 synth joined #perl6
05:35 REPLeffect joined #perl6
05:35 bacek joined #perl6
05:35 diakopter joined #perl6
05:35 lisppaste3 joined #perl6
05:35 PacoLinux joined #perl6
05:35 mikehh joined #perl6
05:35 charsbar_ joined #perl6
05:35 cotto_work joined #perl6
05:35 drbean joined #perl6
05:35 gfldex joined #perl6
05:35 kfo joined #perl6
05:35 dual joined #perl6
05:35 sorear joined #perl6
05:35 cls_bsd joined #perl6
05:35 arlinius joined #perl6
05:35 ian_ joined #perl6
05:35 Sarten-X joined #perl6
05:35 jhuni joined #perl6
05:35 Exodist_ joined #perl6
05:35 kst joined #perl6
05:35 athomason joined #perl6
05:35 CokeBot9000 joined #perl6
05:35 tylerni7 joined #perl6
05:35 lue joined #perl6
05:35 silug joined #perl6
05:35 nadim joined #perl6
05:35 yahooooo joined #perl6
05:35 arnsholt joined #perl6
05:35 rgrau` joined #perl6
05:35 bbkr joined #perl6
05:35 cosimo joined #perl6
05:35 [particle] joined #perl6
05:35 Intensity joined #perl6
05:35 wolverian joined #perl6
05:35 jql joined #perl6
05:35 Sanitoeter joined #perl6
05:35 szbalint joined #perl6
05:35 kcwu joined #perl6
05:35 fda314925 joined #perl6
05:35 jjore1 joined #perl6
05:35 cotto joined #perl6
05:35 cookys joined #perl6
05:35 revdiablo joined #perl6
05:35 Helios joined #perl6
05:35 huf joined #perl6
05:35 mtve joined #perl6
05:35 betterworld joined #perl6
05:35 allbery_b joined #perl6
05:35 hejki joined #perl6
05:35 baest joined #perl6
05:35 ingy joined #perl6
05:35 cj joined #perl6
05:35 frettled joined #perl6
05:35 hatseflats joined #perl6
05:35 aesop joined #perl6
05:35 solarion joined #perl6
05:35 frodwith joined #perl6
05:35 akl joined #perl6
05:37 dj_goku joined #perl6
05:37 ascent_ joined #perl6
05:37 tewk joined #perl6
05:37 Alias joined #perl6
05:37 f00li5h joined #perl6
05:37 arthur-_ joined #perl6
05:37 colomon joined #perl6
05:37 cognominal joined #perl6
05:37 eternaleye joined #perl6
05:37 Kovensky joined #perl6
05:37 Tene joined #perl6
05:37 jaffa4 joined #perl6
05:37 xinming joined #perl6
05:37 mdxi joined #perl6
05:37 broquaint joined #perl6
05:37 ShaneC1 joined #perl6
05:37 ilogger2 joined #perl6
05:37 Grrrr joined #perl6
05:37 avar joined #perl6
05:37 literal joined #perl6
05:37 constant joined #perl6
05:37 LionMadeOfLions joined #perl6
05:37 christine joined #perl6
05:37 dhoss joined #perl6
05:37 zamolxes joined #perl6
05:37 s1n joined #perl6
05:37 breinbaas joined #perl6
05:37 TimToady joined #perl6
05:37 awwaiid joined #perl6
05:37 pugssvn joined #perl6
05:37 pmichaud joined #perl6
05:37 krakan joined #perl6
05:37 sjohnson joined #perl6
05:37 jnthn joined #perl6
05:37 mj41 joined #perl6
05:37 jrockway joined #perl6
05:37 rhr joined #perl6
05:37 c1sung joined #perl6
05:37 BinGOs joined #perl6
05:45 pugssvn r30380 | lwall++ | [STD] warn on attempts to smartmatch with True or False
05:47 Trashlord joined #perl6
05:49 araujo joined #perl6
05:53 araujo joined #perl6
06:01 uniejo joined #perl6
06:19 moritz_ good morning
06:20 snarkyboojum guten moren moritz_
06:20 snarkyboojum morgen :|
06:29 payload joined #perl6
06:37 TimToady std: False ~~ True
06:37 p6eval std 30380: OUTPUT«Potential difficulties:␤  Smartmatch against True always matches; if you mean to test the topic for␤    truthiness, please use :so or *.so or ?* instead at /tmp/mUr1traw2g line 1:␤------> [32mFalse ~~ True[33m⏏[31m<EOL>[0m␤ok 00:01 109m␤»
06:37 TimToady std: True ~~ False
06:37 p6eval std 30380: OUTPUT«Potential difficulties:␤  Smartmatch against False always fails; if you mean to test the topic for␤    truthiness, please use :!so or *.not or !* instead at /tmp/Y8v3HvGcYp line 1:␤------> [32mTrue ~~ False[33m⏏[31m<EOL>[0m␤ok 00:01 107m␤»
06:46 snarkyboojum TimToady - that's awesome :)
06:47 snarkyboojum std: False ~~ False
06:47 p6eval std 30380: OUTPUT«Potential difficulties:␤  Smartmatch against False always fails; if you mean to test the topic for␤    truthiness, please use :!so or *.not or !* instead at /tmp/ofoAmDhSQt line 1:␤------> [32mFalse ~~ False[33m⏏[31m<EOL>[0m␤ok 00:01 107m␤»
06:49 payload1 joined #perl6
06:50 snarkyboojum I get a broken link to http://svn.pugscode.org/pugs/src/perl6/STD.pm, I take it, it's been renamed to STD.pm6?
06:50 moritz_ yes
06:50 moritz_ snarkyboojum: where is that link?
06:50 snarkyboojum good-o
06:50 sorear we should put the official highlighted version of STD.pm up
06:50 snarkyboojum mortiz_: on my website :)
06:50 sorear and link to that
06:50 moritz_ sorear: it would be best to have a page with some general information about STD.pm
06:53 chromatic joined #perl6
06:57 snarkyboojum the link to STD on the perl 6 wiki is b0rken - http://www.perlfoundation.org/perl6/index.cgi?std_pm
06:59 snarkyboojum and http://perl6.org/ ?
06:59 snarkyboojum yep - and perl6.org
07:01 payload joined #perl6
07:02 snarkyboojum a quick google shows it's linked in a number of places :)
07:06 snarkyboojum method dumbsmart ($litbool) heh - TimToady++
07:07 sorear std: given (False) { when (False) {} }
07:07 p6eval std 30380: OUTPUT«ok 00:01 109m␤»
07:08 TimToady parens defeat the check currently
07:09 sorear std: given (False) { when False {} }
07:09 p6eval std 30380: OUTPUT«Potential difficulties:␤  Smartmatch against False always fails; if you mean to test the topic for␤    truthiness, please use :!so or *.not or !* instead at /tmp/TZqkkRqugG line 1:␤------> [32mgiven (False) { when False[33m⏏[31m {} }[0m␤ok 00:01 107m␤»
07:09 sorear sorry, p5think
07:11 snarkyboojum std: given True { when (True) {} }
07:11 p6eval std 30380: OUTPUT«ok 00:01 107m␤»
07:11 snarkyboojum std: given True { when True {} }
07:11 p6eval std 30380: OUTPUT«Potential difficulties:␤  Smartmatch against True always matches; if you mean to test the topic for␤    truthiness, please use :so or *.so or ?* instead at /tmp/wjX2RKYmn1 line 1:␤------> [32mgiven True { when True[33m⏏[31m {} }[0m␤ok 00:01 107m␤»
07:11 snarkyboojum cool
07:15 moritz_ std: given Bool::True { }
07:15 p6eval std 30380: OUTPUT«ok 00:01 107m␤»
07:15 TimToady it never tests the given
07:16 moritz_ oh right
07:16 moritz_ std: when Bool::True { }
07:16 p6eval std 30380: OUTPUT«ok 00:01 107m␤»
07:16 snarkyboojum std: when True {}
07:16 p6eval std 30380: OUTPUT«Potential difficulties:␤  Smartmatch against True always matches; if you mean to test the topic for␤    truthiness, please use :so or *.so or ?* instead at /tmp/CmhVcji8A2 line 1:␤------> [32mwhen True[33m⏏[31m {}[0m␤ok 00:01 107m␤»
07:17 TimToady there are many ways to defeat it, until we get constant folding
07:17 snarkyboojum just looks at 'True' and 'False' too
07:17 snarkyboojum fun
07:17 snarkyboojum still awesomerized :)
07:18 TimToady possible to get it to do false positive too
07:19 sorear std: constant True := 5; False ~~ True;
07:19 p6eval std 30380: OUTPUT«[31m===[0mSORRY![31m===[0m␤Malformed constant at /tmp/bsFvwceWx1 line 1:␤------> [32mconstant True :[33m⏏[31m= 5; False ~~ True;[0m␤    expecting any of:␤     coloncircumfix␤   signature␤Parse failed␤FAILED 00:01 107m␤»
07:19 sorear std: constant True = 5; False ~~ True;
07:19 p6eval std 30380: OUTPUT«Potential difficulties:␤  Smartmatch against True always matches; if you mean to test the topic for␤    truthiness, please use :so or *.so or ?* instead at /tmp/kgvGigyy4X line 1:␤------> [32mconstant True = 5; False ~~ True[33m⏏[31m;[0m␤ok 00:01 107m␤»
07:20 sorear like that?
07:21 TimToady std: 0 ~~ False.WHAT
07:21 p6eval std 30380: OUTPUT«Potential difficulties:␤  Smartmatch against False always fails; if you mean to test the topic for␤    truthiness, please use :!so or *.not or !* instead at /tmp/IG1au86u8C line 1:␤------> [32m0 ~~ False[33m⏏[31m.WHAT[0m␤ok 00:01 107m␤»
07:26 snarkyboojum I'm sure lue will still be less perplexed :)
07:29 snarkyboojum moritz_: so who can update perl6.org to fix the link to STD.pm?
07:30 moritz_ snarkyboojum: everybody with access to the pugs svn
07:31 iblechbot joined #perl6
07:33 snarkyboojum ah, so it's already been updated
07:34 snarkyboojum moritz_: how about the wiki?
07:35 mberends joined #perl6
07:36 pugssvn r30381 | moritz++ | [util] the S32 .html files were not generated in the S32/ folder, so try to fix this
07:36 moritz_ snarkyboojum: everybody - it's a wiki :-)
07:36 snarkyboojum :O
07:42 IllvilJa joined #perl6
07:46 snarkyboojum moritz_: I should work out how to get a login then :P
07:46 * IllvilJa o
07:47 am0c joined #perl6
07:47 pugssvn r30382 | moritz++ | [scripts] fix non-globbing in command line arguments
07:47 Teratogen we need to get Perl 6 out the door, folks
07:47 Teratogen get people in the industry using it
07:48 Teratogen for major projects
07:48 Teratogen we need a production version of Perl 6 1.0
07:48 was kicked by moritz_: Teratogen
07:48 mberends Teratogen: stop repeating yourself, or we will ...
07:49 moritz_ or I did.
07:58 mathw what was this 'we'?
07:58 snarkyboojum what a funny guy
07:59 mathw And good localtime to you
07:59 * mathw has tea, and a pleasant morning-after-aikido feeling
08:02 fridim joined #perl6
08:03 jferrero joined #perl6
08:04 hanekomu joined #perl6
08:05 aesop joined #perl6
08:15 moritz_ colomon: I think/hope I fixed the remaining issues with HTML updates of the synopsis, and the ones I randomly checked are up to date
08:17 mathw \o/
08:19 masak joined #perl6
08:19 masak oh hai, #perl6
08:20 mberends oh hai, masak
08:20 frettled Hello, Dr. Morning, I presume.
08:20 gfx joined #perl6
08:21 snarkyboojum masak o/
08:22 masak snarkyboojum: got a moment for Yapsi sometime during the morning-evening? :)
08:23 snarkyboojum masak: later this evening my time - yes for sure
08:23 masak \o/
08:23 snarkyboojum :)
08:23 * masak wishes there were a  established word 'prenoon' in English
08:24 mathw 'morning' usually suffices for most people
08:24 rekhajos joined #perl6
08:24 clintongormley joined #perl6
08:25 mberends masak: could you look at a proto bug that has me stumped?
08:27 masak sure.
08:29 masak do I just need to run it, or is there any particula incantation that does the stumping?
08:29 mberends :-) it fails to update project state after installing a project, claiming that %!project-state is readonly. Ecosystem.pm6 line 73
08:30 mberends for example, './proto install svg' triggers the error
08:30 * masak trajs it
08:31 mberends most projects do actually get installed, which is kinda useful
08:31 masak \o/
08:31 masak I'm so glad you're digging into this.
08:31 moritz_ mberends: that syntax worries me...
08:31 moritz_ %!project-state{$project}<state> = $state;
08:32 masak why?
08:32 moritz_ mberends: hashes don't autoviv
08:32 moritz_ in rakudo, at least
08:32 moritz_ oh wait
08:32 moritz_ that's handled above...
08:32 * moritz_ shuts up
08:33 hanekomu left #perl6
08:35 masak my proto dies earlier than that.
08:36 dakkar joined #perl6
08:36 masak "Method 'exists' not found for invocant of class 'Proxy'"
08:36 * masak glares angrily at the Proxy class in Rakudo
08:36 masak Proxy: you're of no particular use whatsoever, are you?
08:37 masak :)
08:38 masak error occurs on line 95 in Ecosystem.pm6
08:38 masak so %!project-info{$project} doesn't exist for me.
08:39 moritz_ same here
08:39 mberends that may be because the file does not exist at the expected location
08:39 spinclad masak: 'forenoon' has a bit of 19th c. sound to it to my ear, tho i'm sure it's in active use in many parts of Britain proper
08:39 masak I do have a 'svg:' in my projects.list, though.
08:40 masak spinclad: thanks! you've made my forenoon!
08:40 mberends the file should be ~/.perl6/proto/projects.state
08:40 masak mberends: isn't it supposed to find projects.list in the current directory?
08:41 mathw spinclad: I'm pretty sure I've seen 'forenoon' used in old writing. I don't think it's in any modern dialects though.
08:41 masak ah.
08:42 mberends masak: yes, projects.list has not yet relocated to ~/.perl6/proto
08:42 masak mberends: then I don't get this: up in the 'new' method, there's no path. it calls the load-project-list, which opens that file. there's no path there either.
08:42 masak just the filename itself all the way.
08:42 masak wouldn't it be looking in the current directory, then?
08:43 mberends it would
08:43 * mberends blushes
08:43 spinclad mathw: i expect it's in occasional use in rural or elder or other conservative bywaters
08:43 mberends there are *two* projects.state files here, in ~/proto and ~/.perl6/proto
08:44 spinclad but i haven't seen it in recent print either
08:44 masak I don't care where the projects.state is located, as long as projects.list sits in the git-charged proto dir itself, so that it gets updated with proto updates.
08:45 masak by the way, I found it slightly confusing that the methods are called load-project-list when the file is called projects.list
08:45 masak they diff on an 's'.
08:45 mberends good point. consistency++
08:45 masak (and we can't change the name of the file) :)
08:46 mberends ok, will rename the methods.
08:46 fridim_ joined #perl6
08:47 masak while I'm being picky, I haven't decided whether it's a smell that we're using load-projects-list to load projects.state...
08:47 mberends I also plan to add a new method to pull down only the latest projects.list from github using LWP::UserAgent
08:48 masak maybe 'load-projects-list' isn't the intended name of that method...
08:48 masak sounds good.
08:48 moritz_ general reminder: tonight 18:30 UTC is #rakudosketch meeting
08:48 mberends yes. the projects.state got tacked on afterwards
08:48 mberends thanks moritz_
08:48 masak *nod*
08:49 * masak will, once again, be unable to attend #rs
08:49 moritz_ :(
08:49 masak yes :(
08:49 masak next Tuesday should be fine.
08:51 spinclad ah.. if i go to bed _now_ i can be up by then.
08:51 masak mberends: I'll be happy to look at your bug when the Proxy.exists oddity is gone.
08:52 mberends ok
08:54 * spinclad sleep(:time(sleeptime))
08:54 spinclad &
09:09 sorear joined #perl6
09:14 jonasbn joined #perl6
09:31 fridim_ joined #perl6
09:37 masak at the bottom of http://friendfeed.com/the-life-scientists/625ed452/i-have-mysql-and-oracle-databases-want-to-mine people are worried about the availability of libs when Perl 6 "comes out".
09:38 masak this tells us two things: a CPAN bridge would be very, very good. and good native libs wouldn't be so bad either.
09:38 masak the more we can get working for Rakudo Star, the better.
09:39 masak let's go! http://www.success.co.il/knowledge/images/Pillar10-History-French-Revolution-Delacroix.jpg :)
09:39 * moritz_ encourages people not to forget the booko
09:39 moritz_ s/o$//
09:40 masak indeed.
09:40 masak I have two concrete plans. let's say I put them into action this week.
09:40 masak (1) make a chapter about the Poker example
09:41 masak (2) make a chapter with a simple web app
09:43 masak if I do those two, I'll move over to massive review-editing.
09:44 moritz_ some meta operators are already explained in the chapter on operators
09:44 moritz_ it's sure worth expanding
09:44 * masak does (1) now
09:47 masak here's the Poker hand example, for those who haven't seen it yet: http://gist.github.com/244255
09:47 masak I'm sure it can be updated for Rakudo master a bit.
09:47 masak I'll start with that.
09:47 masak oh noes, named enums! :(
09:47 moritz_ :(
09:49 masak ok, I'll do this: I'll emulate named enums as much as I can by the latest spec.
09:50 masak then we can put in the real named enums when the time comes.
09:50 masak that's a way to 'scout ahead'.
09:54 fridim_ joined #perl6
09:59 dalek rakudo: cb45216 | (Solomon Foster)++ | src/core/Real.pm:
09:59 dalek rakudo: Fix Real.abs and Real.sign to use named invocants.
09:59 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/cb45216b133e5d946707c8a7e74c18867b93706b
09:59 masak colomon++
10:00 moritz_ colomon: speaking of which, how is your grant progressing?
10:00 masak rakudo: class A { method foo($bar:) { say $bar.WHAT } }; A.new.foo( :bar(42) )
10:00 colomon I need to do a blog post on it.  ;)
10:00 p6eval rakudo b9aaa3: OUTPUT«Too many positional parameters passed; got 1 but expected 1␤current instr.: 'perl6;A;foo' pc 400 (EVAL_1:171)␤»
10:00 * masak submits LTA rakudobug
10:00 colomon moritz_: very slowly, but surely
10:01 moritz_ colomon: I don't expect fast progress during your move anyway :-)
10:01 colomon Things should start picking up now that the moving is over except for unpacking.
10:01 M_o_C joined #perl6
10:01 moritz_ having moved myself recently I know the extra work, and how slow it returns to 0 afterwards
10:02 masak std: class A { method foo($bar:) { say $bar.WHAT } }; A.new.foo( :bar(42) )
10:02 colomon I need assistance from jnthn sorting out some bugs with roles.
10:03 p6eval std 30382: OUTPUT«ok 00:01 111m␤»
10:03 moritz_ multis from within roles?
10:04 colomon moritz_: and more.
10:04 colomon how is cool coming, btw?
10:06 masak ready for review and merge, last I heard.
10:08 colomon \o/
10:08 masak rakudo: package E { our sub a() { 0 }; our sub b() { 1 } }; sub a() { E::a }; sub b() { E::b }; .say for E::a, E::b, a, b # working around lack of named enums
10:08 p6eval rakudo b9aaa3: OUTPUT«0␤1␤0␤1␤»
10:12 masak lunch &
10:35 pmurias joined #perl6
10:36 pmurias TimToady: viv generates some classes at runtime while it has some pregenerated
10:40 synth joined #perl6
10:47 pausenclown joined #perl6
10:47 pausenclown g'localtime
10:48 ruoso joined #perl6
10:51 _jaldhar_ joined #perl6
10:53 fridim_ joined #perl6
10:54 pmurias ruoso: i'm adding caching of the output of STD to mildew (bread actually)
10:54 pausenclown given a somewhat functional XML Parser, what would u consider more important. XPath support, Parsed external entities, or easy access a la XML::Simple?
10:55 moritz_ easy access, although I don't like XML::Simple
10:55 moritz_ maybe XPath would be better
10:57 moritz_ .oO( never ask a Perl 6 hacker for advice, 'cause he'll tell you both aye and nay )
10:58 pmurias aye|nay to be precise
10:58 pausenclown maybe i should ask Grant McLean if he wants to tackle the "easy" part =)
10:59 pausenclown anybody know his irc nick?
11:00 quester_ joined #perl6
11:04 quester_ rakudo: <1 3 4 2>.sort({-$^a}).say
11:04 p6eval rakudo cb4521: OUTPUT«Too many positional parameters passed; got 2 but expected 1␤current instr.: '_block48' pc -1 ((unknown file):-1)␤»
11:04 * quester_ just wanted to check that was still broken before submitting a patch for it
11:22 am0c joined #perl6
11:26 szabgab joined #perl6
11:27 am0c__ joined #perl6
11:28 rv2733 joined #perl6
11:31 am0c joined #perl6
11:31 pausenclown do we have tools for the new POD yet?
11:33 am0c__ joined #perl6
11:33 moritz_ no
11:39 masak pausenclown: I'd very much like XML tooling for Perl 6 that was as fast as libxml. speed is my number one requirement when it comes to XML.
11:42 steffan joined #perl6
11:42 adm_ joined #perl6
11:43 am0c joined #perl6
11:44 pausenclown masak: my parser relies on grammars so i'd say its as fast as rakudos IO and the grammar engine.
11:45 masak I admire the effort. I'll probably read through that code somehow, looking for cool ideas.
11:45 pausenclown it's on github
11:45 masak URL?
11:46 pausenclown http://github.com/pausenclown/XML--Parser
11:47 * moritz_ is still looking for volunteers for the April release of Rakudo
11:47 moritz_ it's *not* the Rakudo * release
11:47 masak :D :/
11:48 masak pausenclown: mind telling me why you choose that... interesting commit comment habit? :)
11:48 pausenclown masak; the docs are really to be trusted.
11:49 pausenclown best to look at the test files
11:49 steffan left #perl6
11:49 pausenclown lol. no i dont mind.
11:49 pausenclown i dont really care in early project stages =)
11:50 envi^home joined #perl6
11:50 pausenclown oh. s/really/not really/
11:51 masak commit comments are probably the first thing I look at when I see a new project.
11:52 masak this is the largest bla-to-commit-comment ratio I've ever encountered. :)
11:52 * moritz_ reduced it a wee bit
11:52 masak moritz_++
11:52 pausenclown i promise to better myself =)
11:52 masak ++pausenclown :)
11:53 * masak looks at the tests
11:54 masak looks really nice.
11:55 masak what's that second positional argument to .parse ?
11:57 pausenclown it defines the action class
11:57 masak why a string?
11:57 pausenclown like dom, handler
11:58 pausenclown so that the caller doesnt need to create an instance of XML::Parser::Actions::* by himself
11:58 takadonet morning all
11:58 masak takadonet: \o
11:59 pausenclown but i should probably let him do that if he wants
12:00 masak it doesn't feel very extensible as it is now.
12:00 masak the new_action method contains four hardcoded cases, with much similarity between them.
12:01 pausenclown this is because Foo::Bar::$name doesnt work yet
12:01 masak also, that method does two quite different things.
12:01 masak it sets an attribute and returns a value.
12:03 pausenclown not a value. the value it set.
12:04 pausenclown so it behaves like a classic setter; cant see whats wrong with that.
12:05 payload joined #perl6
12:05 masak nevertheless, you could do 'return do given $action { when 'dom' { XML::Parser::Actions::Dom.new( parser => self } #`(other cases); default { die "Unknown XML::Parser::Action" } }' and set the attribute in the parse method.
12:05 masak saves a lot of repetition, and makes things more orthogonal.
12:06 adm joined #perl6
12:07 masak in fact, the way you currently do it will not warn if an illegal action string is passed with a .parse call which is not the first .parse call. it will just ignore it and use the last one.
12:07 pugssvn r30383 | pmurias++ | [mildew]
12:07 pugssvn r30383 | enabled caching the parse tree in bread
12:07 pugssvn r30383 | added a -P{STD,STD-cached} option to bread
12:07 pausenclown that is correct.
12:08 pausenclown masak++ # glorious beetle hunter
12:08 masak :)
12:08 masak this is when thinking in patters pays off.
12:08 masak s/patters/patterns/
12:09 masak Separation of Concerns is good for the soul, because the points of failure aren't entangled with each other.
12:10 masak the thing that wasn't separated here was that in new_action, you used the attribute as a temporary vessel for error checking, and that doesn't work when it already had a correct value.
12:10 * masak stops pontificating :)
12:15 masak anyway, great work. I see there's a lot of effort put into all this.
12:17 masak pausenclown: hm, http://github.com/pausenclown/XML--Parser/blob/master/lib/XML/Parser.pod says there's a POD error at line 175.
12:19 lisppaste3 pausenclown pasted "better parse" at http://paste.lisp.org/display/97719
12:21 masak this one breaks DRY... :)
12:22 pausenclown DRY?
12:22 masak though it's arguably better than the last one.
12:22 masak Don't Repeat Yourself.
12:22 masak you list the admissible string values twice.
12:22 masak better to put in a default clause in the given.
12:23 pausenclown doesnt default always run?
12:23 masak also, the $action_arg parameter is never used.
12:23 moritz_ pausenclown: only when no when-block run
12:23 masak pausenclown: all 'when' clauses escape the given if they match.
12:23 pausenclown oh.
12:23 pausenclown my bad =)
12:25 pausenclown i'm still concerned about how to implement external entity parsing.
12:25 pausenclown as it involves reading from files from "within" the grammar.
12:28 masak rakudo: say "foo" ~~ / f <{ say "bar" ~~ /bar/ }> oo /
12:28 p6eval rakudo cb4521: OUTPUT«bar␤foo␤»
12:32 mathw joined #perl6
12:32 pausenclown .u L B BAR SYMBOL
12:32 phenny U+2114 L B BAR SYMBOL (℔)
12:32 pausenclown ty phenny
12:33 pausenclown ;-)
12:33 moritz_ .u foo
12:33 phenny U+1558 CANADIAN SYLLABICS FOO (ᕘ)
12:33 moritz_ .u foobar
12:33 phenny moritz_: Sorry, no results for 'foobar'.
12:33 moritz_ .u foo bar
12:33 phenny moritz_: Sorry, no results for 'foo bar'.
12:33 moritz_ well, one can try :-)
12:34 pausenclown .u bar
12:34 phenny U+00A6 BROKEN BAR (¦)
12:34 pausenclown .u foo .u bar
12:34 phenny pausenclown: Sorry, no results
12:35 pausenclown Programmer goes into a Bar->(); Bartender says, did u know this arrow is redundant?
12:36 PZt joined #perl6
12:37 moritz_ an SQL query goes into a bar, looks at two tables and says 'mind if I join you?'
12:38 masak that one made Twitter yesterday :)
12:39 pausenclown lol.
12:39 pausenclown a friend of mine was arrested at the weekend.
12:40 pausenclown he is somewhat looking like the typical terrorist (beard, muslim, et al).
12:41 pausenclown in the pub (very crowded) he decicde to make room by climbing the table, yelling Imsch Allah (however that is spelled) and throwing his backback around =))))
12:42 pausenclown *backpack
12:43 moritz_ that's soooo old, and on bash.org for years...
12:43 pausenclown damn
12:43 pausenclown worth a try.
12:44 * masak doesn't get it
12:44 * quester_ submits RT #74334: [PATCH] Fix Parcel.sort (fixes the very first example in http://cloud.github.com/downloads/perl6/book/book-2010-04.pdf) and Hash.sort
12:44 masak quester_++
12:45 quester_ Thank you, masak!
12:46 masak no, thank _you_, quester_! :)
12:46 * pausenclown switches computers
12:48 masak rakudo: my @a = 1,2,3; my ($b, @c) = @a; say @c.perl
12:48 masak alpha: my @a = 1,2,3; my ($b, @c) = @a; say @c.perl
12:48 p6eval rakudo cb4521: OUTPUT«[[2, 3]]␤»
12:48 p6eval alpha 30e0ed: OUTPUT«[2, 3]␤»
12:48 * masak submits rakudobug
12:49 quester_ It's the least I could do after pmichaud++ implemented sort in ng in February and got it _this_ _close_ to 100% working...
12:50 masak rakudo: my @a = 1,2,3; my (@c) = @a; say @c.perl
12:50 p6eval rakudo cb4521: OUTPUT«[[1, 2, 3]]␤»
12:50 masak alpha: my @a = 1,2,3; my (@c) = @a; say @c.perl
12:51 p6eval alpha 30e0ed: OUTPUT«[1, 2, 3]␤»
12:51 masak rakudo: my @a = 1,2,3; my @c = @a; say @c.perl
12:51 p6eval rakudo cb4521: OUTPUT«[1, 2, 3]␤»
12:51 holli joined #perl6
12:52 * masak wonders if this is related to the issue with double arrays in attributes
12:53 SmokeMachine joined #perl6
12:55 holli joined #perl6
12:58 pausenclown_ joined #perl6
13:02 quester_ Good night, all.   o/
13:03 masak quester_: 'night!
13:04 quester_ left #perl6
13:06 alester joined #perl6
13:12 pausenclown_ wtf! pugscode is down-
13:13 pausenclown_ no its just the repository
13:13 arnsholt pausenclown_: It's allahu akbar (god is great), btw. Not insh allah (god willing) =)
13:13 arnsholt (Modulo spelling)
13:15 masak there's no correct spelling if you're behind a transcription wall anyway...
13:15 masak std: subset Quad of Any; sub classify($_) { when Quad {}; when Quad {} }
13:15 p6eval std 30383: OUTPUT«ok 00:01 110m␤»
13:15 masak rakudo: subset Quad of Any; sub classify($_) { when Quad {}; when Quad {} }
13:15 p6eval rakudo cb4521: OUTPUT«Unable to parse blockoid, couldn't find final '}' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1664 (ext/nqp-rx/src/stage0/Regex-s0.pir:907)␤»
13:15 arnsholt masak: Point, point
13:15 masak rakudo: subset B of Any; sub classify($_) { when B {}; when B {} }
13:15 p6eval rakudo cb4521:  ( no output )
13:15 * masak confused
13:15 * masak submits rakudobug
13:16 masak rakudo: subset Quad of Any; sub classify($_) { when Quad {}; when Quad {} }; say 'alive'
13:16 p6eval rakudo cb4521: OUTPUT«Unable to parse blockoid, couldn't find final '}' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1664 (ext/nqp-rx/src/stage0/Regex-s0.pir:907)␤»
13:16 masak rakudo: subset B of Any; sub classify($_) { when B {}; when B {} }; say 'alive'
13:16 p6eval rakudo cb4521: OUTPUT«alive␤»
13:18 pausenclown_ subset Q of Any; sub classify($_) { when Q {}; when Q {} }; say 'alive'
13:18 Lorn joined #perl6
13:18 masak rakudo: subset Q of Any; sub classify($_) { when Q {}; when Q {} }; say 'alive'
13:18 p6eval rakudo cb4521: OUTPUT«Missing block at line 11, near "; when Q {"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
13:19 * masak .oO( things beginning with Q... )
13:19 pausenclown_ what the fuck?
13:19 masak or, as they say in Latin, 'quod the fuck?'
13:19 arnsholt ^^
13:19 pausenclown_ rakudo:  subset _Q of Any; sub classify($_) { when _Q {}; when _Q {} }; say 'alive'
13:19 p6eval rakudo cb4521: OUTPUT«alive␤»
13:20 snarkyboojum joined #perl6
13:20 pausenclown_ rakudo:  subset q of Any; sub classify($_) { when q {}; when q {} }; say 'alive'
13:20 p6eval rakudo cb4521: OUTPUT«Missing block at line 11, near "; when q {"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
13:20 pausenclown_ rakudo: say q(1)
13:20 p6eval rakudo cb4521: OUTPUT«Could not find sub &q␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
13:20 pausenclown_ rakudo: say q
13:20 p6eval rakudo cb4521: OUTPUT«Confused at line 11, near "say q"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
13:20 muixirt joined #perl6
13:21 masak oh.
13:21 pausenclown_ what the heck is special about a Q?
13:21 masak we had a ticket like this the other day.
13:21 masak it's the quoting constructs.
13:21 masak the LTM should catch that, but it doesn't.
13:21 * masak finds-and-merges
13:21 masak pausenclown_: thanks :)
13:22 pausenclown_ but there is no q construct anymore
13:22 masak there isn't?
13:22 masak rakudo: say q[oh hai!]
13:22 p6eval rakudo cb4521: OUTPUT«oh hai!␤»
13:23 pausenclown_ i feel like the dumb guy in the movie who has the idea without getting it.
13:23 muixirt rakudo: my $a=5; if $a>2 and $a<6 { say "YES"; }
13:23 p6eval rakudo cb4521: OUTPUT«YES␤»
13:23 muixirt rakudo: my $a=5; if $a<2 and $a>6 { say "YES"; }
13:23 p6eval rakudo cb4521: OUTPUT«Missing block at line 11, near "6 { say \"Y"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
13:23 pausenclown_ rakudo: my $a=5; if 2 < $a <6 { say "YES"; }
13:23 p6eval rakudo cb4521: OUTPUT«YES␤»
13:23 snarkyboojum bonjour pausenclown
13:24 snarkyboojum whoops - that was delayed somewhat :)
13:24 pausenclown_ ieeeek! french!!
13:24 muixirt why is the my second code snippet wrong?
13:24 * pausenclown_ hides
13:24 snarkyboojum :)
13:24 arnsholt muixirt: The < > might get interpreted as a hash accessor
13:25 muixirt arnsholt: is that a bug or a feature?
13:25 snarkyboojum hi masak-san
13:25 pausenclown_ besides that, a number can never be smaller than 2 and bigger than 6 at the same time?
13:25 snarkyboojum er masak_san
13:25 colomon bug
13:25 snarkyboojum :)
13:25 arnsholt muixirt: I've no idea. But if colomon says bug, that's probably right =)
13:25 masak snarkyboojum: hi!
13:25 masak SmokeMachine: (neither one highlights here)
13:25 colomon I'm just going on instinct there, but I'm pretty sure it must be a bug.
13:26 masak er, meant snarkyboojum.
13:26 moritz_ rakudo: say ?( 6 > 1|7 < 2)
13:26 muixirt well why is that:
13:26 p6eval rakudo cb4521: OUTPUT«1␤»
13:26 moritz_ yes, we can!
13:26 muixirt pugs: my $a=5; if $a<2 and $a>6 { say "YES"; }
13:26 masak colomon: no, it's a hash indexing.
13:26 p6eval pugs: OUTPUT«*** ␤    Unexpected "6"␤    expecting term postfix, operator or bare or pointy block construct␤    at /tmp/0NmGRO3vHq line 1, column 25␤»
13:26 moritz_ muixirt: if there's no whitespace after $a, it parses the < as a postcircumfix
13:26 muixirt that makes me think that it is not a bug
13:27 colomon masak: I guess if I squint my eyes I can see that...
13:27 moritz_ std: my $a=5; if $a<2 and $a>6 { say "YES"; }
13:27 p6eval std 30383: OUTPUT«[31m===[0mSORRY![31m===[0m␤Missing block at /tmp/iQe7Rvy7yS line 1:␤------> [32mmy $a=5; if $a<2 and $a>[33m⏏[31m6 { say "YES"; }[0m␤    expecting any of:␤    POST␤   bracketed infix␤    infix or meta-infix␤      postfix␤        postfix_prefix_meta_operator␤Parse
13:27 p6eval ..failed␤FAILED 00:01 108m␤»
13:27 colomon std: my $a=5; if $a<2 and $a>6 { say "YES"; }
13:27 p6eval std 30383: OUTPUT«[31m===[0mSORRY![31m===[0m␤Missing block at /tmp/J5KU8nYkL1 line 1:␤------> [32mmy $a=5; if $a<2 and $a>[33m⏏[31m6 { say "YES"; }[0m␤    expecting any of:␤    POST␤   bracketed infix␤    infix or meta-infix␤      postfix␤        postfix_prefix_meta_operator␤Parse
13:27 p6eval ..failed␤FAILED 00:01 108m␤»
13:27 moritz_ so rule No. 1 of my not-yet-written style guide: always use whitespace around infix operators
13:27 colomon indeed
13:27 pausenclown_ std: my $a=5; if $a < 2 and $a > 6 { say "YES"; }
13:27 masak aye.
13:27 p6eval std 30383: OUTPUT«ok 00:01 108m␤»
13:27 colomon moritz_++
13:28 masak unless you're golfing and really know what you're doing.
13:28 pausenclown_ whitespace++ =)
13:28 muixirt moritz_: and there is no solution to that?
13:28 moritz_ muixirt: there is. Whitespace.
13:28 masak rakudo: say " "x 9-$_,"#"x$_*2-1 for 0..9,2 xx 3
13:28 p6eval rakudo cb4521: OUTPUT«         ␤        #␤       ###␤      #####␤     #######␤    #########␤   ###########␤  #############␤ ###############␤#################␤       ###␤       ###␤       ###␤»
13:29 * masak chopped the Christmas Tree into slices :)
13:29 moritz_ masak: ay, but in the case of golfing I remove the whitespaces as an extra pass in the end
13:29 masak *nod*
13:29 pausenclown_ rakudo: my $a=5; if $a ~~ <2|<6 { say "YES"; }
13:29 p6eval rakudo cb4521: OUTPUT«Confused at line 11, near "if $a ~~ <"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
13:30 pausenclown_ rakudo: my $a=1; if $a ~~ any({<2},{<6} { say "YES"; }
13:30 p6eval rakudo cb4521: OUTPUT«Unable to parse blockoid, couldn't find final '}' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1664 (ext/nqp-rx/src/stage0/Regex-s0.pir:907)␤»
13:30 colomon afk # storytime
13:30 moritz_ #11960 So you threw in some random punctuation for no particular reason, and then you didn't get the result you expected.  Hmmmm.
13:30 moritz_ MJD++
13:30 pausenclown_ rakudo: my $a=1; if $a ~~ any({$_<2},{$_<6} { say "YES"; }
13:30 p6eval rakudo cb4521: OUTPUT«Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1664 (ext/nqp-rx/src/stage0/Regex-s0.pir:907)␤»
13:30 muixirt moritz_: it's confusing this whitespace sensitivity (esp. with the not so helpful error messages that come along with these problems)
13:31 masak muixirt: it's a conscious tradeoff.
13:31 masak muixirt: and the error messages are getting steadily better.
13:31 moritz_ muixirt: yes. But it's good for educating you to use a sane code layout
13:31 pausenclown_ cant i make a juntion of codeblocks?
13:31 pausenclown_ *junction
13:31 moritz_ pausenclown_: you can, but you need to use code blocks for that :-)
13:32 moritz_ rakudo: say ?(-2 ~~ { $_+2 } | { $_-2})
13:32 p6eval rakudo cb4521: OUTPUT«1␤»
13:32 moritz_ rakudo: say ?(-1 ~~ { $_+2 } | { $_-2})
13:32 p6eval rakudo cb4521: OUTPUT«1␤»
13:32 moritz_ rakudo: say ?(-2 ~~ { $_+2 } & { $_-2})
13:32 p6eval rakudo cb4521: OUTPUT«0␤»
13:33 pausenclown_ rakudo: my $a=1; if $a ~~ any({$_ < 2},{$_ < 6} { say "YES"; }
13:33 p6eval rakudo cb4521: OUTPUT«Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1664 (ext/nqp-rx/src/stage0/Regex-s0.pir:907)␤»
13:33 pausenclown_ rakudo: my $a=1; if $a ~~ any({$_ < 2},{$_ < 6}) { say "YES"; }
13:33 p6eval rakudo cb4521: OUTPUT«YES␤»
13:33 pausenclown_ watch ur braces! =)
13:33 pausenclown_ rakudo: my $a=3; if $a ~~ any({$_ < 2},{$_ < 6}) { say "YES"; }
13:34 p6eval rakudo cb4521: OUTPUT«YES␤»
13:34 pausenclown_ rakudo: my $a=3; if $a ~~ any({$_ < 2},{$_ > 6}) { say "YES"; }
13:34 p6eval rakudo cb4521:  ( no output )
13:34 masak snarkyboojum: I still haven't paid back that technical debt with testing the Yapsi runtime...
13:35 masak snarkyboojum: but after that, it's time to take a bite out of immediate blocks :)
13:35 snarkyboojum masak: sounds fun
13:35 masak snarkyboojum: things like 'my $a = 42; { say $a }'
13:35 masak I think it will be.
13:35 snarkyboojum masak: ok
13:36 snarkyboojum masak: so runtime.t needs filling out?
13:37 * moritz_ wonders if Perl 6 ASTs needs to be really split up in two trees - one primarily sorted by scope, and one by phaser
13:38 christine joined #perl6
13:38 masak snarkyboojum: yes. if you want to help, we might divide the labour as one making up tests, and the other one adding them.
13:39 snarkyboojum masak: always interested and willing to help :) will have a look
13:39 masak moritz_: the thing about phasers is that they aren't all there at parse time.
13:39 alester joined #perl6
13:40 moritz_ masak: nothing is there until it's parsed... that's kinda obvious, no?
13:41 masak moritz_: sure, but not what I meant.
13:41 masak I meant that phasers can be supplied at runtime as well.
13:41 masak or somewhere in between.
13:42 masak I've also been considering a 'static model' for the phasers, and more or less concluded that they will only get you so far.
13:42 moritz_ they can? but only in an eval, no?
13:42 masak or in a macro.
13:42 moritz_ well, a macro is expanded at BEGIN time
13:43 moritz_ so for all following phasers it's really irrelevant if it was supplied by a phaser or not
13:43 masak is BEGIN time necessarily over before the parsing is over?
13:43 jferrero joined #perl6
13:43 moritz_ yes
13:44 moritz_ it's as soon as the BEGIN block/statement is parsed
13:44 masak it only says 'as soon as possible'...
13:44 masak that might be a bit later sometimes.
13:44 moritz_ that's as soon as possible :-)
13:44 moritz_ if you talk about "a bit later", you already know it's not "as soon as possible" :-)
13:44 * masak .oO( whoa, named enums are like hashes, subtypes and subs all rolled into one... )
13:45 moritz_ I mean you couldn't change the grammar very effectfully if BEGIN time was after the parse of the whole file
13:45 masak moritz_: well, we're all a bit late sometimes for various reasons...
13:46 masak std: BEGIN { foo() }; sub foo() { say "OH HAI" }
13:46 p6eval std 30383: OUTPUT«ok 00:01 110m␤»
13:46 masak moritz_: has the 'foo' been parsed when the BEGIN block runs?
13:46 dalek joined #perl6
13:46 moritz_ masak: sure
13:46 masak the sub, I mean.
13:46 masak then the parse is all done.
13:46 moritz_ it first parses up to to the last closing }
13:47 moritz_ masak: yes, but that's a special case... there could be text after the BEGIN block
13:47 masak so the BEGIN block runs after the parse, not "as soon as possible".
13:47 moritz_ it runs after the parse *of the block*
13:47 moritz_ not after the parse of the compilation unit
13:48 masak oh, I see.
13:48 moritz_ BEGIN { A }; B; BEGIN { C }; D
13:48 moritz_ first parses BEGIN { A };
13:48 moritz_ runs A at compile time
13:48 moritz_ then parses B;
13:48 moritz_ then parses BEGIN {C }
13:48 moritz_ runs C
13:48 moritz_ parses D
13:49 moritz_ and if A or C contain more BEGIN blocks, apply recursively
13:49 Juerd It doesn't really have anything to do with beginning, does it?
13:49 masak waitwait.
13:50 moritz_ Juerd: not anymore
13:50 masak moritz_: if it runs A before it parses B, how can it work in my example?
13:50 Juerd NOW { ... } ;)
13:50 masak moritz_: I mean, the sub 'foo' isn't declared until after the BEGIN block.
13:50 moritz_ masak: oh sorry, I mispared your example
13:50 moritz_ masak: I thought the sub foo () { } was inside the BEGIN block
13:50 moritz_ then it won't work
13:51 masak but STD.pm6 doesn't detect it?
13:51 moritz_ seems like
13:51 moritz_ masak: perl 5 also dies
13:51 moritz_ perl -e 'BEGIN { foo() }; sub foo { }'
13:51 moritz_ Undefined subroutine &main::foo called at -e line 1.
13:51 moritz_ BEGIN failed--compilation aborted at -e line 1.
13:52 * moritz_ sorry for the confusion
13:52 masak fair enuf.
13:52 Trashlord joined #perl6
13:52 moritz_ rakudo: { foo() }; sub foo { say 3 }
13:52 p6eval rakudo cb4521: OUTPUT«3␤»
13:52 masak Rakudo works too well in this case. :)
13:52 moritz_ that only works because &foo is entered into the symbol table of the surrounding compilation unit
13:52 moritz_ rakudo: BEGIN { foo() }; sub foo { say 3 }
13:52 p6eval rakudo cb4521: OUTPUT«Could not find sub &foo␤current instr.: '_block11' pc 0 (EVAL_1:9)␤»
13:52 moritz_ rakudo++
13:53 masak aha.
13:53 masak right; the first one had no BEGIN in it.
13:53 moritz_ note the missing "non-existent" part in the error message :-)
13:54 masak \o/
13:54 masak someone++
13:57 iblechbot joined #perl6
13:59 payload joined #perl6
14:00 masak Juerd: well, NOW is not such a good name, because when 'now' is depends on when now is :)
14:00 moritz_ ASAP { ... }
14:01 masak cute :)
14:01 masak and END { ... } would be ALAP { ... } :)
14:02 Juerd I like ASAP :)
14:03 huf for a second there i thought the channel has switched to hungarian...
14:03 Juerd masak: That would imply that all ALAPs run in parallel :)
14:03 huf dont just throw around "words", you dont know what language you'll hit
14:04 masak Google Translate says 'alap' means 'base'
14:04 huf yep
14:04 * masak .oO( all your alap... )
14:04 moritz_ all your ALAP are...
14:04 huf :DDDD
14:05 Juerd I was looking at my irc window, thought "all your alap" and then saw it there, as if the computer had read my mind and typed it for me, only your nicknames were in front of the lines, not mine :)
14:05 masak it was too obvious, it seems :)
14:06 nacho joined #perl6
14:06 Juerd Obvious is good.
14:06 Juerd And clichés exist because they're true ;)
14:06 moritz_ principle of least surprise :-)
14:06 masak :)
14:06 moritz_ but to be funny, you have to surprise people
14:06 Juerd Not necessarily
14:07 Juerd Some forms of humor depend on the audience knowing exactly what's going to happen
14:07 masak you could meta-surprise them by not surprising them :)
14:07 Juerd For example, if a certain culture finds something funny unconditionally.
14:10 diakopter masak: a higher blah/comment ratio can be seen in the commits at sprixel/perlesque at csmeta.org ;)
14:10 masak oh noes! :)
14:11 masak here? http://code.google.com/p/csmeta/updates/list
14:11 masak I see no bla-s at all...
14:11 moritz_ but emty commit messages
14:12 masak those aren't bla-s :)
14:12 masak the point is that actually typing 'bla bla bla' in the commit message is somehow *less* informative than putting in nothing :)
14:13 masak it conveys 'I know this is a commit message, but I can't be bothered".
14:13 diakopter but blank ones...?
14:14 masak those might mean any number of things.
14:14 masak 'this commit is unworthy of a comment'
14:14 masak 'I don't know what to type here'
14:14 masak 'I somehow didn't realize that it was possible to leave a commit message'
14:14 moritz_ 'Others don't read my code anyway, and I myself don't really care all that much'
14:14 envi^home joined #perl6
14:15 pausenclown_ how do i write this shorter?
14:15 masak 'I have better things to do with my life than describe what changes I make. it was hard to write, it should be hard to figure out!'
14:15 pausenclown_ self.books[*-1]{$context.name}                        ??
14:15 pausenclown_ self.books[*-1]{$context.name}.push( $text.data ) !!
14:15 pausenclown_ self.books[*-1]{$context.name} = [ $text.data ]   ;
14:15 masak pausenclown_: with proper autovivification, it should just be the second line.
14:15 masak pausenclown_: for now, write a sub that does it for you.
14:16 masak taking a hash and a key as arguments.
14:16 moritz_ given self.books[*-1] { .{$context.name} //= []; .push: $text.data }
14:16 masak er, a hash, a key, and an array element.
14:16 masak or what moritz_ wrote :)
14:16 moritz_ erm, forgot one .{$context.name}
14:18 pausenclown_ masak: that was my expectation but it failed in rakudo.
14:18 masak what failed? the encapsulation?
14:19 justatheory joined #perl6
14:20 pausenclown_ Method 'push' not found for invocant of class 'Proxy'
14:20 masak please nopaste the whole attempt.
14:22 alester joined #perl6
14:25 ian__ joined #perl6
14:26 M_o_C joined #perl6
14:27 meppl joined #perl6
14:27 pausenclown_ rakudo: class Foo { has @.a is rw; method foo { self.a[0].push('foo'); } }; my $a = Foo.new; $a.foo; say $a.a
14:27 p6eval rakudo cb4521: OUTPUT«Method 'push' not found for invocant of class 'Proxy'␤current instr.: 'perl6;Foo;foo' pc 451 (EVAL_1:181)␤»
14:28 masak rightright, but you still need to do the trick of manually supplying the inner array *within* the method.
14:28 masak the thing with the encapsulation into a sub is that you only have to go through that once.
14:29 perseo22 joined #perl6
14:32 masak rakudo: sub create-or-push(%h is rw, $key, $elem) { %h{$key} ?? %h{$key}.push($elem) !! (%h{$key} = [$elem]) }; my %hash; create-or-push(%hash, "foo", $_) for 42, "OH HAI"; say %hash<foo>.perl
14:32 p6eval rakudo cb4521: OUTPUT«[42, "OH HAI"]␤»
14:32 masak something like that.
14:33 pausenclown_ rakudo: class Foo { has @.a is rw; method foo { self.a = self.a ?? [ |self.a, 'foo'] !! ['foo']; } }; my $a = Foo.new; $a.foo; say $a.a
14:33 p6eval rakudo cb4521: OUTPUT«foo␤»
14:33 pausenclown_ timtowdy =)
14:34 masak I suspect your way will give you arbitrary deep nestings of arrays.
14:34 masak s/arbitrary/arbitrarily/
14:34 pausenclown_ you mean | flattens nested?
14:35 pausenclown_ rakudo: say ( | [1,[2,3]]).perl
14:35 p6eval rakudo cb4521: OUTPUT«Capture.new()␤»
14:35 pausenclown_ rakudo: say | [1,[2,3]].perl
14:35 p6eval rakudo cb4521: OUTPUT«[1, [2, 3]]␤»
14:36 masak no, I mean assigning to a variable with the @ sigil already creates one layer. [] creates another.
14:38 pausenclown_ yeah, right.
14:38 masak since you're taking self.a and assigning [] to it every time, you'll get a new array layer every time.
14:39 perseo22 left #perl6
14:41 pausenclown_ rakudo: class Foo { has @.a is rw; method foo($x) { self.a = self.a ?? (self.a, $x) !! $x; } }; my $a = Foo.new; $a.foo(1); $a.foo(2); $a.foo(3); say $a.a.perl;
14:41 p6eval rakudo cb4521: OUTPUT«[1, 2, 3]␤»
14:41 pausenclown_ thats it
14:41 nihiliad joined #perl6
14:41 nihiliad joined #perl6
14:41 pausenclown_ i indeed forgot about the influence of the @
14:42 masak it's insidiously easy to get double layers in different ways.
14:42 masak rakudo: class A { has @.b }; say A.new(:b[1,2,3]).b.perl
14:42 p6eval rakudo cb4521: OUTPUT«[[1, 2, 3]]␤»
14:43 masak that's a bug nowadays, due mostly to my extensive complaining.
14:48 synth joined #perl6
14:57 masak rakudo: .say for map -> $a, $b { "$a, $b" }, 1, 2, 3, 4
14:57 p6eval rakudo cb4521: OUTPUT«Too many positional parameters passed; got 5 but expected 2␤current instr.: 'map' pc 341553 (src/gen/core.pir:18789)␤»
14:57 masak :(
14:59 colomon rakudo: map -> $a, $b { "$a, $b" }, 1, 2, 3, 4
14:59 p6eval rakudo cb4521: OUTPUT«Too many positional parameters passed; got 5 but expected 2␤current instr.: 'map' pc 341553 (src/gen/core.pir:18789)␤»
14:59 colomon rakudo: map -> $a, $b { "$a, $b" }, (1, 2, 3, 4)
14:59 p6eval rakudo cb4521:  ( no output )
15:00 * colomon shouldn't let masak sidetrack him like this...
15:03 masak rakudo: for 1, 2, 3 X <a b c> -> $a, $b { say $a, $b }
15:03 p6eval rakudo cb4521: OUTPUT«1 a1 b␤1 c2 a␤2 b2 c␤3 a3 b␤StopIteration␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
15:03 masak wow, it's actually brokeneder than before the merge.
15:05 colomon before what merge?
15:05 moritz_ ng
15:05 masak the ng one.
15:06 masak now it's wrong in two ways.
15:06 |Jedai| joined #perl6
15:06 masak before it was only wrong in one way.
15:07 colomon ah.
15:08 colomon I've fixed .say for map -> $a, $b { "$a, $b" }, 1, 2, 3, 4 locally, but then map.t blows up.
15:09 colomon No applicable candidates found to dispatch to for 'map'. Available candidates are:
15:09 colomon :(Mu : &block;; *%_)
15:10 colomon what's with the Mu?  I keep on getting that no matter what (this one is referring to Any.map, for instance...)
15:10 moritz_ invocant marker?
15:11 M_o_C joined #perl6
15:13 moritz_ is the sub form of map defined as 'is export' of a method?
15:14 colomon proto sub map(&mapper, *@values) { @values.map(&mapper); }
15:14 colomon that's my hacked version
15:14 colomon proto sub map(&mapper, @values) { @values.map(&mapper); }
15:14 colomon is the normal one.
15:14 moritz_ doesn't the *@stuff has still problems?
15:14 colomon I don't know.
15:14 colomon I'm sure thats why it wasn't *@stuff two months ago.
15:15 moritz_ I tried to change grep to use a slurpy about two weeks ago, and it blew up
15:15 colomon but things are getting fixed all the time, and some of the protos in Any-list.pm are already using *@a
15:16 colomon At any rate, the Mu thing is orthogonal to that, I think.
15:16 nacho joined #perl6
15:17 moritz_ rakudo: my @a = 1, 2; say @.PARROT
15:17 p6eval rakudo cb4521: OUTPUT«Lexical 'self' not found␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
15:17 moritz_ rakudo: my @a = 1, 2; say @a.PARROT
15:17 p6eval rakudo cb4521: OUTPUT«Array␤»
15:18 moritz_ rakudo: sub f(*@a) { say @a.PARROT }; f(1, 2)
15:18 p6eval rakudo cb4521: OUTPUT«Array␤»
15:18 * colomon didn't know .PARROT worked.
15:21 isBEKaml joined #perl6
15:22 moritz_ colomon: changing the @values to *@values in grep works, except that it then can't be called by name anymore
15:22 colomon ah
15:22 moritz_ which is less sever than not working on single items, IMHO
15:23 moritz_ rakudo: proto sub a(*@val) { say @val.perl }; a(:val<a b c>)
15:23 p6eval rakudo cb4521: OUTPUT«Unexpected named parameter 'val' passed␤current instr.: 'a' pc 223 (EVAL_1:83)␤»
15:23 moritz_ rakudo: proto sub a(@val) { say @val.perl }; a(:val<a b c>)
15:23 p6eval rakudo cb4521: OUTPUT«("a", "b", "c")␤»
15:23 colomon just undid my patch locally so I can get to $work using my Rakudo build.  :)
15:23 * moritz_ submits rakudobug
15:23 colomon moritz_++
15:25 moritz_ rakudo: proto sub a(@val) { say @val.perl }; say &a.signature.perl
15:25 p6eval rakudo cb4521: OUTPUT«get_attr_str() not implemented in class 'Perl6MultiSub'␤current instr.: 'perl6;Code;signature' pc 13230 (src/builtins/Str.pir:115)␤»
15:25 moritz_ rakudo: sub a(*@val) { say @val.perl }; a(:val<a b c>)
15:25 moritz_ rakudo: sub a(*@val) { say @val.perl }; a(:val<a b c>))
15:25 p6eval rakudo cb4521: OUTPUT«Unexpected named parameter 'val' passed␤current instr.: 'a' pc 194 (EVAL_1:78)␤»
15:25 cdarroch joined #perl6
15:25 cdarroch joined #perl6
15:25 p6eval rakudo cb4521: OUTPUT«Confused at line 11, near ")"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
15:25 moritz_ rakudo: sub a(*@val) { say @val.perl }; say &a.signature.perl
15:26 p6eval rakudo cb4521: OUTPUT«:(*@val)␤»
15:26 moritz_ rakudo: sub a(@val) { say @val.perl }; say &a.signature.perl
15:26 p6eval rakudo cb4521: OUTPUT«:(@val)␤»
15:26 moritz_ rakudo: sub a(@val) { say @val.perl }; a(:val<foo bar>)
15:26 p6eval rakudo cb4521: OUTPUT«("foo", "bar")␤»
15:29 pugssvn r30384 | moritz++ | [t/spec] change fudging in grep.t for rakudo
15:31 dalek rakudo: 3b5a790 | moritz++ | src/core/Any-list.pm:
15:31 dalek rakudo: make the grep() arguments slurpy
15:31 dalek rakudo: Closes RT #73444 by masak++
15:31 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/3b5a7901d51c5fc46f7c2f89afaa80d8e5b0d472
15:31 masak huh :)
15:32 ruoso joined #perl6
15:32 moritz_ masak: but don't worry, I've replaced it with a new one :-)
15:33 moritz_ RT #74344
15:33 masak oh phew :)
15:33 masak oh, that was the bug.
15:33 moritz_ wait
15:33 * moritz_ just confused bug numbers
15:34 moritz_ the one in the commit message is wrong :(
15:34 masak hm, yes.
15:35 moritz_ nope
15:35 moritz_ 7*34*44 vs 7*43*44
15:36 masak :)
15:39 masak rakudo: say <a b>.pick(*).perl; say (<a b>.pick(*) X <a b>.pick(*)).perl
15:39 p6eval rakudo cb4521: OUTPUT«("a", "b")␤()␤»
15:39 * masak submits rakudobug
15:39 masak for some reason, pick(*) and X don't interoperate well.
15:39 moritz_ rakudo: say <a b>.pick(*).PARROT
15:39 p6eval rakudo cb4521: OUTPUT«GatherIterator␤»
15:40 masak GatherIterator. my nemesis.
15:40 colomon Actually, that's probably a gather / take bug
15:40 wasy joined #perl6
15:40 masak oh no.
15:40 colomon rakudo:  say (<a b>.pick(*) X <a b>).perl
15:40 p6eval rakudo cb4521: OUTPUT«(("a", "a"), ("a", "b"), ("b", "a"), ("b", "b"))␤»
15:40 colomon rakudo:  say (<a b>.pick(*) X <a b>).perl
15:40 p6eval rakudo cb4521: OUTPUT«(("a", "a"), ("a", "b"), ("b", "a"), ("b", "b"))␤»
15:40 masak colomon++
15:41 wasy left #perl6
15:41 masak I'm afraid I have to reach the conclusion that Rakudo master isn't ready for my poker example just yet.
15:41 colomon Any time you use the same code twice and get a GatherIterator back both times, you can expect trouble.
15:41 masak the workarounds are piling up to infinity.
15:41 masak colomon: so it's not really a new bug, then?
15:41 colomon nope.
15:42 * masak doesn't submit
15:42 masak hm, but I can work around it, by doing one at a time...
15:43 moritz_ I'm sure you can add .eager to them
15:43 colomon rakudo: say (<a b>.pick(*) X <a b>.pick(*).Seq).perl
15:43 p6eval rakudo cb4521: OUTPUT«()␤»
15:43 moritz_ rakudo: say (<a b>.pick(*).eager X <a b>.pick(*).eager).perl
15:43 p6eval rakudo cb4521: OUTPUT«(("b", "a"), ("b", "b"), ("a", "a"), ("a", "b"))␤»
15:43 masak assigning one of them to an array worked !
15:43 colomon rakudo: say (<a b>.pick(*).Seq X <a b>.pick(*)).perl
15:43 p6eval rakudo cb4521: OUTPUT«(("b", "b"), ("b", "a"), ("a", "b"), ("a", "a"))␤»
15:43 masak oh, eager works too. nice.
15:44 colomon masak: assigning one to an array only works because arrays aren't properly lazy at the moment.  :(
15:44 masak I thought array assignment was supposed to be mostly eager.
15:44 colomon masak: you might be right about that, mostly eager is my nemesis.  :)
15:45 masak we all have our nemeses :)
15:47 masak rakudo: subset Foo of Array where { .elems == 5 }; sub bar(Foo $_) {}; bar([1,2,3])
15:47 p6eval rakudo cb4521: OUTPUT«Nominal type check failed for parameter '$_'; expected Array but got Array instead␤current instr.: 'bar' pc 468 (EVAL_1:179)␤»
15:47 * masak submits rakudobug
15:47 masak it's not the nominal typecheck that fails, it's... the other one.
15:47 masak the one with the where clause, whatever it's called.
15:48 moritz_ the nonominal type check :-)
15:49 masak really? I thought "nominal" had to do with the name part, i.e. Array in this case.
15:49 masak and that there was another part of the type check (possibly) called something else.
15:49 moritz_ nonominal = non-nominal :-)
15:49 arnsholt masak: Has such trifling details ever stopped Perl 6? =)
15:49 * moritz_ just made that up
15:50 masak oh, ah.
15:50 arnsholt Heh. I bought it =)
15:50 * masak wishes for a om-nominal type check :)
15:50 masak s/a/an/
15:51 moritz_ procedural type check?
15:51 TimToady jnthn++ started calling it "nominal" because it's part of the longname of a multi candidate
15:52 masak moritz_: that sounds vaguely right.
15:52 TimToady and because it's pretty much limited to a named type
15:52 moritz_ at lest S05 distinguishes "procedural" and "declarative" elements
15:53 moritz_ so we could steel that "procedural" for this case
15:53 TimToady you run the nominal check by (notionally) checking the name directly, not by running constraint code
15:53 moritz_ rakudo: sub &foo { }; say &foo.name
15:53 p6eval rakudo 3b5a79: OUTPUT«Confused at line 11, near "sub &foo {"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
15:54 moritz_ rakudo: sub foo { }; say &foo.name
15:54 p6eval rakudo 3b5a79: OUTPUT«foo␤»
15:54 masak rakudo: class G {}; subset A of Array where { all(|$_) ~~ G }; say [G.new, G.new, G.new] ~~ A
15:54 p6eval rakudo 3b5a79: OUTPUT«0␤»
15:55 masak :(
15:55 * masak seems to be running headlong into Rakudo today
15:57 masak rakudo: class G {}; my @g = [G.new, G.new, G.new]; say all(|@g) ~~ G
15:57 p6eval rakudo 3b5a79: OUTPUT«0␤»
15:57 masak oh.
15:58 moritz_ @g contains an Array
15:58 masak rakudo: class G {}; my @g = G.new, G.new, G.new; say all(|@g) ~~ G
15:58 masak right.
15:58 p6eval rakudo 3b5a79: OUTPUT«0␤»
15:58 moritz_ rakudo: class G {}; my @g = G.new, G.new, G.new; say all(@g) ~~ G
15:58 p6eval rakudo 3b5a79: OUTPUT«0␤»
15:58 moritz_ rakudo: class G { }; say all(G.new) ~~ G
15:58 p6eval rakudo 3b5a79: OUTPUT«0␤»
15:59 moritz_ rakudo: class G { }; say G.new ~~ G
15:59 p6eval rakudo 3b5a79: OUTPUT«1␤»
15:59 * masak submits rakudobug
15:59 moritz_ rakudo: class G { }; say ?(all( G.new ) ~~ G)
15:59 p6eval rakudo 3b5a79: OUTPUT«0␤»
15:59 masak rakudo: say all(42) ~~ Int
15:59 p6eval rakudo 3b5a79: OUTPUT«0␤»
15:59 masak maybe junctional smartmatching simply isn't in place yet.
16:00 moritz_ rakudo: say ('foo'&'bar').uc
16:00 p6eval rakudo 3b5a79: OUTPUT«all("FOO", "BAR")␤»
16:00 moritz_ rakudo: say ('foo'&'bar') ~~ .uc
16:00 p6eval rakudo 3b5a79: OUTPUT«0␤»
16:00 TimToady maybe the .ACCEPTS has a Mu arg?
16:01 pmurias joined #perl6
16:01 moritz_ I guess the appropriate ACCEPTS method is written in PIR still
16:01 moritz_ and autothreading over routines written in PIR never worked
16:02 * masak works around
16:02 dalek book: 0732332 | moritz++ | src/subs-n-sigs.pod:
16:02 dalek book: [subs] interpolating arguments and slurpy parameters
16:02 dalek book: review: http://github.com/perl6/book/commit/07323324c942bf476daaaec96210d7dffe9d7561
16:02 Sarten-X joined #perl6
16:03 sundar joined #perl6
16:03 TimToady rakudo: class G { }; say G.ACCEPTS(any(Int,G.new))
16:03 p6eval rakudo 3b5a79: OUTPUT«0␤»
16:05 ruoso rakudo: class G { }; say G.can('ACCEPTS').signature.perl
16:05 p6eval rakudo 3b5a79: OUTPUT«Method 'signature' not found for invocant of class 'P6Invocation'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
16:06 ruoso rakudo: class G { }; say G.get_method('ACCEPTS').signature.perl
16:06 p6eval rakudo 3b5a79: OUTPUT«Method 'get_method' not found for invocant of class ''␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
16:06 ruoso hmm
16:06 masak rakudo: subset Even of Int where { $_ !% 2 }; subset Fivey of Int where { $_ !% 5 }; subset Tennis of Int where Even & Fivey; say 40 ~~ Tennis
16:06 p6eval rakudo 3b5a79: OUTPUT«1␤»
16:06 masak \o/
16:07 masak ruoso: .can is totally b0rken as I understand it. don't use.
16:07 colomon \o/
16:08 moritz_ masak: you do know that 15 is a valid Tennis score? :-)
16:08 masak moritz_: yes, I was just giving the subset frivolous names :)
16:09 masak moritz_: at first I went for Tennish
16:09 moritz_ :-)
16:09 moritz_ Teeny :-)
16:09 ruoso rakudo: subset Even of int where { $_ !% 2 }; subset Fivey of Int where { $_ !% 5 }; subset SmallerThen 41 of Int where { $_ < 41 }; subset Tennis of Int where Even & Fivey & SmallerThan41; say 40 ~~ Tennis; say 41 ~~ Tennis;
16:09 p6eval rakudo 3b5a79: OUTPUT«Confused at line 11, near "subset Eve"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
16:09 ruoso rakudo: subset Even of int where { $_ !% 2 }; subset Fivey of Int where { $_ !% 5 }; subset SmallerThen41 of Int where { $_ < 41 }; subset Tennis of Int where Even & Fivey & SmallerThan41; say 40 ~~ Tennis; say 41 ~~ Tennis;
16:09 p6eval rakudo 3b5a79: OUTPUT«Confused at line 11, near "subset Eve"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
16:09 ruoso bah
16:10 * ruoso 's brain out of sync today
16:11 simcop2387 joined #perl6
16:14 TimToady std: subset Even of int where { $_ !% 2 }; subset Fivey of Int where { $_ !% 5 }; subset SmallerThen41 of Int where { $_ < 41 }; subset Tennis of Int where Even & Fivey & SmallerThan41; say 40 ~~ Tennis; say 41 ~~ Tennis;
16:14 p6eval std 30384: OUTPUT«[31m===[0mSORRY![31m===[0m␤Undeclared name:␤ 'SmallerThan41' used at line 1␤Check failed␤FAILED 00:01 110m␤»
16:15 TimToady std: subset Even of int where { $_ !% 2 }; subset Fivey of Int where { $_ !% 5 }; subset SmallerThan41 of Int where { $_ < 41 }; subset Tennis of Int where Even & Fivey & SmallerThan41; say 40 ~~ Tennis; say 41 ~~ Tennis;
16:15 p6eval std 30384: OUTPUT«ok 00:01 108m␤»
16:16 masak rakudo: subset A of Array; subset B of A; subset C of A; subset D of A where B & C; say [] ~~ D
16:16 p6eval rakudo 3b5a79: OUTPUT«Type objects are abstract and have no attributes, but you tried to access ␤current instr.: 'perl6;SeqIter;get' pc 14351 (src/builtins/Routine.pir:126)␤»
16:16 * masak submits rakudobug
16:18 masak rakudo: subset A of Array; subset B of A; subset C of Any; subset D of A where B & C; say [] ~~ D
16:18 p6eval rakudo 3b5a79: OUTPUT«Type objects are abstract and have no attributes, but you tried to access ␤current instr.: 'perl6;SeqIter;get' pc 14351 (src/builtins/Routine.pir:126)␤»
16:18 masak it appears to be a combination of doing the nominal A check multiple times, and the &
16:20 masak rakudo: subset A of Array; subset B of Any; subset C of Any; subset D of A where B & C; say [] ~~ D
16:20 p6eval rakudo 3b5a79: OUTPUT«1␤»
16:20 ash_ joined #perl6
16:22 ash_ so... was perl 5.12 release yesterday?
16:22 takadonet yes
16:22 moritz_ seems like
16:23 ash_ neat, perl.org still says 5.10.1
16:23 ash_ tis why i ask
16:24 CokeBot9000 http://search.cpan.org/dist/perl-5.12.0/
16:24 ash_ thanks, CokeBot9000++
16:25 nihiliad joined #perl6
16:26 CokeBot9000 np.
16:27 ash_ pluggable keywords? could you define new operators with that?
16:28 masak obra++
16:33 masak I finally got the pokerhand script working: http://gist.github.com/364800
16:33 masak I'm exhausted :)
16:34 masak will attempt to get it into the book later today.
16:34 masak (I need to annotate it with all the workarounds I put in, so we can remove them as the bugs get fixed)
16:35 moritz_ ash_: keyword != operator
16:35 CokeBot9000 masak: ThreeOfAKind:Trips::FourOfAKind:Quad
16:36 CokeBot9000 I like Kwad. Nice workaround. =-)
16:36 ash_ well, i figured you could associate a symbol like ! or something, since it says it accepts any ascii characters as the keyword, but yeah, your right, that probably wouldn't work out nicely
16:37 [particle] Kwad?
16:37 CokeBot9000 masak: would you like a patch for the last XXX ?
16:37 CokeBot9000 [particle]: Quad triggers a rakudo bug (parsed like Q:uad, or something)
16:38 CokeBot9000 masak++
16:38 [particle] uggh
16:38 masak CokeBot9000: yes, please!
16:39 masak theater &
16:41 M_o_C joined #perl6
16:44 CokeBot9000 latest rakudo doesn't build for me:
16:44 CokeBot9000 Lexical '$test' not found
16:44 CokeBot9000 current instr.: 'perl6;Perl6;Grammar;is_name' pc 41059 (src/gen/perl6-grammar.pi
16:44 CokeBot9000 (that's after a git pull and a realclean)
16:45 * moritz_ looks
16:53 moritz_ CokeBot9000: I have a local patch here, but that shouldn't change much... builds here without problems
16:53 moritz_ CokeBot9000: do you have a new parrot?
16:53 moritz_ CokeBot9000: iirc somebody broke some lexicals handling stuff in parrot today, and I'm still using an older parrot
16:54 CokeBot9000 ah, yes, t/op/lexicals.t is failing for me in trunk. that's probably it.
16:55 ash_ joined #perl6
16:58 dalek rakudo: fb38dbf | quester++ | src/core/ (3 files):
16:58 dalek rakudo: Fix Parcel.sort and add Hash.sort.
16:58 dalek rakudo: This fixes the very first example in
16:58 dalek rakudo: http://cloud.github.com/downloads/perl6/book/book-2010-04.pdf
16:58 dalek rakudo: See also: http://rt.perl.org/rt3/Ticket/Display.html?id=74334
16:58 dalek rakudo: Signed-off-by: Moritz Lenz <moritz@faui2k3.org>
16:58 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/fb38dbf61734705f2491eab3b2112c2398a34d2c
17:18 am0c joined #perl6
17:18 nihiliad joined #perl6
17:21 chromatic joined #perl6
17:22 Trashlord joined #perl6
17:22 chromatic left #perl6
17:31 CokeBot9000 moritz_: fixed.
17:32 * CokeBot9000 runs masak's script. (hurm. that's not quite right.)
17:32 moritz_ CokeBot9000++
17:32 Chillance joined #perl6
17:32 sjohnson 3hi moritz_
17:33 sjohnson oops
17:33 molaf joined #perl6
17:52 CokeBot9000 nopaste?
17:52 moritz_ see /topic
17:55 lisppaste3 CokeBot9000 pasted "Minor updates for masak's poker script; deal one at a time, s/Any/PokerHand/, fix issue with where clause in FullHouse.  " at http://paste.lisp.org/display/97730
17:55 CokeBot9000 (without the update to fullhouse, /everything/ was a full house.
17:56 ggoebel joined #perl6
17:57 moritz_ phenny: tell masak about http://paste.lisp.org/display/97730 by CokeBot9000++
17:57 phenny moritz_: I'll pass that on when masak is around.
18:03 stephenlb joined #perl6
18:05 CokeBot9000 moritz++
18:06 moritz_ dammit, why can't network routing be easy?
18:07 diakopter job security?
18:07 diakopter the eternal struggle.  job security vs innovation.
18:08 moritz_ I have a simple setup where I want my laptop to act as a router between my desktop and the router provided by the ISP
18:08 moritz_ and so far I've tried three different configurations, and after some debugging I understood why each of them didn't work
18:09 moritz_ but so far I'm refusing to do any internal NAT routing or masquerading
18:17 SmokeMachine joined #perl6
18:19 bkeeler So #rs is soon, yes?
18:23 arnsholt moritz_: Why do you need a router behind the other router?
18:25 SmokeMachine joined #perl6
18:28 moritz_ arnsholt: because I have no direct connection between router and PC
18:28 CokeBot9000 I heard you like routing...
18:29 moritz_ bkeeler: #rs is in 2 minutes, but due to a real life emergency I have to run off in a few minutes :(
18:32 arnsholt moritz_: You could try to get your laptop to bridge, rather than route?
18:32 arnsholt Might be simpler
18:32 [particle] moritz_: do you know about http://www.vyatta.org/ ?
18:34 * moritz_ has to run, will look at it later
18:36 SmokeMachine joined #perl6
18:40 mberends if anyone has anything to discuss in #rakudosketch, please join in the next few minutes
18:53 ingy joined #perl6
19:16 REPLeffect joined #perl6
19:19 mberends moritz_: is your emergency under control now?
19:19 moritz_ mberends: yes
19:26 ingy I have a theoretical question about versioning...
19:26 ingy more or less theoretical
19:26 ingy I am trying to figure out a versioning scheme for C'Dent
19:27 ingy and realized that there is a spec version and an implementation version
19:27 ingy at least
19:27 ingy maybe a standard lib spec version
19:27 ingy what does perl 6 do?
19:28 ingy WWP6D?
19:29 mberends there is a major section called Versioning in S11: http://perlcabal.org/syn/S11.html#Versioning
19:30 mberends and a short term plan: http://github.com/rakudo/rakudo/blob/master/docs/S11-Modules-proposal.pod
19:39 colomon rakudo: my @a = 1...10; say @a[*-1]
19:39 p6eval rakudo fb38db: OUTPUT«10␤»
19:39 colomon word.
19:41 ShaneC1 left #perl6
19:45 ggoebel joined #perl6
19:46 sakib joined #perl6
20:04 M_o_C joined #perl6
20:11 lisppaste3 cognominal pasted "error using proto token in rakudo-nqp-rx" at http://paste.lisp.org/display/97741
20:13 moritz_ cognominal: proto *token* test <...>
20:15 cognominal joined #perl6
20:15 moritz_ proto test  declares a proto sub test
20:16 cognominal thx
20:17 cognominal I guess this the wrong default in a grammar.
20:18 moritz_ it is; but changing the default in different kind of scopes would be ETOOMUCHMAGIC
20:19 cognominal now suppose I want  a blank as sym in proto token, what would be the synta for that?
20:19 cognominal Is ETOOMUCHMAGIC possible in a Perl interpreter?
20:20 moritz_ :sym< >
20:20 moritz_ at least I hope
20:20 moritz_ it's taken as a literal, not as a regex
20:20 moritz_ or you just use ' ' instead of <sym> in the body of the rule
20:26 solu joined #perl6
20:26 cognominal I am not sure, here  blank has a  special meaning  token postfix:sym<[ ]> {
20:30 colomon rakudo: my @a = 1...3; for @a, 42 { .say }
20:30 p6eval rakudo fb38db: OUTPUT«1␤2␤3␤42␤»
20:30 colomon rakudo: my @a = 1...3; (@a, 42).map( { .say } ).eager
20:30 p6eval rakudo fb38db: OUTPUT«1␤2␤3␤42␤»
20:34 spinclad :sym(' ') might work, i expect :sym< > to trim whitespace to nothing
20:35 spinclad :sym<[ ]> means :sym('[', ']'), as usual, iirc
20:37 colomon rakudo: my @a = 1...3; (@a, 42).kv.eager.perl.say
20:37 p6eval rakudo fb38db: OUTPUT«(0, 1, 1, 2, 2, 3, 3, 42)␤»
20:38 colomon rakudo: my @a = 1...3; (@a, 42).pairs.eager.perl.say
20:38 p6eval rakudo fb38db: OUTPUT«(0 => 1, 1 => 2, 2 => 3, 3 => 42)␤»
20:40 colomon rakudo: my @a = 1...3; (@a, 42).pairs.min({ .value }).perl.say
20:40 p6eval rakudo fb38db: OUTPUT«Too many positional parameters passed; got 2 but expected between 0 and 1␤current instr.: '_block57' pc 413 (EVAL_1:147)␤»
20:41 colomon rakudo: my @a = 1...3; (@a, 42).pairs.min({ $^a.value <=> $^b.value }).perl.say
20:41 p6eval rakudo fb38db: OUTPUT«0 => 1␤»
20:44 TiMBuS joined #perl6
20:47 pyrimidine joined #perl6
20:51 solu Hey, I have a couple questions about importing modules into a Perl 6 script.
20:51 solu Can you import a Perl 5 module into Perl 6?
20:52 colomon not yet
20:52 solu Okay, thanks.
20:52 mberends it's being worked on over here: http://github.com/jnthn/blizkost
20:53 solu How do you change the @INC paths? In Perl 5, it was: use lib "my new directory"; is there a Perl 6 version of this?
20:54 mberends Perl 6 has @*INC for the same purpose
20:54 solu so it would be: push @*INC, "new directory"?
20:55 mberends yes, inside a BEGIN { ... } block
20:55 solu okay, thanks!
20:55 mberends if you put your directories into PERL6LIB before running your program, that also adds them to @*INC
21:00 solu hmm, still getting an error.
21:01 solu Can't find ./Module in @*INC in Main (src\gen_setting.pm:445)
21:01 solu I pushed the right directory, that's not the problem, I think.  I'm using "use Module;" to import it
21:03 solu any idea what's wrong?
21:06 molaf joined #perl6
21:28 estrabd_ joined #perl6
21:29 estrabd joined #perl6
21:33 wknight8111 joined #perl6
21:34 pmurias joined #perl6
21:41 snarkyboojum joined #perl6
21:43 pausenclown joined #perl6
21:47 quietfanatic joined #perl6
21:50 tri1 joined #perl6
22:02 snarkyboojum rakudo: subset Quad of Any; sub classify($_) { when Quad {}; when Quad {} }
22:02 p6eval rakudo fb38db: OUTPUT«Unable to parse blockoid, couldn't find final '}' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1664 (ext/nqp-rx/src/stage0/Regex-s0.pir:907)␤»
22:02 snarkyboojum I like that's related to the recent q-bug :)
22:02 snarkyboojum rakudo: subset uad of Any; sub classify($_) { when uad {}; when uad {} }
22:02 p6eval rakudo fb38db:  ( no output )
22:03 snarkyboojum rakudo: subset Q of Any; sub classify($_) { when Q {}; when Q {} }
22:03 p6eval rakudo fb38db: OUTPUT«Missing block at line 11, near "; when Q {"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
22:03 snarkyboojum rakudo: subset q of Any; sub classify($_) { when q {}; when q {} }
22:03 p6eval rakudo fb38db: OUTPUT«Missing block at line 11, near "; when q {"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
22:03 nacho joined #perl6
22:03 snarkyboojum rakudo: subset Qa of Any; sub classify($_) { when Qa {}; when Qa {} }
22:03 p6eval rakudo fb38db: OUTPUT«Unable to parse blockoid, couldn't find final '}' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1664 (ext/nqp-rx/src/stage0/Regex-s0.pir:907)␤»
22:03 snarkyboojum rakudo: subset a of Any; sub classify($_) { when a {}; when a {} }
22:03 p6eval rakudo fb38db:  ( no output )
22:03 snarkyboojum :)
22:10 pyrimidine left #perl6
22:16 rgrau joined #perl6
22:18 snarkyboojum rakudo: subset q of Any; when q {};
22:18 p6eval rakudo fb38db: OUTPUT«Missing block at line 11, near ";"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
22:19 snarkyboojum rakudo: subset q of Any; when /q/ {};
22:19 p6eval rakudo fb38db:  ( no output )
22:19 snarkyboojum rakudo; subset q of Any; when q(test) {};
22:19 snarkyboojum rakudo: subset q of Any; when q/test/ {};
22:19 p6eval rakudo fb38db:  ( no output )
22:21 snarkyboojum rakudo: when q {}
22:21 p6eval rakudo fb38db: OUTPUT«Missing block at line 11, near ""␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
22:24 oskie joined #perl6
22:28 tri1 left #perl6
22:28 oskie i wonder if rakudo will be debianized prior to or at release
22:28 oskie ooh, it's in experimental
22:29 pmurias oskie: rakudo has loads releases
22:29 pmurias * loads of
22:37 pmurias would an erlang like concurrency model make sense in Perl 6?
22:55 quester_ joined #perl6
23:05 snarkyboojum joined #perl6
23:09 OuLouFu joined #perl6
23:12 CokeBot9000 http://blogs.activestate.com/2010/04/perl-5-is-alive/ - "Development of Perl 6 was announced in Summer 2000. Attempts to change Perl 5 in any major way were forthwith redirected to the Perl 6 project, as Perl 5 was now supposed to go into maintenance mode" ... really?
23:13 Juerd Somewhat.
23:14 Juerd Perl 6 turned out to become a new language instead :)
23:14 diakopter I think CokeBot9000 asks "really?" about the "was supposed to go into maintenance mode" portion
23:15 Juerd That view did exist.
23:15 Juerd Nobody knows how many people actually believed it :)
23:15 diakopter ah
23:16 Juerd I have no idea if this was ever an official thing, by the way.
23:34 mariano joined #perl6
23:36 SmokeDroid joined #perl6
23:38 SmokeDroid rakudo, @a = 1, 1 ... {$^a + $^b}; @a[3].say
23:39 m6locks you need to type rakudo: to evaluate
23:40 m6locks (i guess)
23:40 m6locks rakudo: @a = 1, 1 ... {$^a + $^b}; @a[3].say
23:40 p6eval rakudo fb38db: OUTPUT«Symbol '@a' not predeclared in <anonymous>␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 152 (compilers/pct/src/PCT/HLLCompiler.pir:108)␤»
23:43 quester_ rakudo: <1 3 4 2>.sort({-$^a}).say
23:43 p6eval rakudo fb38db: OUTPUT«4321␤»
23:43 quester_ :)
23:45 diakopter rakudo: my @a = 1, 1 ... {$^a + $^b}; @a[3].say
23:45 p6eval rakudo fb38db:  ( no output )
23:55 nihiliad joined #perl6
23:58 lue hello

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

Perl 6 | Reference Documentation | Rakudo