»ö« | perl6.org/ | nopaste: paste.lisp.org/new/perl6 | evalbot usage: 'perl6: say 3;' or rakudo:, alpha:, pugs:, std:, or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend!
Set by lichtkind on 5 March 2010.
thowe it seems uncommon though. 00:00
lue I personally put [ if thisandthat { \n code here... \n } ]
pausenclown i find myself being very differential in this matter
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
lue (basically, I consider the { part of the line (whether it's saying if, while, etc.), and I let } line up with the block.)
pausenclown: that makes clarity suffer, so that will likely never happen.
pausenclown its fine in Javascript. 00:03
snarkyboojum well, you have statement if (condition) :) 00:04
lue yes, there's that.
rakudo: my $true = True; say "hello" if $true
pausenclown true. but where do i put the fucking else? =)
p6eval rakudo b9aaa3: OUTPUT«hello␤»
snarkyboojum oh you didn't mention else :)
in which case you have a ternary op :P
lue for if/else, use [conditon]??[success]!![failure] 00:05
pausenclown i think the ternary is only for when it has a lvalue
diakopter std: foo: sub bar() { }; goto bar; 00:06
p6eval std 30379: OUTPUT«ok 00:01 108m␤»
pausenclown not just for side effects
00:09 justatheory left
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)␤»
lue rakudo: my $true = True; $true ?? say "hi" !! say "boo";
p6eval rakudo b9aaa3: OUTPUT«hi␤»
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:10 kensanata left
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)␤»
colomon rakudo: my $true = True; say $true ?? "hi" !! "boo";
p6eval rakudo b9aaa3: OUTPUT«hi␤»
pausenclown rakudo: say Bool::True 00:12
p6eval rakudo b9aaa3: OUTPUT«1␤»
pausenclown rakudo: say Bool::True.WHAT
p6eval rakudo b9aaa3: OUTPUT«Bool()␤»
pausenclown rakudo: say Bool::True + 2 00:13
p6eval rakudo b9aaa3: OUTPUT«3␤»
pausenclown rakudo: say 2 + -(Bool::True)
p6eval rakudo b9aaa3: OUTPUT«1␤»
00:13 muixirt left
pausenclown rakudo: say 1 == Bool::True 00:14
p6eval rakudo b9aaa3: OUTPUT«1␤»
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)␤»
pausenclown rakudo: my Bool $x; $x=Bool::True
p6eval rakudo b9aaa3: ( no output )
pausenclown mmh
not being able to assign 1|0 to Bool seems unperlish 00:16
lue you didn't say anything :)
snarkyboojum rakudo: say Bool::True ~~ Bool
p6eval rakudo b9aaa3: OUTPUT«1␤»
snarkyboojum rakudo: say Bool::True ~~ Int
p6eval rakudo b9aaa3: OUTPUT«0␤»
snarkyboojum unperl6ish perhaps :) 00:17
pausenclown no. i mean like 00:18
rakudo: my Bool $x; $x=1
p6eval rakudo b9aaa3: OUTPUT«Type check failed for assignment␤current instr.: '&die' pc 17293 (src/builtins/Junction.pir:404)␤»
snarkyboojum well
rakudo: my $x = True; $x = 1;
p6eval rakudo b9aaa3: ( no output )
snarkyboojum rakudo: my $x = True; $x.WHAT.say; $x = 1; $x.WHAT.say; 00:19
p6eval rakudo b9aaa3: OUTPUT«Bool()␤Int()␤»
snarkyboojum makes sense to me
pausenclown rakudo: my Bool $x; $x=:bool(1)
p6eval rakudo b9aaa3: OUTPUT«Type check failed for assignment␤current instr.: '&die' pc 17293 (src/builtins/Junction.pir:404)␤»
snarkyboojum more importantly 00:20
rakudo: say True ~~ 1
p6eval rakudo b9aaa3: OUTPUT«1␤»
snarkyboojum rakudo: say False ~~ 1
p6eval rakudo b9aaa3: OUTPUT«0␤»
lue I wonder...
rakudo: my Bool $x = True; $x ~ 1;
pausenclown <-- pillow listening 00:21
p6eval rakudo b9aaa3: ( no output )
lue rakudo: my Bool $x = False; $x ~ 1; say $x
p6eval rakudo b9aaa3: OUTPUT«0␤»
lue so close :)
colomon why are you making the string "01" and then throwing it away? 00:23
lue I was assuming ~ was smart assign, like ~~ is smart match :) 00:25
snarkyboojum hehe - or smart concatenate? :P
colomon ~ is string concat 00:26
lue lemme guess, there is no smart assign :/ 00:27
colomon There is no smart assign.
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
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)␤»
lue rakudo: say "hello" if True; say "snarkyboojum" if 1;
p6eval rakudo b9aaa3: OUTPUT«hello␤snarkyboojum␤»
colomon say 1.Bool.WHAT
rakudo: say 1.Bool.WHAT
lue QED
p6eval rakudo b9aaa3: OUTPUT«Bool()␤»
colomon rakudo: my Bool $x = False; $x = 1.Bool; say $x 00:30
p6eval rakudo b9aaa3: OUTPUT«1␤»
snarkyboojum what colomon said :)
rakudo: say "snarkyboojum" if 45 00:31
p6eval rakudo b9aaa3: OUTPUT«snarkyboojum␤»
snarkyboojum 45 isn't of type Bool either
lue how it typically works is 0 is false, and !0 is true.
colomon oh, hey, there's an operator for .Bool
rakudo: my Bool $x = False; $x = ?1; say $x 00:32
p6eval rakudo b9aaa3: OUTPUT«1␤»
colomon rakudo: my Bool $x = False; $x = ?0; say $x
p6eval rakudo b9aaa3: OUTPUT«0␤»
lue :O
snarkyboojum also
rakudo: say False ~~ 0
p6eval rakudo b9aaa3: OUTPUT«1␤»
snarkyboojum rakudo: say 0 ~~ False
p6eval rakudo b9aaa3: OUTPUT«0␤»
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:33 wknight8111 left
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)
p6eval rakudo b9aaa3: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤2␤4␤6␤8␤3␤6␤4␤8␤4␤»
00:35 lestrrat is now known as lest_away
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:35
lue rakudo: say (False ~~ 0).WHAT 00:36
p6eval rakudo b9aaa3: OUTPUT«Bool()␤»
lue rakudo: say (0 ~~ False).WHAT
p6eval rakudo b9aaa3: OUTPUT«Bool()␤»
snarkyboojum rakudo: say 0 ~~ +False 00:37
p6eval rakudo b9aaa3: OUTPUT«1␤»
snarkyboojum rakudo: say ?0 ~~ False
p6eval rakudo b9aaa3: OUTPUT«0␤»
snarkyboojum rakudo: say (?0).WHAT; say False.WHAT 00:38
p6eval rakudo b9aaa3: OUTPUT«Bool()␤Bool()␤»
snarkyboojum rakudo: say (?0) ~~ False 00:39
p6eval rakudo b9aaa3: OUTPUT«0␤»
snarkyboojum weird
diakopter ok, time for labels
deferring parameters/arguments for another day
:D
TimToady: what does this mean:
std: foo: sub bar() { }; goto bar;
p6eval std 30379: OUTPUT«ok 00:01 110m␤»
lue hopefully, you're talking about labels for perlesque, and not the whole of P6 ? 00:40
diakopter P6
P6 has labels/goto
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?
diakopter so the compiler writer isn't limited to the control structures built into the language
snarkyboojum heh oh dear 00:42
diakopter ?
colomon rakudo: say False ~~ False
p6eval rakudo b9aaa3: OUTPUT«0␤»
colomon ~~ False always returns false, and ~~ True always returns true.
lue is running. He hates binary spaghetti /o\ 00:43
colomon At least, that's how Rakudo appears to implement things.
snarkyboojum ok - I don't understand something :)
00:43 ascent_ left
snarkyboojum false can't match anything can it :) 00:43
d'oh 00:44
rakudo: say (?0) ~~ Bool
p6eval rakudo b9aaa3: OUTPUT«1␤»
snarkyboojum ;)
snarkyboojum is a bit slow since cutting out coffee of a morning
colomon I dunno, I'm not sure why it's done that way.] 00:45
snarkyboojum this reminds me of 00:46
rakudo: say False ~~ True 00:47
p6eval rakudo b9aaa3: OUTPUT«1␤»
colomon rakudo: say Mu ~~ True
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)␤»
snarkyboojum True always matches, False never does
colomon hmmm.... so is Mu failure sensible or a bug? 00:48
lue rakudo: say 3 is 3
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)␤»
lue (i was hoping 'is' existed :/) 00:49
snarkyboojum rakudo: given False { when True { say "matched" } }
p6eval rakudo b9aaa3: OUTPUT«matched␤»
lue rakudo: say False == False 00:51
p6eval rakudo b9aaa3: OUTPUT«1␤»
lue rakudo: say False ~~ False
p6eval rakudo b9aaa3: OUTPUT«0␤»
lue so, "smart" match is telling me false isn't false?
colomon Any True ~~ True (parsewarn) 00:52
Any False ~~ False match (parsewarn)
looks like it is supposed to generate a warning?
snarkyboojum lue: perlcabal.org/syn/S03.html#line_3705
I think it's working like this
"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:53
colomon++ 00:54
TimToady diakopter: it means call the goto function with the result of the bar function as its first argument.
diakopter o_O 00:55
oh.
heh
TimToady goto is just a function syntactically
which is why a forward goto requires quotes
lue it should tell me that smart match is so smart it knows false isn't false :/
diakopter std: foo: sub bar() { }; goto foo; 00:56
p6eval std 30379: OUTPUT«ok 00:01 108m␤»
00:56 synth left
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
p6eval std 30379: OUTPUT«ok 00:01 109m␤»
diakopter and no forward gotos
snarkyboojum rakudo: sub A { ... }; A().WHAT.say
p6eval rakudo b9aaa3: OUTPUT«Failure()␤»
snarkyboojum rakudo: sub A { }; A().WHAT.say
diakopter actually no
p6eval rakudo b9aaa3: OUTPUT«Null PMC access in find_method('WHAT')␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
diakopter forward gotos are fine
snarkyboojum Null PMC access! :) 00:58
diakopter without quotes tho
00:58 ascent_ joined
TimToady not in Perl 6 they aren't fine 00:58
well, hmm, maybe they could be
std: goto foo; foo: 00:59
p6eval std 30379: OUTPUT«===SORRY!===␤Bogus statement at /tmp/ePo8L4SvBq line 1 (EOF):␤------> goto foo; foo:⏏<EOL>␤Illegally post-declared type:␤ 'foo' used at line 1␤Parse failed␤FAILED 00:01 107m␤»
TimToady std: goto foo; foo:;
p6eval std 30379: OUTPUT«===SORRY!===␤Illegal use of colon as invocant marker at /tmp/GOPGIGm6LT line 1:␤------> goto foo; foo:⏏;␤Undeclared routine:␤ 'foo' used at line 1,1␤Check failed␤FAILED 00:01 108m␤»
TimToady std: goto foo; foo: ;
p6eval std 30379: OUTPUT«===SORRY!===␤Illegally post-declared type:␤ 'foo' used at line 1␤Check failed␤FAILED 00:01 106m␤»
TimToady probably not a good idea 01:00
since the 'foo' is officially parsing as a listop
though in the case of goto, it generally doesn't matter
could probably be forced to work 01:01
01:01 pausenclown left 01:03 isBEKaml left, quietfanatic left
lue False isn't false, gotos exist... A bad day for me and P6 :) 01:04
TimToady it isn't that false isn't false, it's that smart matching is differently smart than you. :) 01:05
01:05 quietfanatic joined
diakopter quietfanatic: o_O 01:07
lue I'm fine with false not false, but I'm not sure many others will be :)
In fact, I'd probably place False ~~ False as some sort of smart anti-theft code. 01:08
01:11 lest_away is now known as lestrrat
sorear lue: you seem to be under the impression (~~) is supposed to be an equivalence relation 01:13
that's not at all what it does
smart match is a pattern matching DSL 01:14
like regex for any data type
True is U, False is ø
quietfanatic diakopter: O _ o 01:19
lue DSL? (you're saying it's a bit like Regex For Dummies (An operator for the rest of us!™)) 01:22
diakopter perlesque: my int $a = 2; foo: $a += 1; if ($a < 20) { goto foo }; System::Console.WriteLine($a) 01:24
p6eval perlesque: OUTPUT«20␤»
diakopter perlesque: my int $a = 2; foo: $a += 1; if ($a < 10000000) { goto foo }; System::Console.WriteLine($a)
p6eval perlesque: OUTPUT«10000000␤»
diakopter perlesque: my int $a = 2; foo: $a += 1; if ($a < 1000000000) { goto foo }; System::Console.WriteLine($a) 01:25
p6eval perlesque: OUTPUT«1000000000␤»
quietfanatic System::Console::WriteLine?
diakopter CLR .net/mono builtins
quietfanatic Maybe you should shorten that to SCW
or, like say.
diakopter :P
01:26 am0c left
diakopter that's for Perl 6 01:26
this is perlesque
perlesque is burlesque. and assemblish
and werdy
quietfanatic And System::Console::WriteLn-ish
That's hard to say. 01:27
I'd say you need to write some builtin functions.
diakopter but.. I'm trying to discourage humans from typing it
quietfanatic That's saydistic.
diakopter it's supposed to be a ... target language, you see.
TimToady wait, why are you typing it?
diakopter climbed back on the mushroom and nibbled a bit. 01:28
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 ()
..<0x0003c>␤a…
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 ()
..<0x0003c>␤a…
diakopter perlesque: 3; sub foo() { blah: 4 }; goto blah
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 ()
..<0x0003c>␤a…
diakopter 3-SATisfied 01:31
lue
.oO(diakopter: I need a 1up, sorry)
diakopter hmm. it would be a late commute if I went in now. 01:32
lue afk 01:51
01:56 Psyche^ joined
spinclad from the backscroll, /me likes [isso]<-=[isit]=->[isnot] for a one-line conditional <-= =-> 01:59
02:00 Patterner left, Psyche^ is now known as Patterner 02:04 garslo joined
spinclad diakopter: i want to suggest making calls be gotos with arguments, but i haven't got a clean syntax to suggest yet... 02:05
02:06 justatheory joined 02:07 f00li5h left, f00li5h joined 02:08 rv2733 left, nihiliad joined
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␤»
diakopter no parameters yet
nor invocations of scalars 02:09
but a sub can be stored in a scalar now, I think 02:10
perlesque: my sub $foo = sub blah() { 444 }; System::Console.WriteLine($foo);
p6eval perlesque: OUTPUT«Sprixel.Runtime.sub␤» 02:11
diakopter it's actually implicitly typed
don't ask how.
it's some bottom-up way of doing type inference
sorear Sprixel? 02:12
spinclad the only tricky thing i do above is make the 1f label take arguments, and it seems fairly clean
diakopter sprixel, an anagram of perlsix
the engine/runtime that hosts perlesque
spinclad (if you like continuation-passing style) 02:13
diakopter heh.
don't you dare dare me.
sorear I thought sprixel was an implementation in its own right
diakopter it will be, eventually
sorear also, I thought perlesque was an engine
diakopter perlesque is what I'm calling theh assembly language 02:14
think of it as PIR, but with fewer line breaks
and with native types. 02:15
sorear so basically, NQP
diakopter actually I think next perlesque needs compact arrays
nqp doesn't have native types or compact arrays tho
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.
just as powerfully as scheme.
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:18
sorear diakopter: nqp is getting native types next month 02:19
and nqp does have compact arrays
spinclad but... anyway, i haven't quite gotten to suggesting it, so you may utterly disregard my blather here 02:22
02:23 agentzh joined
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)␤»
sorear nqp: my @arr := pir::new__ps('FixedIntegerArray'); pir::assign__vpi(@arr, 50*1024*1024); say($arr[50000000])
p6eval nqp: OUTPUT«Symbol '$arr' not predeclared in <anonymous>␤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 137 (compilers/pct/src/PCT/HLLCompiler.pir:101)␤»
sorear nqp: my @arr := pir::new__ps('FixedIntegerArray'); pir::assign__vpi(@arr, 50*1024*1024); say(@arr[50000000])
p6eval nqp: OUTPUT«0␤»
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)␤»
sorear nqp: my @arr := pir::new__ps('FixedIntegerArray'); pir::assign__vpi(@arr, 50*1024*1024); @arr[50000000] := 42; say(@arr[50000000])
p6eval nqp: OUTPUT«42␤»
sorear nqp: my @arr; @arr[50000000] := 42; say(@arr[50000000])
p6eval nqp: OUTPUT«42␤»
02:31 snarkyboojum left 02:34 mariano left
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:38
sorear arrays which store native types directly, without indirection through a polymorphic object 02:39
which is what the built-in FixedIntegerArray and related classes do
the last example was a non-compact array; I was trying to crash p6eval-nqp by allocating 50 million polymorphic objects
(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?
sorear the runtime which underlies NQP has native types 02:41
NQP does not yet have the syntactic support for them, but it can use objects composed of them fine
diakopter oh
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
sorear because it's on my todo list 02:43
I might fail
diakopter oh; :)
yeah, boxing/unboxing
the compiler that underlies perlesque (RunSharp) does that for me
(adds the boxing/unboxing CIL instructions where needed) 02:44
02:47 TiMBuS left
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
exposing the compiler API to perlesque code in a better way
02:48 synth13204234234 joined
diakopter string eval 02:49
02:49 synth13204234234 is now known as synth
diakopter contextuals 02:49
02:50 mariano joined, synth left
diakopter I can't think of anything else at the moment 02:51
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)
I was certain it would work at one point :) 02:52
but I've forgotten.
(how)
diakopter stops rambling.
02:53 synth13204234234 joined 02:54 synth13204234234 is now known as synth
diakopter perlesque: my int $a = 4; if ($a > 5) { goto bar }; System::Console.WriteLine(32342342); bar: 5; 02:56
p6eval perlesque: OUTPUT«32342342␤»
diakopter perlesque: my int $a = 6; if ($a > 5) { goto bar }; System::Console.WriteLine(32342342); bar: 5;
p6eval perlesque: ( no output )
diakopter :)
02:58 alester left 03:01 synth left 03:02 synth joined 03:04 synth left, synth joined 03:10 meppl left 03:12 nihiliad left 03:25 mariano left 03:38 molaf joined, garslo left 03:40 thowe left 03:43 thowe joined
thowe Can an array hold more than one type of object? 03:43
sorear sure
thowe OK, because the wikibook seems to avoid showing an array with a mix of types 03:44
if "type" is the right word
03:44 bacek_at_work joined
sorear well, a type is really just a set of values 03:44
and an array must have all of its elements drawn from the same set
but there's nothing to stop that set from being 'Any' 03:45
or 'Mu' which also includes junctions
thowe so you can't have @a = $b, @c, %d
sorear my @a; is shorthand for my @a of Mu
$b, @c, and %d are all instances of subclasses of Any
they can all fit into an Array of Any
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
sorear Any is a subclass of Mu 03:46
thowe but you can say that the array can only contain integers if you want? 03:47
sorear yes
thowe what does that syntax look like?
sorear my int @a iirc
thowe Interesting. Thanks.
sorear rakudo: my Int @a 03:48
p6eval rakudo b9aaa3: ( no output )
sorear rakudo doesn't implement native types yet; you have to use the wrapper class Int
like java.lang.Integer
03:49 stephenlb left 04:08 alester joined 04:23 justatheory left 04:26 dj_goku left 04:28 molaf left 04:29 dj_goku joined 04:30 _jaldhar_ joined 04:31 jaldhar_ left 04:34 JimmyZ joined 04:41 am0c left 04:48 snarkyboojum joined 04:49 am0c joined 05:11 szabgab joined 05:32 IllvilJa left 05:33 JimmyZ left, bacek left, charsbar_ left, cotto_work left, kfo left, jhuni left, kst left, nadim left, Sanitoeter left, betterworld left, baest left, hatseflats left, frodwith left, cookys left, Helios left, huf left, ingy left, diakopter left, drbean left, dual left, sorear left, tylerni7 left, lue left, ian_ left, allbery_b left, frettled left, solarion left, thowe left, synth left, gfldex left, arlinius left, revdiablo left, aesop left, alester left, Sarten-X left, CokeBot9000 left, hejki left, cj left, lisppaste3 left, PacoLinux left, mikehh left, athomason left, akl left, REPLeffect left, cls_bsd left, Exodist_ left, silug left, mtve left 05:35 JimmyZ joined, alester joined, thowe joined, synth joined, REPLeffect joined, bacek joined, diakopter joined, lisppaste3 joined, PacoLinux joined, mikehh joined, charsbar_ joined, cotto_work joined, drbean joined, gfldex joined, kfo joined, dual joined, sorear joined, cls_bsd joined, arlinius joined, ian_ joined, Sarten-X joined, jhuni joined, Exodist_ joined, kst joined, athomason joined, CokeBot9000 joined, tylerni7 joined, lue joined, silug joined, nadim joined, yahooooo joined, arnsholt joined, rgrau` joined, bbkr joined, cosimo joined, [particle] joined, Intensity joined, wolverian joined, jql joined, Sanitoeter joined, szbalint joined, kcwu joined, fda314925 joined, jjore1 joined, cotto joined, cookys joined, revdiablo joined, Helios joined, huf joined, mtve joined, betterworld joined, allbery_b joined, hejki joined, baest joined, ingy joined, cj joined, frettled joined, hatseflats joined, aesop joined, solarion joined, frodwith joined, akl joined, holmes.freenode.net sets mode: +oo ingy frettled 05:36 Patterner left, Trashlord left, simcop2387 left, nsh left, stepnem left, Juerd left, Trey left, yves left, buu left, tomaw left, JimmyZ left, bacek left, charsbar_ left, cotto_work left, kfo left, jhuni left, kst left, nadim left, arnsholt left, cosimo left, Intensity left, Sanitoeter left, jjore1 left, betterworld left, baest left, hatseflats left, frodwith left, yahooooo left, cotto left, cookys left, Helios left, huf left, ingy left, diakopter left, drbean left, dual left, sorear left, tylerni7 left, lue left, ian_ left, kcwu left, allbery_b left, frettled left, solarion left, thowe left, synth left, gfldex left, arlinius left, szbalint left, revdiablo left, aesop left, alester left, Sarten-X left, CokeBot9000 left, jql left, hejki left, cj left, lisppaste3 left, PacoLinux left, mikehh left, athomason left, rgrau` left, bbkr left, wolverian left, akl left, REPLeffect left, cls_bsd left, Exodist_ left, silug left, [particle] left, fda314925 left, mtve left, am0c left, agentzh left, orafu left, elmex left, gabiruh left, opx^away left, quietfanatic left, szabgab left, snarkyboojum left, _jaldhar_ left, Teratogen left, plobsing left, lestrrat left, IRSeekBot left, takadonet left, PerlJam left, pnu left, zibri left, moritz_ left, spinclad left, dalek left, p6eval left, Maddingue left, bacek_at_work left, mantovani left, renormalist left, _ilbot2 left 05:37 akl joined, frodwith joined, solarion joined, aesop joined, hatseflats joined, frettled joined, cj joined, ingy joined, baest joined, hejki joined, allbery_b joined, betterworld joined, mtve joined, huf joined, Helios joined, revdiablo joined, cookys joined, cotto joined, jjore1 joined, fda314925 joined, kcwu joined, szbalint joined, Sanitoeter joined, jql joined, wolverian joined, Intensity joined, [particle] joined, cosimo joined, bbkr joined, rgrau` joined, arnsholt joined, yahooooo joined, nadim joined, silug joined, lue joined, tylerni7 joined, CokeBot9000 joined, athomason joined, kst joined, Exodist_ joined, jhuni joined, Sarten-X joined, ian_ joined, arlinius joined, cls_bsd joined, sorear joined, holmes.freenode.net sets mode: +oo frettled ingy, dual joined, kfo joined, gfldex joined, drbean joined, cotto_work joined, charsbar_ joined, mikehh joined, PacoLinux joined, lisppaste3 joined, diakopter joined, bacek joined, REPLeffect joined, synth joined, thowe joined, alester joined, JimmyZ joined, szabgab joined, am0c joined, snarkyboojum joined, _jaldhar_ joined, bacek_at_work joined, agentzh joined, Patterner joined, quietfanatic joined, orafu joined, elmex joined, Teratogen joined, dalek joined, takadonet joined, gabiruh joined, Trashlord joined, p6eval joined, opx^away joined, simcop2387 joined, plobsing joined, mantovani joined, proller joined, Gothmog_ joined, sbp joined, nsh joined, Khisanth joined, meteorjay joined, pjcj joined, felipe joined, Woody2143 joined, sunnavy joined, bkeeler joined, mathw joined, m6locks joined, astinus joined, japhb joined, gbacon joined, Jedai joined, buubot joined, hugme joined, hicx174 joined, phenny joined, frooh joined, kolibrie joined, _sri joined, eiro joined, stepnem joined, PerlJam joined, pnu joined, Juerd joined, renormalist joined, zibri joined, tomaw joined, buu joined, yves joined, Trey joined, IRSeekBot joined, lestrrat joined, spinclad joined, moritz_ joined, holmes.freenode.net sets mode: +oovo mathw PerlJam IRSeekBot moritz_, Maddingue joined, _ilbot2 joined 05:39 Trashlord left
pugssvn r30380 | lwall++ | [STD] warn on attempts to smartmatch with True or False 05:45
05:47 Trashlord joined 05:48 Trashlord is now known as Guest33323, JimmyZ left 05:49 araujo joined 05:53 araujo left, araujo joined 06:01 uniejo joined
moritz_ good morning 06:19
snarkyboojum guten moren moritz_ 06:20
morgen :|
06:29 payload joined
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:␤------> False ~~ True⏏<EOL>␤ok 00:01 109m␤»
TimToady std: True ~~ False
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:␤------> True ~~ False⏏<EOL>␤ok 00:01 107m␤»
snarkyboojum TimToady - that's awesome :) 06:46
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:␤------> False ~~ False⏏<EOL>␤ok 00:01 107m␤»
06:49 payload1 joined, payload left
snarkyboojum I get a broken link to svn.pugscode.org/pugs/src/perl6/STD.pm, I take it, it's been renamed to STD.pm6? 06:50
moritz_ yes
snarkyboojum: where is that link?
snarkyboojum good-o
sorear we should put the official highlighted version of STD.pm up
snarkyboojum mortiz_: on my website :)
sorear and link to that
moritz_ sorear: it would be best to have a page with some general information about STD.pm
06:53 chromatic joined
snarkyboojum the link to STD on the perl 6 wiki is b0rken - www.perlfoundation.org/perl6/index.cgi?std_pm 06:57
and perl6.org/ ? 06:59
yep - and perl6.org
07:01 payload1 left, payload joined
snarkyboojum a quick google shows it's linked in a number of places :) 07:02
07:06 payload left
snarkyboojum method dumbsmart ($litbool) heh - TimToady++ 07:06
sorear std: given (False) { when (False) {} } 07:07
p6eval std 30380: OUTPUT«ok 00:01 109m␤»
TimToady parens defeat the check currently 07:08
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:␤------> given (False) { when False⏏ {} }␤ok 00:01 107m␤»
sorear sorry, p5think
snarkyboojum std: given True { when (True) {} } 07:11
p6eval std 30380: OUTPUT«ok 00:01 107m␤»
snarkyboojum std: given True { when True {} }
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:␤------> given True { when True⏏ {} }␤ok 00:01 107m␤»
snarkyboojum cool
moritz_ std: given Bool::True { } 07:15
p6eval std 30380: OUTPUT«ok 00:01 107m␤»
TimToady it never tests the given
moritz_ oh right 07:16
std: when Bool::True { }
p6eval std 30380: OUTPUT«ok 00:01 107m␤»
snarkyboojum std: when True {}
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:␤------> when True⏏ {}␤ok 00:01 107m␤»
TimToady there are many ways to defeat it, until we get constant folding 07:17
snarkyboojum just looks at 'True' and 'False' too
fun
still awesomerized :)
TimToady possible to get it to do false positive too 07:18
sorear std: constant True := 5; False ~~ True; 07:19
p6eval std 30380: OUTPUT«===SORRY!===␤Malformed constant at /tmp/bsFvwceWx1 line 1:␤------> constant True :⏏= 5; False ~~ True;␤ expecting any of:␤ coloncircumfix␤ signature␤Parse failed␤FAILED 00:01 107m␤»
sorear std: constant True = 5; False ~~ True;
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:␤------> constant True = 5; False ~~ True⏏;␤ok 00:01 107m␤»
sorear like that? 07:20
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:␤------> 0 ~~ False⏏.WHAT␤ok 00:01 107m␤»
snarkyboojum I'm sure lue will still be less perplexed :) 07:26
moritz_: so who can update perl6.org to fix the link to STD.pm? 07:29
moritz_ snarkyboojum: everybody with access to the pugs svn 07:30
07:30 am0c left 07:31 iblechbot joined 07:32 alester left
snarkyboojum ah, so it's already been updated 07:33
moritz_: how about the wiki? 07:34
07:35 mberends joined
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 :-)
snarkyboojum :O
07:42 IllvilJa joined
snarkyboojum moritz_: I should work out how to get a login then :P 07:46
IllvilJa o
07:47 am0c joined
pugssvn r30382 | moritz++ | [scripts] fix non-globbing in command line arguments 07:47
Teratogen we need to get Perl 6 out the door, folks
get people in the industry using it
for major projects 07:48
we need a production version of Perl 6 1.0
07:48 moritz_ sets mode: +b *!*leontopod@unaffiliated/teratogen, Teratogen was kicked by moritz_ (Teratogen))
mberends Teratogen: stop repeating yourself, or we will ... 07:48
moritz_ or I did. 07:49
mathw what was this 'we'? 07:58
snarkyboojum what a funny guy
mathw And good localtime to you 07:59
mathw has tea, and a pleasant morning-after-aikido feeling
08:02 fridim joined, aesop left, am0c left 08:03 jferrero joined 08:04 hanekomu joined 08:05 aesop joined
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:15
mathw \o/ 08:17
08:17 synth left 08:19 masak joined
masak oh hai, #perl6 08:19
mberends oh hai, masak 08:20
frettled Hello, Dr. Morning, I presume.
08:20 gfx joined, frettled sets mode: +oo masak mberends 08:21 moritz_ sets mode: +ooo masak mberends snarkyboojum
snarkyboojum masak o/ 08:21
08:22 gfx left
masak snarkyboojum: got a moment for Yapsi sometime during the morning-evening? :) 08:22
snarkyboojum masak: later this evening my time - yes for sure 08:23
masak \o/
snarkyboojum :)
masak wishes there were a established word 'prenoon' in English
mathw 'morning' usually suffices for most people 08:24
08:24 rekhajos joined, clintongormley joined
mberends masak: could you look at a proto bug that has me stumped? 08:25
masak sure. 08:27
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
for example, './proto install svg' triggers the error 08:30
masak trajs it
mberends most projects do actually get installed, which is kinda useful 08:31
masak \o/
I'm so glad you're digging into this.
moritz_ mberends: that syntax worries me...
%!project-state{$project}<state> = $state;
masak why? 08:32
moritz_ mberends: hashes don't autoviv
in rakudo, at least
oh wait
that's handled above...
moritz_ shuts up
08:33 hanekomu left
masak my proto dies earlier than that. 08:35
08:36 dakkar joined
masak "Method 'exists' not found for invocant of class 'Proxy'" 08:36
masak glares angrily at the Proxy class in Rakudo
Proxy: you're of no particular use whatsoever, are you?
08:36 mberends is now known as Proxy
masak :) 08:37
08:37 Proxy is now known as mberends
masak error occurs on line 95 in Ecosystem.pm6 08:38
so %!project-info{$project} doesn't exist for me.
moritz_ same here 08:39
mberends that may be because the file does not exist at the expected location
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
masak I do have a 'svg:' in my projects.list, though.
spinclad: thanks! you've made my forenoon! 08:40
mberends the file should be ~/.perl6/proto/projects.state
masak mberends: isn't it supposed to find projects.list in the current directory?
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.
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.
just the filename itself all the way.
wouldn't it be looking in the current directory, then?
mberends it would 08:43
mberends blushes
spinclad mathw: i expect it's in occasional use in rural or elder or other conservative bywaters
mberends there are *two* projects.state files here, in ~/proto and ~/.perl6/proto
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.
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
they diff on an 's'.
mberends good point. consistency++
masak (and we can't change the name of the file) :)
mberends ok, will rename the methods. 08:46
08:46 fridim_ joined
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
masak maybe 'load-projects-list' isn't the intended name of that method... 08:48
sounds good.
moritz_ general reminder: tonight 18:30 UTC is #rakudosketch meeting
mberends yes. the projects.state got tacked on afterwards
thanks moritz_
masak *nod*
masak will, once again, be unable to attend #rs 08:49
moritz_ :(
08:49 fridim left
masak yes :( 08:49
next Tuesday should be fine.
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.
mberends ok 08:52
spinclad sleep(:time(sleeptime)) 08:54
&
09:02 sorear left 09:09 sorear joined 09:14 jonasbn joined 09:26 fridim_ left 09:31 fridim_ joined
masak at the bottom of friendfeed.com/the-life-scientists/...nt-to-mine people are worried about the availability of libs when Perl 6 "comes out". 09:37
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
the more we can get working for Rakudo Star, the better.
let's go! www.success.co.il/knowledge/images/...acroix.jpg :) 09:39
moritz_ encourages people not to forget the booko
s/o$//
masak indeed. 09:40
I have two concrete plans. let's say I put them into action this week.
(1) make a chapter about the Poker example
(2) make a chapter with a simple web app 09:41
if I do those two, I'll move over to massive review-editing. 09:43
moritz_ some meta operators are already explained in the chapter on operators 09:44
it's sure worth expanding
masak does (1) now
09:45 chromatic left
masak here's the Poker hand example, for those who haven't seen it yet: gist.github.com/244255 09:47
I'm sure it can be updated for Rakudo master a bit.
I'll start with that.
oh noes, named enums! :(
moritz_ :(
masak ok, I'll do this: I'll emulate named enums as much as I can by the latest spec. 09:49
then we can put in the real named enums when the time comes. 09:50
that's a way to 'scout ahead'.
09:53 fridim_ left 09:54 fridim_ joined
dalek kudo: cb45216 | (Solomon Foster)++ | src/core/Real.pm:
Fix Real.abs and Real.sign to use named invocants.
09:59
masak colomon++
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) )
colomon I need to do a blog post on it. ;)
p6eval rakudo b9aaa3: OUTPUT«Too many positional parameters passed; got 1 but expected 1␤current instr.: 'perl6;A;foo' pc 400 (EVAL_1:171)␤»
masak submits LTA rakudobug
colomon moritz_: very slowly, but surely
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
moritz_ having moved myself recently I know the extra work, and how slow it returns to 0 afterwards 10:01
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.
p6eval std 30382: OUTPUT«ok 00:01 111m␤» 10:03
moritz_ multis from within roles?
colomon moritz_: and more. 10:04
how is cool coming, btw?
masak ready for review and merge, last I heard. 10:06
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
p6eval rakudo b9aaa3: OUTPUT«0␤1␤0␤1␤»
masak lunch & 10:12
10:30 szabgab left, fridim_ left 10:35 pmurias joined
pmurias TimToady: viv generates some classes at runtime while it has some pregenerated 10:36
10:40 synth joined 10:47 pausenclown joined
pausenclown g'localtime 10:47
10:48 ruoso joined 10:50 _jaldhar_ left 10:51 _jaldhar_ joined 10:53 fridim_ joined
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?
moritz_ easy access, although I don't like XML::Simple 10:55
maybe XPath would be better
10:57 agentzh left
moritz_
.oO( never ask a Perl 6 hacker for advice, 'cause he'll tell you both aye and nay )
10:57
10:58 snarkyboojum left
pmurias aye|nay to be precise 10:58
pausenclown maybe i should ask Grant McLean if he wants to tackle the "easy" part =)
anybody know his irc nick? 10:59
11:00 quester_ joined 11:02 fridim_ left
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 lestrrat is now known as lest_away
quester_ just wanted to check that was still broken before submitting a patch for it 11:04
11:18 iblechbot left 11:22 am0c joined 11:26 szabgab joined 11:27 am0c__ joined 11:28 rv2733 joined 11:30 am0c left 11:31 am0c joined
pausenclown do we have tools for the new POD yet? 11:31
11:32 am0c__ left 11:33 am0c__ joined
moritz_ no 11:33
11:36 am0c left
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:39
11:42 steffan joined, adm_ joined 11:43 rekhajos left, am0c joined
pausenclown masak: my parser relies on grammars so i'd say its as fast as rakudos IO and the grammar engine. 11:44
masak I admire the effort. I'll probably read through that code somehow, looking for cool ideas. 11:45
pausenclown it's on github
masak URL?
pausenclown github.com/pausenclown/XML--Parser 11:46
11:47 am0c__ left
moritz_ is still looking for volunteers for the April release of Rakudo 11:47
it's *not* the Rakudo * release
masak :D :/
pausenclown: mind telling me why you choose that... interesting commit comment habit? :) 11:48
pausenclown masak; the docs are really to be trusted.
best to look at the test files 11:49
11:49 steffan left
pausenclown lol. no i dont mind. 11:49
i dont really care in early project stages =)
11:50 envi^home joined
pausenclown oh. s/really/not really/ 11:50
masak commit comments are probably the first thing I look at when I see a new project. 11:51
this is the largest bla-to-commit-comment ratio I've ever encountered. :) 11:52
moritz_ reduced it a wee bit
masak moritz_++
pausenclown i promise to better myself =)
masak ++pausenclown :)
masak looks at the tests 11:53
11:53 M_o_C left
masak looks really nice. 11:54
what's that second positional argument to .parse ? 11:55
pausenclown it defines the action class 11:57
masak why a string?
pausenclown like dom, handler
so that the caller doesnt need to create an instance of XML::Parser::Actions::* by himself 11:58
takadonet morning all
masak takadonet: \o
pausenclown but i should probably let him do that if he wants 11:59
masak it doesn't feel very extensible as it is now. 12:00
the new_action method contains four hardcoded cases, with much similarity between them.
pausenclown this is because Foo::Bar::$name doesnt work yet 12:01
masak also, that method does two quite different things.
it sets an attribute and returns a value.
pausenclown not a value. the value it set. 12:03
so it behaves like a classic setter; cant see whats wrong with that. 12:04
12:05 payload joined
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
saves a lot of repetition, and makes things more orthogonal.
12:06 adm joined, adm_ left
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]
r30383 | enabled caching the parse tree in bread
r30383 | added a -P{STD,STD-cached} option to bread
pausenclown that is correct.
masak++ # glorious beetle hunter 12:08
masak :)
this is when thinking in patters pays off.
s/patters/patterns/
Separation of Concerns is good for the soul, because the points of failure aren't entangled with each other. 12:09
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:10 payload left
masak anyway, great work. I see there's a lot of effort put into all this. 12:15
pausenclown: hm, github.com/pausenclown/XML--Parser/...Parser.pod says there's a POD error at line 175. 12:17
lisppaste3 pausenclown pasted "better parse" at paste.lisp.org/display/97719 12:19
masak this one breaks DRY... :) 12:21
pausenclown DRY? 12:22
masak though it's arguably better than the last one.
Don't Repeat Yourself.
you list the admissible string values twice.
better to put in a default clause in the given.
pausenclown doesnt default always run? 12:23
masak also, the $action_arg parameter is never used.
moritz_ pausenclown: only when no when-block run
masak pausenclown: all 'when' clauses escape the given if they match.
pausenclown oh.
my bad =)
12:24 adm left
pausenclown i'm still concerned about how to implement external entity parsing. 12:25
as it involves reading from files from "within" the grammar.
masak rakudo: say "foo" ~~ / f <{ say "bar" ~~ /bar/ }> oo / 12:28
p6eval rakudo cb4521: OUTPUT«bar␤foo␤»
12:32 mathw left, mathw joined
pausenclown .u L B BAR SYMBOL 12:32
phenny U+2114 L B BAR SYMBOL (℔)
pausenclown ty phenny
;-) 12:33
moritz_ .u foo
phenny U+1558 CANADIAN SYLLABICS FOO (ᕘ)
moritz_ .u foobar
phenny moritz_: Sorry, no results for 'foobar'.
moritz_ .u foo bar
phenny moritz_: Sorry, no results for 'foo bar'.
moritz_ well, one can try :-)
pausenclown .u bar 12:34
phenny U+00A6 BROKEN BAR (¦)
pausenclown .u foo .u bar
phenny pausenclown: Sorry, no results
pausenclown Programmer goes into a Bar->(); Bartender says, did u know this arrow is redundant? 12:35
12:36 PZt joined, plobsing left
moritz_ an SQL query goes into a bar, looks at two tables and says 'mind if I join you?' 12:37
masak that one made Twitter yesterday :) 12:38
pausenclown lol. 12:39
a friend of mine was arrested at the weekend.
he is somewhat looking like the typical terrorist (beard, muslim, et al). 12:40
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:41
*backpack 12:42
moritz_ that's soooo old, and on bash.org for years... 12:43
pausenclown damn
worth a try.
masak doesn't get it 12:44
quester_ submits RT #74334: [PATCH] Fix Parcel.sort (fixes the very first example in cloud.github.com/downloads/perl6/bo...10-04.pdf) and Hash.sort
masak quester_++
quester_ Thank you, masak! 12:45
masak no, thank _you_, quester_! :) 12:46
pausenclown switches computers
masak rakudo: my @a = 1,2,3; my ($b, @c) = @a; say @c.perl 12:48
alpha: my @a = 1,2,3; my ($b, @c) = @a; say @c.perl
p6eval rakudo cb4521: OUTPUT«[[2, 3]]␤»
alpha 30e0ed: OUTPUT«[2, 3]␤»
masak submits rakudobug
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:49
masak rakudo: my @a = 1,2,3; my (@c) = @a; say @c.perl 12:50
p6eval rakudo cb4521: OUTPUT«[[1, 2, 3]]␤»
masak alpha: my @a = 1,2,3; my (@c) = @a; say @c.perl
p6eval alpha 30e0ed: OUTPUT«[1, 2, 3]␤» 12:51
masak rakudo: my @a = 1,2,3; my @c = @a; say @c.perl
p6eval rakudo cb4521: OUTPUT«[1, 2, 3]␤»
12:51 pausenclown left, holli joined
masak wonders if this is related to the issue with double arrays in attributes 12:52
12:53 holli left, SmokeMachine joined 12:55 holli joined 12:58 pausenclown_ joined
quester_ Good night, all. o/ 13:02
masak quester_: 'night! 13:03
13:04 quester_ left 13:06 alester joined 13:08 am0c left 13:11 ruoso left
pausenclown_ wtf! pugscode is down- 13:12
no its just the repository 13:13
13:13 alester left
arnsholt pausenclown_: It's allahu akbar (god is great), btw. Not insh allah (god willing) =) 13:13
(Modulo spelling)
masak there's no correct spelling if you're behind a transcription wall anyway... 13:15
std: subset Quad of Any; sub classify($_) { when Quad {}; when Quad {} }
p6eval std 30383: OUTPUT«ok 00:01 110m␤»
masak rakudo: subset Quad of Any; sub classify($_) { when Quad {}; when Quad {} }
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)␤»
arnsholt masak: Point, point
masak rakudo: subset B of Any; sub classify($_) { when B {}; when B {} }
p6eval rakudo cb4521: ( no output )
masak confused
masak submits rakudobug
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)␤»
masak rakudo: subset B of Any; sub classify($_) { when B {}; when B {} }; say 'alive'
p6eval rakudo cb4521: OUTPUT«alive␤»
pausenclown_ subset Q of Any; sub classify($_) { when Q {}; when Q {} }; say 'alive' 13:18
13:18 Lorn joined
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)␤»
masak .oO( things beginning with Q... ) 13:19
pausenclown_ what the fuck?
masak or, as they say in Latin, 'quod the fuck?'
arnsholt ^^
pausenclown_ rakudo: subset _Q of Any; sub classify($_) { when _Q {}; when _Q {} }; say 'alive'
p6eval rakudo cb4521: OUTPUT«alive␤»
13:20 snarkyboojum joined
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)␤»
pausenclown_ rakudo: say q(1)
p6eval rakudo cb4521: OUTPUT«Could not find sub &q␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
pausenclown_ rakudo: say q
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
masak oh. 13:21
pausenclown_ what the heck is special about a Q?
masak we had a ticket like this the other day.
it's the quoting constructs.
the LTM should catch that, but it doesn't.
masak finds-and-merges
pausenclown_: thanks :)
pausenclown_ but there is no q construct anymore 13:22
masak there isn't?
rakudo: say q[oh hai!]
p6eval rakudo cb4521: OUTPUT«oh hai!␤»
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"; }
p6eval rakudo cb4521: OUTPUT«YES␤»
muixirt rakudo: my $a=5; if $a<2 and $a>6 { say "YES"; }
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)␤»
pausenclown_ rakudo: my $a=5; if 2 < $a <6 { say "YES"; }
p6eval rakudo cb4521: OUTPUT«YES␤»
snarkyboojum bonjour pausenclown
whoops - that was delayed somewhat :) 13:24
pausenclown_ ieeeek! french!!
muixirt why is the my second code snippet wrong?
pausenclown_ hides
snarkyboojum :)
arnsholt muixirt: The < > might get interpreted as a hash accessor
muixirt arnsholt: is that a bug or a feature? 13:25
snarkyboojum hi masak-san
pausenclown_ besides that, a number can never be smaller than 2 and bigger than 6 at the same time?
snarkyboojum er masak_san
colomon bug
snarkyboojum :)
arnsholt muixirt: I've no idea. But if colomon says bug, that's probably right =)
masak snarkyboojum: hi!
SmokeMachine: (neither one highlights here)
colomon I'm just going on instinct there, but I'm pretty sure it must be a bug.
masak er, meant snarkyboojum. 13:26
moritz_ rakudo: say ?( 6 > 1|7 < 2)
muixirt well why is that:
p6eval rakudo cb4521: OUTPUT«1␤»
moritz_ yes, we can!
muixirt pugs: my $a=5; if $a<2 and $a>6 { say "YES"; }
masak colomon: no, it's a hash indexing.
p6eval pugs: OUTPUT«*** ␤ Unexpected "6"␤ expecting term postfix, operator or bare or pointy block construct␤ at /tmp/0NmGRO3vHq line 1, column 25␤»
moritz_ muixirt: if there's no whitespace after $a, it parses the < as a postcircumfix
muixirt that makes me think that it is not a bug
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"; }
p6eval std 30383: OUTPUT«===SORRY!===␤Missing block at /tmp/iQe7Rvy7yS line 1:␤------> my $a=5; if $a<2 and $a>⏏6 { say "YES"; }␤ expecting any of:␤ POST␤ bracketed infix␤ infix or meta-infix␤ postfix␤ postfix_prefix_meta_operator␤Parse
..failed␤FAILED 00:01 108m␤»
colomon std: my $a=5; if $a<2 and $a>6 { say "YES"; }
p6eval std 30383: OUTPUT«===SORRY!===␤Missing block at /tmp/J5KU8nYkL1 line 1:␤------> my $a=5; if $a<2 and $a>⏏6 { say "YES"; }␤ expecting any of:␤ POST␤ bracketed infix␤ infix or meta-infix␤ postfix␤ postfix_prefix_meta_operator␤Parse
..failed␤FAILED 00:01 108m␤»
moritz_ so rule No. 1 of my not-yet-written style guide: always use whitespace around infix operators
colomon indeed
pausenclown_ std: my $a=5; if $a < 2 and $a > 6 { say "YES"; }
masak aye.
p6eval std 30383: OUTPUT«ok 00:01 108m␤»
colomon moritz_++
13:27 jferrero left
masak unless you're golfing and really know what you're doing. 13:28
pausenclown_ whitespace++ =)
muixirt moritz_: and there is no solution to that?
moritz_ muixirt: there is. Whitespace.
masak rakudo: say " "x 9-$_,"#"x$_*2-1 for 0..9,2 xx 3
p6eval rakudo cb4521: OUTPUT« ␤ #␤ ###␤ #####␤ #######␤ #########␤ ###########␤ #############␤ ###############␤#################␤ ###␤ ###␤ ###␤»
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
masak *nod*
pausenclown_ rakudo: my $a=5; if $a ~~ <2|<6 { say "YES"; }
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)␤»
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)␤»
colomon afk # storytime
moritz_ #11960 So you threw in some random punctuation for no particular reason, and then you didn't get the result you expected. Hmmmm.
MJD++
pausenclown_ rakudo: my $a=1; if $a ~~ any({$_<2},{$_<6} { say "YES"; }
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)␤»
muixirt moritz_: it's confusing this whitespace sensitivity (esp. with the not so helpful error messages that come along with these problems)
masak muixirt: it's a conscious tradeoff. 13:31
muixirt: and the error messages are getting steadily better.
moritz_ muixirt: yes. But it's good for educating you to use a sane code layout
pausenclown_ cant i make a juntion of codeblocks?
*junction
moritz_ pausenclown_: you can, but you need to use code blocks for that :-)
rakudo: say ?(-2 ~~ { $_+2 } | { $_-2}) 13:32
p6eval rakudo cb4521: OUTPUT«1␤»
moritz_ rakudo: say ?(-1 ~~ { $_+2 } | { $_-2})
p6eval rakudo cb4521: OUTPUT«1␤»
moritz_ rakudo: say ?(-2 ~~ { $_+2 } & { $_-2})
p6eval rakudo cb4521: OUTPUT«0␤»
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)␤»
pausenclown_ rakudo: my $a=1; if $a ~~ any({$_ < 2},{$_ < 6}) { say "YES"; }
p6eval rakudo cb4521: OUTPUT«YES␤»
pausenclown_ watch ur braces! =)
rakudo: my $a=3; if $a ~~ any({$_ < 2},{$_ < 6}) { say "YES"; }
p6eval rakudo cb4521: OUTPUT«YES␤» 13:34
pausenclown_ rakudo: my $a=3; if $a ~~ any({$_ < 2},{$_ > 6}) { say "YES"; }
p6eval rakudo cb4521: ( no output )
masak snarkyboojum: I still haven't paid back that technical debt with testing the Yapsi runtime...
snarkyboojum: but after that, it's time to take a bite out of immediate blocks :) 13:35
snarkyboojum masak: sounds fun
masak snarkyboojum: things like 'my $a = 42; { say $a }'
I think it will be.
snarkyboojum masak: ok
masak: so runtime.t needs filling out? 13:36
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:37
13:38 christine joined
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:38
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 13:40 alester left
moritz_ masak: nothing is there until it's parsed... that's kinda obvious, no? 13:40
masak moritz_: sure, but not what I meant. 13:41
I meant that phasers can be supplied at runtime as well.
or somewhere in between.
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?
masak or in a macro.
moritz_ well, a macro is expanded at BEGIN time
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
moritz_ yes 13:43
it's as soon as the BEGIN block/statement is parsed 13:44
masak it only says 'as soon as possible'...
that might be a bit later sometimes.
moritz_ that's as soon as possible :-)
if you talk about "a bit later", you already know it's not "as soon as possible" :-)
masak .oO( whoa, named enums are like hashes, subtypes and subs all rolled into one... )
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:45 dalek left
masak std: BEGIN { foo() }; sub foo() { say "OH HAI" } 13:46
p6eval std 30383: OUTPUT«ok 00:01 110m␤»
masak moritz_: has the 'foo' been parsed when the BEGIN block runs?
13:46 dalek joined
moritz_ masak: sure 13:46
masak the sub, I mean.
then the parse is all done.
moritz_ it first parses up to to the last closing }
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".
moritz_ it runs after the parse *of the block*
not after the parse of the compilation unit
masak oh, I see. 13:48
moritz_ BEGIN { A }; B; BEGIN { C }; D
first parses BEGIN { A };
runs A at compile time
then parses B;
then parses BEGIN {C }
runs C
parses D
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?
masak waitwait.
moritz_ Juerd: not anymore 13:50
masak moritz_: if it runs A before it parses B, how can it work in my example?
Juerd NOW { ... } ;)
masak moritz_: I mean, the sub 'foo' isn't declared until after the BEGIN block.
moritz_ masak: oh sorry, I mispared your example
masak: I thought the sub foo () { } was inside the BEGIN block
then it won't work
masak but STD.pm6 doesn't detect it? 13:51
moritz_ seems like
masak: perl 5 also dies
perl -e 'BEGIN { foo() }; sub foo { }'
Undefined subroutine &main::foo called at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
moritz_ sorry for the confusion 13:52
13:52 Guest33323 is now known as Trashlord
masak fair enuf. 13:52
13:52 Trashlord left, Trashlord joined, muixirt left
moritz_ rakudo: { foo() }; sub foo { say 3 } 13:52
p6eval rakudo cb4521: OUTPUT«3␤»
masak Rakudo works too well in this case. :)
moritz_ that only works because &foo is entered into the symbol table of the surrounding compilation unit
rakudo: BEGIN { foo() }; sub foo { say 3 }
p6eval rakudo cb4521: OUTPUT«Could not find sub &foo␤current instr.: '_block11' pc 0 (EVAL_1:9)␤»
moritz_ rakudo++
masak aha. 13:53
right; the first one had no BEGIN in it.
moritz_ note the missing "non-existent" part in the error message :-)
masak \o/ 13:54
someone++
13:55 jhuni left 13:56 pmurias left 13:57 iblechbot joined 13:59 payload joined
masak Juerd: well, NOW is not such a good name, because when 'now' is depends on when now is :) 14:00
moritz_ ASAP { ... }
masak cute :) 14:01
and END { ... } would be ALAP { ... } :)
Juerd I like ASAP :) 14:02
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 :)
huf dont just throw around "words", you dont know what language you'll hit
masak Google Translate says 'alap' means 'base' 14:04
huf yep
masak .oO( all your alap... )
moritz_ all your ALAP are...
huf :DDDD
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
Juerd Obvious is good. 14:06
And clichés exist because they're true ;)
moritz_ principle of least surprise :-)
masak :)
moritz_ but to be funny, you have to surprise people
Juerd Not necessarily
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 :)
Juerd For example, if a certain culture finds something funny unconditionally.
diakopter masak: a higher blah/comment ratio can be seen in the commits at sprixel/perlesque at csmeta.org ;) 14:10
masak oh noes! :)
here? code.google.com/p/csmeta/updates/list 14:11
I see no bla-s at all...
14:11 envi^home left
moritz_ but emty commit messages 14:11
14:11 SmokeMachine left
masak those aren't bla-s :) 14:12
the point is that actually typing 'bla bla bla' in the commit message is somehow *less* informative than putting in nothing :)
it conveys 'I know this is a commit message, but I can't be bothered". 14:13
diakopter but blank ones...?
masak those might mean any number of things. 14:14
'this commit is unworthy of a comment'
'I don't know what to type here'
'I somehow didn't realize that it was possible to leave a commit message'
moritz_ 'Others don't read my code anyway, and I myself don't really care all that much'
14:14 envi^home joined
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!'
pausenclown_ self.books[*-1]{$context.name} ??
self.books[*-1]{$context.name}.push( $text.data ) !!
self.books[*-1]{$context.name} = [ $text.data ] ;
masak pausenclown_: with proper autovivification, it should just be the second line.
pausenclown_: for now, write a sub that does it for you.
taking a hash and a key as arguments. 14:16
moritz_ given self.books[*-1] { .{$context.name} //= []; .push: $text.data }
masak er, a hash, a key, and an array element.
or what moritz_ wrote :)
moritz_ erm, forgot one .{$context.name}
pausenclown_ masak: that was my expectation but it failed in rakudo. 14:18
masak what failed? the encapsulation?
14:19 justatheory joined
pausenclown_ Method 'push' not found for invocant of class 'Proxy' 14:20
masak please nopaste the whole attempt.
14:22 alester joined 14:24 lest_away is now known as lestrrat 14:25 jonasbn left, ian__ joined, ian_ left 14:26 M_o_C joined 14:27 meppl joined
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)␤»
masak rightright, but you still need to do the trick of manually supplying the inner array *within* the method. 14:28
the thing with the encapsulation into a sub is that you only have to go through that once.
14:29 perseo22 joined
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"]␤»
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
p6eval rakudo cb4521: OUTPUT«foo␤»
pausenclown_ timtowdy =)
masak I suspect your way will give you arbitrary deep nestings of arrays. 14:34
s/arbitrary/arbitrarily/
pausenclown_ you mean | flattens nested?
rakudo: say ( | [1,[2,3]]).perl 14:35
p6eval rakudo cb4521: OUTPUT«Capture.new()␤»
pausenclown_ rakudo: say | [1,[2,3]].perl
p6eval rakudo cb4521: OUTPUT«[1, [2, 3]]␤»
masak no, I mean assigning to a variable with the @ sigil already creates one layer. [] creates another. 14:36
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
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]␤»
pausenclown_ thats it
14:41 nihiliad joined, nihiliad left, nihiliad joined
pausenclown_ i indeed forgot about the influence of the @ 14:41
masak it's insidiously easy to get double layers in different ways. 14:42
rakudo: class A { has @.b }; say A.new(:b[1,2,3]).b.perl
p6eval rakudo cb4521: OUTPUT«[[1, 2, 3]]␤»
masak that's a bug nowadays, due mostly to my extensive complaining. 14:43
14:45 Trashlord left 14:47 uniejo left, M_o_C left, synth left 14:48 synth joined
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)␤»
masak :(
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)␤»
colomon rakudo: map -> $a, $b { "$a, $b" }, (1, 2, 3, 4)
p6eval rakudo cb4521: ( no output )
colomon shouldn't let masak sidetrack him like this... 15:00
15:02 Sarten-X left 15:03 nacho left
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)␤»
masak wow, it's actually brokeneder than before the merge.
15:04 thowe left
colomon before what merge? 15:05
moritz_ ng
masak the ng one.
now it's wrong in two ways. 15:06
15:06 |Jedai| joined
masak before it was only wrong in one way. 15:06
colomon ah. 15:07
I've fixed .say for map -> $a, $b { "$a, $b" }, 1, 2, 3, 4 locally, but then map.t blows up. 15:08
15:08 Jedai left
colomon No applicable candidates found to dispatch to for 'map'. Available candidates are: 15:09
:(Mu : &block;; *%_)
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 15:13 M_o_C left
moritz_ is the sub form of map defined as 'is export' of a method? 15:13
colomon proto sub map(&mapper, *@values) { @values.map(&mapper); } 15:14
that's my hacked version
proto sub map(&mapper, @values) { @values.map(&mapper); }
is the normal one.
moritz_ doesn't the *@stuff has still problems?
colomon I don't know.
I'm sure thats why it wasn't *@stuff two months ago.
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
At any rate, the Mu thing is orthogonal to that, I think. 15:16
15:16 nacho joined
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)␤»
moritz_ rakudo: my @a = 1, 2; say @a.PARROT
p6eval rakudo cb4521: OUTPUT«Array␤»
moritz_ rakudo: sub f(*@a) { say @a.PARROT }; f(1, 2) 15:18
p6eval rakudo cb4521: OUTPUT«Array␤»
colomon didn't know .PARROT worked.
15:21 isBEKaml joined
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
moritz_ which is less sever than not working on single items, IMHO
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)␤»
moritz_ rakudo: proto sub a(@val) { say @val.perl }; a(:val<a b c>)
p6eval rakudo cb4521: OUTPUT«("a", "b", "c")␤»
colomon just undid my patch locally so I can get to $work using my Rakudo build. :)
moritz_ submits rakudobug
colomon moritz_++
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)␤»
moritz_ rakudo: sub a(*@val) { say @val.perl }; a(:val<a b c>)
rakudo: sub a(*@val) { say @val.perl }; a(:val<a b c>))
p6eval rakudo cb4521: OUTPUT«Unexpected named parameter 'val' passed␤current instr.: 'a' pc 194 (EVAL_1:78)␤»
15:25 cdarroch joined, cdarroch left, cdarroch joined
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
p6eval rakudo cb4521: OUTPUT«:(*@val)␤» 15:26
moritz_ rakudo: sub a(@val) { say @val.perl }; say &a.signature.perl
p6eval rakudo cb4521: OUTPUT«:(@val)␤»
moritz_ rakudo: sub a(@val) { say @val.perl }; a(:val<foo bar>)
p6eval rakudo cb4521: OUTPUT«("foo", "bar")␤»
pugssvn r30384 | moritz++ | [t/spec] change fudging in grep.t for rakudo 15:29
dalek kudo: 3b5a790 | moritz++ | src/core/Any-list.pm:
make the grep() arguments slurpy
15:31
masak huh :)
15:32 ruoso joined
moritz_ masak: but don't worry, I've replaced it with a new one :-) 15:32
RT #74344 15:33
masak oh phew :)
oh, that was the bug.
moritz_ wait
moritz_ just confused bug numbers
the one in the commit message is wrong :( 15:34
masak hm, yes.
moritz_ nope 15:35
7*34*44 vs 7*43*44
masak :) 15:36
rakudo: say <a b>.pick(*).perl; say (<a b>.pick(*) X <a b>.pick(*)).perl 15:39
p6eval rakudo cb4521: OUTPUT«("a", "b")␤()␤»
masak submits rakudobug
for some reason, pick(*) and X don't interoperate well.
moritz_ rakudo: say <a b>.pick(*).PARROT
p6eval rakudo cb4521: OUTPUT«GatherIterator␤»
masak GatherIterator. my nemesis. 15:40
colomon Actually, that's probably a gather / take bug
15:40 wasy joined
masak oh no. 15:40
colomon rakudo: say (<a b>.pick(*) X <a b>).perl
p6eval rakudo cb4521: OUTPUT«(("a", "a"), ("a", "b"), ("b", "a"), ("b", "b"))␤»
colomon rakudo: say (<a b>.pick(*) X <a b>).perl
p6eval rakudo cb4521: OUTPUT«(("a", "a"), ("a", "b"), ("b", "a"), ("b", "b"))␤»
masak colomon++
15:41 wasy left
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.
masak the workarounds are piling up to infinity.
colomon: so it's not really a new bug, then?
colomon nope.
masak doesn't submit 15:42
hm, but I can work around it, by doing one at a time...
moritz_ I'm sure you can add .eager to them 15:43
colomon rakudo: say (<a b>.pick(*) X <a b>.pick(*).Seq).perl
p6eval rakudo cb4521: OUTPUT«()␤»
moritz_ rakudo: say (<a b>.pick(*).eager X <a b>.pick(*).eager).perl
p6eval rakudo cb4521: OUTPUT«(("b", "a"), ("b", "b"), ("a", "a"), ("a", "b"))␤»
masak assigning one of them to an array worked !
colomon rakudo: say (<a b>.pick(*).Seq X <a b>.pick(*)).perl
p6eval rakudo cb4521: OUTPUT«(("b", "b"), ("b", "a"), ("a", "b"), ("a", "a"))␤»
masak oh, eager works too. nice.
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.
colomon masak: you might be right about that, mostly eager is my nemesis. :)
masak we all have our nemeses :) 15:45
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)␤»
masak submits rakudobug
it's not the nominal typecheck that fails, it's... the other one.
the one with the where clause, whatever it's called.
moritz_ the nonominal type check :-) 15:48
masak really? I thought "nominal" had to do with the name part, i.e. Array in this case. 15:49
and that there was another part of the type check (possibly) called something else.
moritz_ nonominal = non-nominal :-)
arnsholt masak: Has such trifling details ever stopped Perl 6? =)
moritz_ just made that up
masak oh, ah. 15:50
arnsholt Heh. I bought it =)
masak wishes for a om-nominal type check :)
s/a/an/
moritz_ procedural type check? 15:51
TimToady jnthn++ started calling it "nominal" because it's part of the longname of a multi candidate
masak moritz_: that sounds vaguely right. 15:52
TimToady and because it's pretty much limited to a named type
moritz_ at lest S05 distinguishes "procedural" and "declarative" elements
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
moritz_ rakudo: sub &foo { }; say &foo.name
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)␤»
moritz_ rakudo: sub foo { }; say &foo.name 15:54
p6eval rakudo 3b5a79: OUTPUT«foo␤»
masak rakudo: class G {}; subset A of Array where { all(|$_) ~~ G }; say [G.new, G.new, G.new] ~~ A
p6eval rakudo 3b5a79: OUTPUT«0␤»
masak :( 15:55
masak seems to be running headlong into Rakudo today
rakudo: class G {}; my @g = [G.new, G.new, G.new]; say all(|@g) ~~ G 15:57
p6eval rakudo 3b5a79: OUTPUT«0␤»
masak oh.
moritz_ @g contains an Array 15:58
masak rakudo: class G {}; my @g = G.new, G.new, G.new; say all(|@g) ~~ G
right.
p6eval rakudo 3b5a79: OUTPUT«0␤»
moritz_ rakudo: class G {}; my @g = G.new, G.new, G.new; say all(@g) ~~ G
p6eval rakudo 3b5a79: OUTPUT«0␤»
moritz_ rakudo: class G { }; say all(G.new) ~~ G
p6eval rakudo 3b5a79: OUTPUT«0␤»
moritz_ rakudo: class G { }; say G.new ~~ G 15:59
p6eval rakudo 3b5a79: OUTPUT«1␤»
masak submits rakudobug
moritz_ rakudo: class G { }; say ?(all( G.new ) ~~ G)
p6eval rakudo 3b5a79: OUTPUT«0␤»
masak rakudo: say all(42) ~~ Int
p6eval rakudo 3b5a79: OUTPUT«0␤»
masak maybe junctional smartmatching simply isn't in place yet.
moritz_ rakudo: say ('foo'&'bar').uc 16:00
p6eval rakudo 3b5a79: OUTPUT«all("FOO", "BAR")␤»
moritz_ rakudo: say ('foo'&'bar') ~~ .uc
p6eval rakudo 3b5a79: OUTPUT«0␤»
TimToady maybe the .ACCEPTS has a Mu arg?
16:01 pmurias joined
moritz_ I guess the appropriate ACCEPTS method is written in PIR still 16:01
and autothreading over routines written in PIR never worked
masak works around 16:02
dalek ok: 0732332 | moritz++ | src/subs-n-sigs.pod:
[subs] interpolating arguments and slurpy parameters
16:02 Sarten-X joined 16:03 sundar joined
TimToady rakudo: class G { }; say G.ACCEPTS(any(Int,G.new)) 16:03
p6eval rakudo 3b5a79: OUTPUT«0␤»
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)␤»
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)␤»
ruoso hmm
masak rakudo: subset Even of Int where { $_ !% 2 }; subset Fivey of Int where { $_ !% 5 }; subset Tennis of Int where Even & Fivey; say 40 ~~ Tennis
p6eval rakudo 3b5a79: OUTPUT«1␤»
masak \o/
ruoso: .can is totally b0rken as I understand it. don't use. 16:07
colomon \o/
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 :)
moritz_: at first I went for Tennish 16:09
moritz_ :-)
Teeny :-)
16:09 simcop2387 left
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)␤»
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;
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)␤»
ruoso bah
ruoso 's brain out of sync today 16:10
16:11 simcop2387 joined
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«===SORRY!===␤Undeclared name:␤ 'SmallerThan41' used at line 1␤Check failed␤FAILED 00:01 110m␤»
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␤»
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)␤»
masak submits rakudobug
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)␤»
masak it appears to be a combination of doing the nominal A check multiple times, and the &
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
ash_ so... was perl 5.12 release yesterday? 16:22
takadonet yes
moritz_ seems like
ash_ neat, perl.org still says 5.10.1 16:23
tis why i ask
CokeBot9000 search.cpan.org/dist/perl-5.12.0/ 16:24
16:24 nihiliad left
ash_ thanks, CokeBot9000++ 16:24
16:25 nihiliad joined 16:26 isBEKaml left
CokeBot9000 np. 16:26
ash_ pluggable keywords? could you define new operators with that? 16:27
masak obra++ 16:28
16:30 envi^home left
masak I finally got the pokerhand script working: gist.github.com/364800 16:33
I'm exhausted :)
will attempt to get it into the book later today. 16:34
(I need to annotate it with all the workarounds I put in, so we can remove them as the bugs get fixed)
moritz_ ash_: keyword != operator 16:35
CokeBot9000 masak: ThreeOfAKind:Trips::FourOfAKind:Quad
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
[particle] Kwad? 16:37
CokeBot9000 masak: would you like a patch for the last XXX ?
[particle]: Quad triggers a rakudo bug (parsed like Q:uad, or something)
masak++ 16:38
[particle] uggh
masak CokeBot9000: yes, please!
theater & 16:39
16:39 masak left 16:40 ash_ left 16:41 M_o_C joined
CokeBot9000 latest rakudo doesn't build for me: 16:44
Lexical '$test' not found
current instr.: 'perl6;Perl6;Grammar;is_name' pc 41059 (src/gen/perl6-grammar.pi
(that's after a git pull and a realclean)
moritz_ looks 16:45
16:52 jferrero left
moritz_ CokeBot9000: I have a local patch here, but that shouldn't change much... builds here without problems 16:53
CokeBot9000: do you have a new parrot?
CokeBot9000: iirc somebody broke some lexicals handling stuff in parrot today, and I'm still using an older parrot
CokeBot9000 ah, yes, t/op/lexicals.t is failing for me in trunk. that's probably it. 16:54
16:55 ash_ joined
dalek kudo: fb38dbf | quester++ | src/core/ (3 files):
Fix Parcel.sort and add Hash.sort.

  cloud.github.com/downloads/perl6/bo...010-04.pdf
See also: rt.perl.org/rt3/Ticket/Display.html?id=74334 Signed-off-by: Moritz Lenz [email@hidden.address]
16:58
17:13 dakkar left 17:16 pausenclown_ left 17:18 nihiliad left, am0c joined, nihiliad joined 17:21 ash_ left, chromatic joined 17:22 Trashlord joined, chromatic left
CokeBot9000 moritz_: fixed. 17:31
CokeBot9000 runs masak's script. (hurm. that's not quite right.) 17:32
moritz_ CokeBot9000++
17:32 Chillance joined
sjohnson 3hi moritz_ 17:32
oops 17:33
17:33 molaf joined 17:35 quietfanatic left
CokeBot9000 nopaste? 17:52
moritz_ see /topic
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 paste.lisp.org/display/97730 17:55
CokeBot9000 (without the update to fullhouse, /everything/ was a full house.
17:56 ggoebel joined
moritz_ phenny: tell masak about paste.lisp.org/display/97730 by CokeBot9000++ 17:57
phenny moritz_: I'll pass that on when masak is around.
18:03 stephenlb joined
CokeBot9000 moritz++ 18:05
moritz_ dammit, why can't network routing be easy? 18:06
diakopter job security? 18:07
the eternal struggle. job security vs innovation.
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
and so far I've tried three different configurations, and after some debugging I understood why each of them didn't work
but so far I'm refusing to do any internal NAT routing or masquerading 18:09
18:17 SmokeMachine joined
bkeeler So #rs is soon, yes? 18:19
18:21 SmokeMachine left
arnsholt moritz_: Why do you need a router behind the other router? 18:23
18:25 SmokeMachine joined 18:26 M_o_C left 18:27 ggoebel left, SmokeMachine left
moritz_ arnsholt: because I have no direct connection between router and PC 18:28
CokeBot9000 I heard you like routing...
moritz_ bkeeler: #rs is in 2 minutes, but due to a real life emergency I have to run off in a few minutes :( 18:29
arnsholt moritz_: You could try to get your laptop to bridge, rather than route? 18:32
Might be simpler
[particle] moritz_: do you know about www.vyatta.org/ ?
moritz_ has to run, will look at it later 18:34
18:36 SmokeMachine joined 18:39 _jaldhar_ left
mberends if anyone has anything to discuss in #rakudosketch, please join in the next few minutes 18:40
18:50 molaf left 18:52 ingy left 18:53 ingy joined 19:00 payload left 19:02 REPLeffect left 19:16 REPLeffect joined
mberends moritz_: is your emergency under control now? 19:19
moritz_ mberends: yes
ingy I have a theoretical question about versioning... 19:26
more or less theoretical
I am trying to figure out a versioning scheme for C'Dent
and realized that there is a spec version and an implementation version 19:27
at least
maybe a standard lib spec version
what does perl 6 do?
WWP6D? 19:28
19:28 sundar left 19:29 pmurias left
mberends there is a major section called Versioning in S11: perlcabal.org/syn/S11.html#Versioning 19:29
and a short term plan: github.com/rakudo/rakudo/blob/maste...oposal.pod 19:30
19:34 clintongormley left
colomon rakudo: my @a = 1...10; say @a[*-1] 19:39
p6eval rakudo fb38db: OUTPUT«10␤»
colomon word.
19:41 ShaneC1 left 19:45 ggoebel joined 19:46 sakib joined 19:55 sakib left 20:04 M_o_C joined 20:05 M_o_C left
lisppaste3 cognominal pasted "error using proto token in rakudo-nqp-rx" at paste.lisp.org/display/97741 20:11
moritz_ cognominal: proto *token* test <...> 20:13
20:14 cognominal left 20:15 cognominal joined
moritz_ proto test declares a proto sub test 20:15
cognominal thx 20:16
I guess this the wrong default in a grammar. 20:17
moritz_ it is; but changing the default in different kind of scopes would be ETOOMUCHMAGIC 20:18
cognominal now suppose I want a blank as sym in proto token, what would be the synta for that? 20:19
Is ETOOMUCHMAGIC possible in a Perl interpreter?
moritz_ :sym< > 20:20
at least I hope
it's taken as a literal, not as a regex
or you just use ' ' instead of <sym> in the body of the rule
20:26 solu joined
cognominal I am not sure, here blank has a special meaning token postfix:sym<[ ]> { 20:26
20:28 ggoebel left
colomon rakudo: my @a = 1...3; for @a, 42 { .say } 20:30
p6eval rakudo fb38db: OUTPUT«1␤2␤3␤42␤»
colomon rakudo: my @a = 1...3; (@a, 42).map( { .say } ).eager
p6eval rakudo fb38db: OUTPUT«1␤2␤3␤42␤»
spinclad :sym(' ') might work, i expect :sym< > to trim whitespace to nothing 20:34
:sym<[ ]> means :sym('[', ']'), as usual, iirc 20:35
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)␤»
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)␤»
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)␤»
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 20:47 pyrimidine joined 20:48 jjore1 is now known as jjore
solu Hey, I have a couple questions about importing modules into a Perl 6 script. 20:51
Can you import a Perl 5 module into Perl 6?
colomon not yet 20:52
solu Okay, thanks.
mberends it's being worked on over here: github.com/jnthn/blizkost
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:53
mberends Perl 6 has @*INC for the same purpose 20:54
solu so it would be: push @*INC, "new directory"?
mberends yes, inside a BEGIN { ... } block 20:55
solu okay, thanks!
mberends if you put your directories into PERL6LIB before running your program, that also adds them to @*INC
20:57 IllvilJa left 20:59 mberends left
solu hmm, still getting an error. 21:00
Can't find ./Module in @*INC in Main (src\gen_setting.pm:445) 21:01
I pushed the right directory, that's not the problem, I think. I'm using "use Module;" to import it
any idea what's wrong? 21:03
21:06 molaf joined 21:14 solu left 21:28 estrabd_ joined, estrabd_ left 21:29 estrabd joined 21:33 wknight8111 joined 21:34 pmurias joined 21:38 nacho left 21:40 snarkyboojum left 21:41 snarkyboojum joined 21:43 pausenclown joined 21:44 jaffa4 left 21:47 quietfanatic joined 21:48 iblechbot left 21:50 tri1 joined 21:53 SmokeMachine left
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)␤»
snarkyboojum I like that's related to the recent q-bug :)
rakudo: subset uad of Any; sub classify($_) { when uad {}; when uad {} }
p6eval rakudo fb38db: ( no output )
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)␤»
snarkyboojum rakudo: subset q of Any; sub classify($_) { when q {}; when q {} }
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
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)␤»
snarkyboojum rakudo: subset a of Any; sub classify($_) { when a {}; when a {} }
p6eval rakudo fb38db: ( no output )
snarkyboojum :)
22:10 pyrimidine left 22:13 alester left 22:16 rgrau joined
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)␤»
snarkyboojum rakudo: subset q of Any; when /q/ {}; 22:19
p6eval rakudo fb38db: ( no output )
snarkyboojum rakudo; subset q of Any; when q(test) {};
rakudo: subset q of Any; when q/test/ {};
p6eval rakudo fb38db: ( no output )
22:20 molaf left
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 22:28 tri1 left
oskie i wonder if rakudo will be debianized prior to or at release 22:28
ooh, it's in experimental
pmurias oskie: rakudo has loads releases 22:29
* loads of
22:32 nihiliad left
pmurias would an erlang like concurrency model make sense in Perl 6? 22:37
22:38 cdarroch left 22:44 meppl left 22:48 pmurias left 22:52 nacho left 22:55 quester_ joined 23:00 snarkyboojum left 23:02 rgrau left 23:05 snarkyboojum joined 23:08 orafu left 23:09 OuLouFu joined, OuLouFu is now known as orafu
CokeBot9000 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:12
Juerd Somewhat. 23:13
23:13 snarkyboojum left
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
Juerd That view did exist. 23:15
Nobody knows how many people actually believed it :)
diakopter ah
Juerd I have no idea if this was ever an official thing, by the way. 23:16
23:34 mariano joined 23:36 SmokeDroid joined
SmokeDroid rakudo, @a = 1, 1 ... {$^a + $^b}; @a[3].say 23:38
m6locks you need to type rakudo: to evaluate 23:39
(i guess) 23:40
rakudo: @a = 1, 1 ... {$^a + $^b}; @a[3].say
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)␤»
quester_ rakudo: <1 3 4 2>.sort({-$^a}).say 23:43
p6eval rakudo fb38db: OUTPUT«4321␤»
23:43 SmokeDroid left
quester_ :) 23:43
diakopter rakudo: my @a = 1, 1 ... {$^a + $^b}; @a[3].say 23:45
p6eval rakudo fb38db: ( no output )
23:46 stepnem left 23:52 Chillance left 23:55 nihiliad joined
lue hello 23:58