Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2013-03-10

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:11 Infamous joined #perl6
00:20 PacoAir joined #perl6
00:29 adu_ joined #perl6
00:51 [Coke] rakudo now up to 16 failures, niecza 8, pugs 2.
00:53 [Coke] (those pugs failures are sporadic)
00:56 [Coke] rakudo's new failures are in S26-documentation/09-configuration.t
01:26 timotimo i wish rosettacode had some function to give me pages that are tasks, but not in the perl6 group :|
01:27 TimToady you an unimplemented in Perl 6 page?
01:27 TimToady you mean*
01:28 TimToady there is one
01:28 TimToady http://rosettacode.org/wiki/Report​s:Tasks_not_implemented_in_Perl_6
01:28 TimToady or did you mean something else?
01:30 timotimo oooh!
01:30 timotimo that is so neat :)
01:31 timotimo oh, those are many more than i expected
01:31 timotimo "the developers thought of everything" i must say
01:34 TimToady there aren't so few of them that we have to worry much about developer collisions yet
01:36 timotimo :)
01:39 timotimo hm, opengl bindings would not be terrifically hard to make with zavolaj, i imagine ...
01:40 isomorphisms joined #perl6
01:43 timotimo i think i'll try to implement this prettily: http://rosettacode.org/wiki/Brownian_tree
01:44 diakopter bonus if you can beat TI-83 BASIC in codesize
01:47 timotimo i'll try to get a good balance of "short" and "readable". should be totally doable in perl6 ;)
01:50 timotimo hm, there seems to be quite a bit of freedom in those exercises
01:50 diakopter well, people take liberties, anyway
01:52 timotimo sure
01:54 marloshouse joined #perl6
01:57 PacoAir joined #perl6
02:02 timotimo r: my %h; %h[1][2] = 5; say %h;
02:02 p6eval rakudo 8ea992: OUTPUT«Index out of range. Is: 2, should be in 0..0␤  in method <anon> at src/gen/CORE.setting:10523␤  in  at src/gen/Metamodel.pm:2493␤  in any find_method_fallback at src/gen/Metamodel.pm:2481␤  in any find_method at src/gen/Metamodel.pm:929␤  in block  at /tmp/ScWlN0hU…
02:02 timotimo hm :|
02:03 timotimo r: my %h; %h{1}{2} = 5; say %h;
02:03 p6eval rakudo 8ea992: OUTPUT«("1" => {"2" => 5}).hash␤»
02:03 timotimo i keep forgetting this
02:04 adu_ joined #perl6
02:08 TimToady r: my @h; @h[1][2] = 5; say @h;   # just checking
02:08 p6eval rakudo 8ea992: OUTPUT«use of uninitialized value of type Any in string context  in block  at /tmp/nuwzWSmTz0:1␤␤use of uninitialized value of type Any in string context  in block  at /tmp/nuwzWSmTz0:1␤␤use of uninitialized value of type Any in string context  in block  at /tmp/nuwzWSmTz…
02:08 TimToady heh
02:10 timotimo use of uninitialized variable $s of type Any in numeric context
02:10 timotimo i do not understand why
02:10 timotimo i don't have a $s anywhere in my code ... ?!
02:11 TimToady it'll be somewhere in the setting, probably
02:11 timotimo ah, probably
02:11 adu_ joined #perl6
02:11 timotimo it seems like it comes from something like this:
02:11 timotimo r: my %h; %h{1}{2} == 5;
02:11 p6eval rakudo 8ea992: OUTPUT«use of uninitialized variable $v of type Any in numeric context  in block  at /tmp/YKysIoZaog:1␤␤»
02:12 lue is the C<==> a typo in your code?
02:12 timotimo it's in an if in my code
02:13 lue r: my %h; %h<1><2> == 5; say "I live!";
02:13 p6eval rakudo 8ea992: OUTPUT«WARNINGS:␤Useless use of "==" in expression "<2> == 5" in sink context (line 1)␤use of uninitialized variable $v of type Any in numeric context  in block  at /tmp/lMU9S30pUv:1␤␤I live!␤»
02:14 lue r: my %h; %h{1}{2} == 5; say "I live!";
02:14 p6eval rakudo 8ea992: OUTPUT«WARNINGS:␤Useless use of "==" in expression "{2} == 5" in sink context (line 1)␤use of uninitialized variable $v of type Any in numeric context  in block  at /tmp/hfIJFWoUs0:1␤␤I live!␤»
02:15 lue r: my %h; %h{1}{2} ~~ 5; say "I live!";
02:15 p6eval rakudo 8ea992: OUTPUT«use of uninitialized variable $a of type Any in numeric context  in block  at /tmp/sQa0ut8TKt:1␤␤I live!␤»
02:16 timotimo r: my ($x, $y) = 10, 20; my %W; %W{$x-1|$x|$x+1}{$y-1|$y|$y+1} = 1; say %W; # i wonder if this autothreads correctly?
02:16 p6eval rakudo 8ea992: OUTPUT«No such method 'STORE' for invocant of type 'Any'␤  in sub AUTOTHREAD_METHOD at src/gen/CORE.setting:2196␤  in  at src/gen/Metamodel.pm:2486␤  in sub AUTOTHREAD_METHOD at src/gen/CORE.setting:2196␤  in  at src/gen/Metamodel.pm:2486␤  in block  at /tmp/srvf7H_rQp:1␤…
02:16 timotimo hmm
02:16 timotimo apparently not?
02:18 timotimo r: my %h; say %h{10} :exists;
02:18 p6eval rakudo 8ea992: OUTPUT«False␤»
02:20 timotimo r: my %h; say %h<<"foo">> :exists;
02:20 p6eval rakudo 8ea992: OUTPUT«False␤»
02:20 timotimo r: my %h; my $x = 10; say %h<<$x|$x>> :exists;
02:20 p6eval rakudo 8ea992: OUTPUT«Cannot use exists adverb with a slice␤  in method postcircumfix:<{ }> at src/gen/CORE.setting:1591␤  in block  at /tmp/NGRqJZFRX0:1␤␤»
02:20 timotimo huh?
02:22 timotimo oh yeah, the first speck of thingie will take a loooong time to settle
02:24 timotimo this "redo" isn't working as i expect it... oh, oops :)
02:28 timotimo oh, yeah, this will be slooooooow
02:43 timotimo i have a version now that works and outputs ascii "art"
02:45 isBEKaml joined #perl6
02:48 arlinius joined #perl6
02:49 dayangkun joined #perl6
02:50 timotimo slowperl is slow
02:57 * timotimo tries on niecza
02:58 timotimo oh, timing the run while compiling niecza doesn't make terribly much sense
02:59 timotimo i hope i won't have to change too many things to make it run :|
03:09 timotimo changing the somewhat clever position checking code that used junctions to not using junctions makes niecza work and it's significantly faster
03:09 zacts joined #perl6
03:09 orafu joined #perl6
03:09 timotimo 3:05.30elapsed <- rakudo  |  niecza -> 0:12.30elapsed
03:09 timotimo for a 60x60 field with 500 particles
03:10 isBEKaml 3 hrs?
03:11 timotimo minutes
03:11 isBEKaml *whew* :D
03:11 timotimo ;)
03:11 timotimo i wonder if niecza will get functioning junctions?
03:12 colomon n: my $a = 5; say "Now?" if $a = 4 | 5 | 6;
03:12 timotimo niecza is in reduced development mode, right?
03:12 p6eval niecza v24-33-gfc6d5fd: OUTPUT«Now?␤»
03:13 timotimo n: my ($x, $y) = 10, 10; sub foo($a,$b) { say ($a, $b) }; foo($x-1|$x|$x+1, $y-1|$y|$y+1);
03:13 p6eval niecza v24-33-gfc6d5fd: OUTPUT«9 9␤9 10␤9 11␤10 9␤10 10␤10 11␤11 9␤11 10␤11 11␤»
03:13 timotimo oh?
03:13 colomon Right now TimToady and I make occasional minor Niecza changes to track new bits of std, and that's about it.
03:13 timotimo so it *should* in theory have worked?
03:13 colomon timotimo: I don't know what you tried to do.
03:13 colomon (I mean, more specifically than "used junctions")
03:15 timotimo while not %W{($x-1|$x|$x+1) ~ "|" ~ ($y-1|$y|$y+1)} :exists {
03:15 timotimo this was supposed to check all the neighbours of the particle for existing particles
03:15 timotimo that check never triggered
03:17 timotimo oh, indeed. this is interesting
03:17 timotimo my &ex = -> $x,$y { say "$x|$y"; say %W; %W{"$x|$y"} :exists; };  while not ex($x-1|$x|$x+1, $y-1|$y|$y+1) {  ;  this prints out any(29, 30, 31)|any(28, 29, 30) for the "$x|$y" part!
03:17 zacts is perl6 usable now for everyday projects?
03:17 timotimo so junctions work, but nested junctions don't?
03:17 colomon n: my $x = 10; my $y =11; say ($x-1|$x|$x+1) ~ "|" ~ ($y-1|$y|$y+1)
03:17 p6eval niecza v24-33-gfc6d5fd: OUTPUT«any(9, 10, 11)|any(10, 11, 12)␤»
03:18 timotimo yup, that's broken indeed
03:18 colomon r: my $x = 10; my $y =11; say ($x-1|$x|$x+1) ~ "|" ~ ($y-1|$y|$y+1)
03:18 p6eval rakudo 8ea992: OUTPUT«any(any(9|10, 9|11, 9|12), any(10|10, 10|11, 10|12), any(11|10, 11|11, 11|12))␤»
03:18 timotimo do you feel like that would be something niecza should get?
03:20 lue Where in the spec does it say that rakudo is right? At least initially I feel niecza has the right behavior
03:21 colomon timotimo: well, it seems like.  but off the top of my head I don't know that I have any clue where to look to modify such behavior
03:22 timotimo oh? huh?
03:23 timotimo "If two or more arguments are junctive, then the argument that is chosen to be "autothreaded" is:"  does that help?
03:24 colomon lue: I would think that infix:<~> is supposed to autothread.
03:24 timotimo gotta run
03:24 timotimo bbl, though
03:25 lue I also expect it to concatenate strings, not magically cause behavior similar to infix:<Z> or infix:<X>
03:28 lue r: say any(9,10,11) ~ "|" ~ any(10,11,12)
03:28 p6eval rakudo 8ea992: OUTPUT«any(any(9|10, 9|11, 9|12), any(10|10, 10|11, 10|12), any(11|10, 11|11, 11|12))␤»
03:29 Rix joined #perl6
03:30 isBEKaml` joined #perl6
03:31 timotimo but junctions are magic
03:31 lue r: say any(9,10,11) | any(10,11,12)
03:31 p6eval rakudo 8ea992: OUTPUT«any(any(9, 10, 11), any(10, 11, 12))␤»
03:31 colomon I've got to say I'm not at all sure I understand nested anys.
03:31 timotimo so why should tilde magically override the magic of junctions?
03:32 lue AFAIK, infix:<~> means string concatenation. I fail to see why this magic happens (but if there's a good reason for it, I won't complain)
03:33 timotimo if a junction is used as an argument to any routine (operator, closure, method, etc.), and the scalar parameter you are attempting to bind the argument to is inconsistent with the Junction type, that routine is "autothreaded",
03:34 timotimo in particular a strong is inconsistent with the junction type
03:34 lue r: say (1|2|3).Str
03:34 p6eval rakudo 8ea992: OUTPUT«any(1, 2, 3)␤»
03:34 lue wait, so infix:<~> doesn't coerce to Str?
03:34 colomon nr: say (1|2|3|) ~ "hello"
03:34 p6eval niecza v24-33-gfc6d5fd: OUTPUT«[31m===[0mSORRY![3​1m===[0m��Bogus term at /tmp/DGAnIT3ZNi line 1:�------> [32msay (1|2|3|[33m�[31m) ~ "hello"[0m��Parse failed��»
03:34 p6eval ..rakudo 8ea992: OUTPUT«[31m===[0mSORRY![31m===[0m�Bogus statement�at /tmp/y4ytKNausK:1�------> [32msay (1|2|3|[33m�[31m) ~ "hello"[0m�    expecting any of:�        postfix�        infix stopper�        infix or meta-infix�        prefix or term�        prefix or meta-prefix�»…
03:35 colomon nr: say (1|2|3) ~ "hello"
03:35 p6eval rakudo 8ea992: OUTPUT«any(1hello, 2hello, 3hello)␤»
03:35 p6eval ..niecza v24-33-gfc6d5fd: OUTPUT«Use of uninitialized value in string context␤  at /home/p6eval/niecza/lib/CORE.setting line 1342 (warn @ 5) ␤  at /home/p6eval/niecza/lib/CORE.setting line 266 (Mu.Str @ 15) ␤  at <unknown> line 0 (ExitRunloop @ 0) ␤  at /home/p6eval/niecza/lib/CORE.settin…
03:35 timotimo this is the string coercion called on each own item
03:35 colomon nr: say (1|2|3) + 3
03:35 p6eval rakudo 8ea992, niecza v24-33-gfc6d5fd: OUTPUT«any(4, 5, 6)␤»
03:36 colomon hmmm... works on infix:<+> but not infix:<~>?  (in niecza)
03:36 timotimo junction does not drive from any
03:36 timotimo it is a sibling to any
03:37 timotimo that should be why it ought to auto thread
03:38 timotimo colomon, do you think sorear would agree to fix this?
03:38 colomon timotimo: no idae.
03:39 colomon n: say any(9,10,11) + any(9,10,11)
03:39 p6eval niecza v24-33-gfc6d5fd: OUTPUT«any(any(18, 19, 20), any(19, 20, 21), any(20, 21, 22))␤»
03:39 lue r: say any(9,10,11) ~ "»ö«" ~ any(10,11,12)
03:39 p6eval rakudo 8ea992: OUTPUT«any(any(9»ö«10, 9»ö«11, 9»ö«12), any(10»ö«10, 10»ö«11, 10»ö«12), any(11»ö«10, 11»ö«11, 11»ö«12))␤»
03:39 colomon timotimo: may be that I can fix it, if it's specific to infix:<~>
03:40 adu_ joined #perl6
03:40 lue timotimo: I think I see now. (Still trying to grok the nested any's though). I think your use of "|" (which is also a junction op) is what confused me and made think a bug was afoot :)
03:43 timotimo oh, maybe a , would have been more idiomatic
03:47 timotimo i think nested anys are not too bad
03:47 timotimo i mean this is mostly about evaluating as booleans
03:48 timotimo so evaluate a nested any by evaluating all of the inner anys and see if any of then are true
03:48 timotimo same way you run functions with then
03:48 lue I think thinking of Junctions as a weird type of array that causes ~ to act like X~ will help for now :)
03:50 telex joined #perl6
03:53 xinming joined #perl6
03:59 timotimo :)
04:02 timotimo rn: say substr("camel", 0|1, 2&3);
04:02 p6eval niecza v24-33-gfc6d5fd: OUTPUT«all(any("ca", "am"), any("cam", "ame"))␤»
04:02 p6eval ..rakudo 8ea992: OUTPUT«any(all(ca, cam), all(am, ame))␤»
04:03 timotimo now *that* is interesting
04:03 timotimo in this case, the specs say that rakudo is in the wrong and niecza is in the right
04:03 TimToady right
04:04 timotimo also, i managed to make niecza work correctly like this:
04:04 TimToady no wait
04:04 timotimo rn: my %W; %W<10|10>; my ($x, $y) = 11, 11; my &ex = -> Cool $x, Cool $y { say "$x|$y"; say %W; %W{"$x|$y"} :exists; }; while not ex($x-1|$x|$x+1, $y-1|$y|$y+1) { say "bup" }
04:05 TimToady I think rakudo has it right
04:05 TimToady you resolve the left first
04:05 p6eval rakudo 8ea992: OUTPUT«(timeout)10|10␤().hash␤10|11␤().hash​␤10|12␤().hash␤11|10␤().hash␤11|11␤().​hash␤11|12␤().hash␤12|10␤().hash␤12|11â​¤().hash␤12|12␤().hash␤bup␤10|10␤().hash​␤10|11␤().hash␤10|12␤().hash␤11|10␤().​hash␤11|11␤().hash␤11|12␤().hash␤12|10â​¤().hash␤12|11␤().hash␤12|12␤().hash␤…
04:05 p6eval ..niecza v24-33-gfc6d5fd: OUTPUT«(timeout)10|10␤{}␤10|11␤{}␤10|1​2␤{}␤11|10␤{}␤11|11␤{}␤11|12␤{}â​¤12|10␤{}␤12|11␤{}␤12|12␤{}␤bup␤1​0|10␤{}␤10|11␤{}␤10|12␤{}␤11|10␤{​}␤11|11␤{}␤11|12␤{}␤12|10␤{}␤12|1​1␤{}␤12|12␤{}␤bup␤10|10␤{}␤10|11â​¤{}␤10|12␤{}␤11|10␤{}␤11|11␤{}␤1​1|12␤{}␤12|10␤{}␤12|11␤{}␤12|12…
04:05 timotimo oops, there's a say too much
04:05 TimToady so you should get substr("camel", 0, 2&3) as the first resolution
04:05 timotimo but you see how it says 10|11 and such?
04:06 diakopter please watch; decide to laugh for yourself: http://www.liveleak.com/view?i=df8_1362850413
04:06 timotimo http://perlcabal.org/syn/S09.html#Junctions - i took the example from here
04:07 TimToady oh, yes, by that niecza is righter
04:08 TimToady I'd forgotten that TheDamian defined them that way
04:08 timotimo rn: my %W; %W<10|10>; my ($x, $y) = 11, 11; my &ex = -> Cool $x, Cool $y { say "$x,$y" %W{"$x|$y"} :exists; }; while not ex($x-1|$x|$x+1, $y-1|$y|$y+1) { say "bup" }
04:08 p6eval rakudo 8ea992: OUTPUT«[31m===[0mSORRY![​31m===[0m�Undeclared name:�    W used at line 1��»
04:08 p6eval ..niecza v24-33-gfc6d5fd: OUTPUT«[31m===[0mSORRY![31m​===[0m��Undeclared name:�        'W' used at line 1��Unhandled exception: Check failed��  at /home/p6eval/niecza/boot/lib/CORE.setting line 1443 (die @ 5) �  at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 37) �  at /home/p6ev…
04:08 timotimo rn: my %W; %W<10|10>; my ($x, $y) = 11, 11; my &ex = -> $x, $y { say "$x,$y"; %W{"$x|$y"} :exists; }; while not ex($x-1|$x|$x+1, $y-1|$y|$y+1) { say "bup" }
04:08 timotimo that's what i meant to write.
04:08 colomon TimToady: any idea why niecza's infix:<~> takes an arbitrary number of arguments?
04:08 timotimo see how niecza now passes the inner junctions into $x and $y and they are then not autothreaded
04:08 p6eval niecza v24-33-gfc6d5fd: OUTPUT«(timeout)any(10, 11, 12),any(10, 11, 12)␤bup␤any(10, 11, 12),any(10, 11, 12)␤bup␤any(10, 11, 12),any(10, 11, 12)␤bup␤any(10, 11, 12),any(10, 11, 12)␤bup␤any(10, 11, 12),any(10, 11, 12)␤bup␤any(10, 11, 12),any(10, 11, 12)␤bup␤any(10, 11, 12),any(10, 11, 12)…
04:08 p6eval ..rakudo 8ea992: OUTPUT«(timeout)any(10, 11, 12),any(10, 11, 12)␤bup␤any(10, 11, 12),any(10, 11, 12)␤bup␤any(10, 11, 12),any(10, 11, 12)␤bup␤any(10, 11, 12),any(10, 11, 12)␤bup␤any(10, 11, 12),any(10, 11, 12)␤bup␤any(10, 11, 12),any(10, 11, 12)␤bup␤any(10, 11, 12),any(10, 11, 12)␤bup␤any(…
04:09 TimToady timotimo++ for actually reading the spec :)
04:09 timotimo er, wait, what?
04:09 timotimo rakudo show sthe same behavior? now i am thoroughly surprised.
04:09 timotimo maybe parameters to pointy blocks are Mu by default
04:10 timotimo rn: say (-> $x, $y { say $x, $y }).signature
04:10 p6eval rakudo 8ea992: OUTPUT«:(Mu $x, Mu $y)␤»
04:10 p6eval ..niecza v24-33-gfc6d5fd: OUTPUT«Unhandled exception: Nominal type check failed in binding '' in 'ClassHOW.name'; got Mu, needed Any␤  at /home/p6eval/niecza/lib/CORE.setting line 0 (ClassHOW.name @ 1) ␤  at /home/p6eval/niecza/lib/CORE.setting line 1193 (Parameter.perl @ 9) ␤  at /home/p…
04:10 timotimo ah, indeed!
04:10 TimToady colomon: ~ is list associative
04:11 colomon TimToady: ah
04:12 colomon r: say (1|2|3) ~ (10|11|12) ~ (21|22|23)
04:12 p6eval rakudo 8ea992: OUTPUT«any(any(any(11021, 11022, 11023), any(11121, 11122, 11123), any(11221, 11222, 11223)), any(any(21021, 21022, 21023), any(21121, 21122, 21123), any(21221, 21222, 21223)), any(any(31021, 31022, 31023), any(31121, 31122, 31123), any(31221, 31222, 31223)))␤»
04:13 timotimo diakopter: the translation must be made up
04:13 timotimo i cannot explain it any other way
04:13 diakopter I strongly believe the translation is true
04:14 timotimo in that case, that's ridiculous
04:14 timotimo anyway, i'll go get my almost-daily cup of hot snow
04:15 diakopter that a country would give such ludicrous propaganda to its prisoners/victims?
04:16 diakopter mmm tasty snow
04:17 timotimo do they expect the people will believe this? or is this a kind of "throw feces enough and something will stick" situation?
04:18 diakopter likely most of them don't have any evidence to the contrary, so why not believe it
04:18 timotimo hmm, probably true
04:41 timotimo i may just be tired, but i couldn't find any tests that ensure that multiple junctions in the same function call actually work like the spec says
04:52 preflex_ joined #perl6
05:05 census joined #perl6
05:19 SamuraiJack joined #perl6
05:20 adu joined #perl6
05:35 adu joined #perl6
05:36 adu joined #perl6
06:34 adu joined #perl6
06:46 am0c joined #perl6
07:02 raiph joined #perl6
07:13 kaare__ joined #perl6
07:15 wk joined #perl6
07:20 jaldhar_ joined #perl6
07:26 xinming joined #perl6
07:34 FROGGS joined #perl6
07:38 jaldhar_ joined #perl6
07:39 SamuraiJack joined #perl6
08:19 Myk267 joined #perl6
08:23 Myk267 left #perl6
09:07 SamuraiJack_ joined #perl6
09:23 _ilbot joined #perl6
09:23 Topic for #perl6 is now »ö« Welcome to Perl 6! | http://perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: http://irc.perl6.org/ | UTF-8 is our friend!
09:24 kst joined #perl6
09:32 Khisanth joined #perl6
09:44 spider-mario joined #perl6
09:51 DarthGandalf joined #perl6
09:57 masak good antenoon, #perl6
09:57 FROGGS hi masak
10:01 masak <zacts> is perl6 usable now for everyday projects?
10:01 masak this went unanswered in the backlog.
10:07 diakopter masak: HI
10:07 diakopter masak: zacts is still logged in, just not on this channel :)
10:08 masak also, I had no idea America was in such a bad place.
10:08 masak good thing that the trees are still full of snow to heat.
10:10 jac50 joined #perl6
10:10 sorear are you referring to the storm system on the other side?
10:11 masak I'm referring to http://irclog.perlgeek.de/​perl6/2013-03-10#i_6570639
10:11 masak seriously, the North Korean who put that together seems to have an unhealthy fixation with heating snow.
10:12 masak s/with/on/
10:12 diakopter masak: yes, it's terrible.
10:12 diakopter there are some classic lines in there
10:12 masak "They will be eaten on Tuesday." being one of them? :)
10:12 diakopter truly poetic
10:13 sorear heating snow?  is that what they use in the DPRK because they can't afford coal?
10:14 diakopter sorear: watch the video to join the in-joke :)
10:14 diakopter it's short.
10:15 masak there's a parallel here to language communities, I guess. somewhere out there I bet there's a community going "yo, we've got features coming out the wazoo an' all the other languages have feature envy, or should" while all the rest of the communities go "dudes, you haven't even stabilized your I/O spec yet"
10:15 diakopter it's so absurd it's difficult to distinguish from parody
10:15 jnthn "The other parts of America, often disguised as foreign countries in Europe..."
10:15 masak :P
10:16 masak oh, *that's* what he said.
10:16 masak imagine the work that must have gone into suspending disbelief *prior* to this video.
10:16 masak that's almost more scary.
10:16 FROGGS they are yummi >.<
10:16 FROGGS *g*
10:17 FROGGS hehe
10:17 jnthn "These telephones no longer work. There is noone to call"
10:17 masak FROGGS: yeah, but there's only one cup of hot snow per person per day.
10:17 FROGGS ya, hehe
10:17 diakopter jnthn: ROTFL.
10:17 masak at least the poor Americans get cake in the end by the kindly North Koreans.
10:19 * masak realizes that a single episode of "Friends" would put the whole video into question
10:20 huf 6 idle rich landowners having fun in a cafe all day?
10:20 FROGGS masak: but "friends" is just made up
10:21 * FROGGS makes more hot snow
10:21 * diakopter makes yellow snow
10:21 FROGGS O.o
10:21 FROGGS eeeeks
10:22 masak huf: oh, true. death to the bourgeoisie.
10:22 diakopter ownership is overrated
10:22 masak there's probably even enough bums in the series to still make the hot-snow video credible.
10:23 diakopter also Seinfeld
10:23 huf masak: now you're talking! :)
10:23 masak and Phoebe used to live in a cardboard box.
10:23 huf masak: that's just her being excentric
10:23 huf the rich have strange tastes
10:24 sorear .oO( the moon of Saturn? )
10:24 sorear most commonly spelled 'eccentric' around here
10:24 masak yes, that's the spelling, everywhere :)
10:25 huf huh. my dict lied to me then.
10:25 masak oh, br "excentric".
10:25 masak my bad :)
10:25 diakopter reminds me of execrable
10:26 masak that word seems to be trending on Twitter recently.
10:30 diakopter anyone here have access to springerlink?
10:32 FROGGS hmmm, it answeres the question as well if I dont know what it is, I guees  :/
10:33 fhelmberger joined #perl6
10:34 masak clearly it has something to do with knights :)
10:34 masak or links to knights.
10:34 masak or left of knights.
10:35 FROGGS or about somebody who is bad to knights
10:35 arnsholt diakopter: Via my university, yeah
10:42 masak rn: say 0 ** 0
10:42 p6eval rakudo 8ea992, niecza v24-33-gfc6d5fd: OUTPUT«1␤»
10:46 huf joined #perl6
11:01 grondilu about the new List permutation method:  why is it not a Positional method?
11:02 grondilu (so that one can get it when implementing Positional)
11:02 jnthn Generally, .foo => .list.foo delegators live in Any
11:04 masak it's not really "feature envy", it's more like "feature skew".
11:05 jnthn urks
11:06 jnthn NQP has support for BUILD. However, since there are no submethods in NQP, one BUILD is seen for all subclasses.
11:06 jnthn Which is why the dupe SC registrations...
11:06 masak :(
11:06 masak maybe make it a sub?
11:07 jnthn Just gonna make BUILDPLAN only look for methods in exactly that class.
11:08 masak *nod*
11:08 jnthn Bug exists in NQP on Parrot too, it just doesn't detect dupe SC registration for some reason.
11:08 crab2313 joined #perl6
11:08 jnthn Guess I musta just forgot to add the check...
11:11 arnsholt One of the benefits of multiple backends
11:17 * masak .oO( port to another platform! you'll find bugs, we promise! )
11:18 isBEKaml joined #perl6
11:19 dalek nqp: e408df4 | jnthn++ | src/how/NQPClassHOW.pm:
11:19 dalek nqp: Lookup of BUILD shouldn't see inherited ones.
11:19 dalek nqp:
11:19 dalek nqp: Doing it this way since NQP has no submethods.
11:19 dalek nqp: review: https://github.com/perl6/nqp/commit/e408df46fe
11:20 dalek nqp-jvm-prep: ecd78f9 | jnthn++ | nqp-src/nqp-mo.pm:
11:20 dalek nqp-jvm-prep: Get BUILD fix.
11:20 dalek nqp-jvm-prep: review: https://github.com/jnthn/nqp​-jvm-prep/commit/ecd78f924f
11:23 Ulti diakopter: I have access to springer link afaik
11:36 isBEKaml OHHAI, #perl6!
11:39 masak o/
11:41 isBEKaml masak: You should vacation more often. Your bug-finding-productivity shot up in the first week! :P
11:45 not_gerd joined #perl6
11:45 not_gerd o/
11:46 wk joined #perl6
11:48 masak isBEKaml: I know! and yes, I *should* vacation more often! :P
11:49 * masak gets on a train
12:00 woosley1 joined #perl6
12:22 masak teaching Perl for two days :)
12:23 spider-mario :)
12:25 masak "Let's not forget the things that are good about Perl. It's good at interacting with other programs, and it's good for rapid prototyping. Let's not hassle people when they use Perl the way it was designed to be used." -- http://perl.plover.com/yak/​12views/samples/notes.html
12:26 isBEKaml that's MJD, right?
12:27 masak yes.
12:27 masak MJD++
12:27 isBEKaml ah, yes - I liked his HOP book. :)
12:30 SunilJoshi joined #perl6
12:31 masak the whole of Talk 4 can be obsoleted with one word nowadays: Moose.
12:35 tadzik hmm, there's nothing like AttributeHOW in the metamodel, is there?
12:36 masak "I went back to the original Christopher Alexander books and found out why: pattern languages are a brilliant idea and Alexander's books about them are works of genius." -- wow. I really should do this.
12:37 isBEKaml masak: yeah, Cristopher Alexander is referred to in books on Design Patterns as well. It's been on my list for a /long/ time. :(
12:38 isBEKaml (of books to read)
12:39 tadzik ph<TAB><TAB>
12:39 tadzik phenny, oh, where are you now :(
12:39 tadzik anyway, I added http://rosettacode.org/wiki/Documentation#Perl_6 just now :)
12:39 * not_gerd just fixed sockets
12:39 not_gerd now, if only someone would take on http://irclog.perlgeek.de/​perl6/2013-03-09#i_6569852
12:41 masak tadzik: s/as it happened in Perl 5/as in Perl 5/
12:41 masak Perl 5 is not gone, and Perl 6 is not replacing it ;)
12:41 tadzik ohh, I really wrote that? :D
12:42 tadzik fixed, thanks
12:46 bowtie joined #perl6
12:46 cognominal joined #perl6
12:58 jnthn tadzik: Tehre's not an attributeHOW, thething is just called Attribute :)
13:04 SunilJoshi joined #perl6
13:26 masak rn: say pick 1..5
13:26 p6eval rakudo 8ea992: OUTPUT«Nil␤»
13:26 p6eval ..niecza v24-33-gfc6d5fd: OUTPUT«␤»
13:28 colomon rn: say (1..5).pick
13:28 p6eval rakudo 8ea992, niecza v24-33-gfc6d5fd: OUTPUT«2␤»
13:29 tadzik jnthn: yeah, I noticed I still haven't fixed WHY there
13:29 tadzik it does not segfault now, but the test fails
13:29 tadzik also: anyone willing to share a cheap room for YAPC::EU?
13:34 grondilu tadzik: shouldn't you have used #| instead of #= at the beginning of blocks?
13:35 * grondilu talks about http://rosettacode.org/wiki/Documentation#Perl_6
13:35 cognominal joined #perl6
13:35 PacoAir joined #perl6
13:35 tadzik grondilu: not if I'm talking about working examples :>
13:35 grondilu oh, ok
13:36 tadzik I still haven't stopped feeling uneasy about #| :)
13:36 tadzik is it spec already?
13:36 grondilu yeah, it has been for quite a long time, hasn't it?
13:41 tadzik heh, maybe
13:46 census joined #perl6
14:02 masak "The only thing more amazing than the degree to which the author missed the point of the exercise here is the degree to which he seems unaware that he missed the point of the exercise." :D
14:08 jlaire joined #perl6
14:09 masak "After reading a lot of articles, I discovered that different people had at least eight different notions of what 'strongly typed language' meant. " -- I *knew* it!
14:17 census joined #perl6
14:19 REPLeffect joined #perl6
14:21 FROGGS tadzik: http://rosettacode.org/wiki/Documentation#Perl_6 # say say?
14:22 Psyche^ joined #perl6
14:24 masak rn: sub x { return for 1 }; x; say "alive"
14:24 p6eval rakudo 8ea992: OUTPUT«Attempt to return outside of any Routine␤  in block  at src/gen/CORE.setting:489␤  in block  at /tmp/__4yt4NbsM:1␤␤»
14:24 p6eval ..niecza v24-33-gfc6d5fd: OUTPUT«alive␤»
14:24 masak rakudo, what in all the...
14:25 * masak refuses to swear very loudly, to avoid a long discussion with jnthn about the excellent stability of Rakudo in 2013 :( :( :(
14:25 domidumont joined #perl6
14:25 * masak submits a rakudobug
14:26 FROGGS rn: sub x { return 2 for 1 }; my $three = x; say "alive"
14:26 p6eval rakudo 8ea992: OUTPUT«alive␤»
14:26 p6eval ..niecza v24-33-gfc6d5fd: OUTPUT«Potential difficulties:�  $three is declared but not used at /tmp/VrWBbBK_BI line 1:�------> [32msub x { return 2 for 1 }; my [33m�[31m$three = x; say "alive"[0m��alive�»
14:26 FROGGS masak: so it's sink context?
14:27 masak good catch. yes, must be.
14:27 FROGGS new features always come with new bugs bundled :o)
14:27 masak the RT ticket will not contain any bile against Rakudo, by the way.
14:27 masak I vent here, not on RT.
14:29 masak rn: sub x { return }; x; say "alive"
14:29 p6eval rakudo 8ea992, niecza v24-33-gfc6d5fd: OUTPUT«alive␤»
14:30 cognominal joined #perl6
14:30 FROGGS might be good to assign it to moritz
14:30 masak feel free.
14:32 masak r: sub x { return 5 for 1 }; say x
14:32 p6eval rakudo 8ea992: OUTPUT«Attempt to return outside of any Routine␤  in block  at src/gen/CORE.setting:489␤  in block  at /tmp/QZnjtHvdjL:1␤␤»
14:32 masak no, it's not sink context.
14:33 * masak adds to the ticket
14:33 FROGGS hmmmm
14:33 tadzik FROGGS: whoops whoops
14:33 FROGGS tadzik: :o)
14:34 tadzik fixed, thanks :)
14:35 masak should I unassign moritz? :)
14:36 masak better not. something tells me that even if this isn't directly related to sink context, maybe it's indirectly related.
14:38 mtk joined #perl6
14:38 * masak decides to do a bisect
14:38 FROGGS nom: sub x { return 5 for 1 }; say x
14:38 p6eval rakudo 8ea992: OUTPUT«Attempt to return outside of any Routine␤  in block  at src/gen/CORE.setting:489␤  in block  at /tmp/sZuHsqRSJK:1␤␤»
14:39 FROGGS masak++
14:39 masak using a while loop is a decent workaround, by the way.
14:43 not_gerd joined #perl6
14:43 not_gerd r: sub x { sink return 5 for 1 }; say x
14:43 p6eval rakudo 8ea992: OUTPUT«5␤»
14:44 not_gerd looks like sink context to me
14:44 pmurias joined #perl6
14:44 pmurias jnthn: hi
14:44 not_gerd I believe it's caused by the fact that rakudo doesn't do lexotic binding of the return to the sub
14:44 not_gerd that's bitten me with gather/take as well
14:45 * masak adds this to the ticket
14:45 pmurias jnthn: what would be the best way to compile a single file to both javascript and pir (under the new backend seperation scheme)
14:47 jnthn sub x { return for 1 }; x; say "alive"
14:47 jnthn So, the for is really a map and it's not in sink context.
14:48 jnthn So the return executes afterwards.
14:48 not_gerd lexotic return should probably force sink context
14:48 jnthn ...what?
14:49 jnthn After Rakudo got sink context and people discovered these things, something got spec'd to the degree it should tell you about this.
14:49 not_gerd if I understand this lexotic stuff correctly, if things like take or return are lexically surrounded by stuff that catches them (gather/sub), they should bind to that
14:49 jnthn As for whining about stability, well, it's easy to be stable if we ignore the spec.
14:50 not_gerd if the return is inside a lazy map, that probably requires making it eager
14:50 masak I am whining. I think this sucks.
14:50 jnthn Then go whine about the spec.
14:50 masak yes.
14:51 masak maybe I simply really dislike this type of unexpected laziness.
14:51 masak clearly, *clearly* it was not my intent as a programmer, to return outside of the routine! arrrgh!
14:51 jnthn masak: https://github.com/perl6/specs/commit/e​5b8663594b0c747aabefa8dd4273508ca9d220a
14:52 jnthn That's the bit added in response to pepole running into the thing you mentioned.
14:52 jnthn Especially the last paragraph.
14:52 not_gerd jnthn: see S04 - return is lexotic and should target the sub it's lexically surrounded by
14:53 jnthn not_gerd: BUT WE ALREADY LEFT THAT SUB.
14:53 masak "...which may surprise some people." -- YA THINK!?
14:53 not_gerd jnthn: that's why I think it needs to force eager evaluation of the map
14:54 masak I swear, I was just idly building my program, and suddenly the for loop was last in the routine.
14:54 masak it was literally a "hey, I can move this return inside of the for loop" moment.
14:54 * masak glares on the spec
14:54 not_gerd lexoticity and least surprise > laziness
14:55 pmurias combining laziness and side effects can be expected to lead to craziness ;)
14:56 masak rn: sub x { return 5 for 1; return "ahahaha *sob" }; say x; say "alive"
14:56 p6eval rakudo 8ea992, niecza v24-33-gfc6d5fd: OUTPUT«5␤alive␤»
14:57 * masak adds "always put an unnecessary 'return' after the last 'for' in a routine" to his list of best Perl 6 practices
14:58 not_gerd personally, I'd just make for eager by default
14:58 not_gerd but what do I know ;)
14:59 masak yes, I expect for loops to be eager.
15:00 masak and it doesn't seem to be just TimToady who likes to indulge in the notion that 'for' and 'map' are exactly synonymous.
15:01 masak but when a DWIM feature turns a simple refactor into a WAT, clearly something is wrong.
15:01 pmurias how is for being lazy a DWIM feature?
15:02 woosley1 left #perl6
15:03 jnthn Note that a for loop as the last statemnet of a block, even if you were to evaluate it eagerly rather than sinkily, will build up a list of results, which is potentially just going to be thrown away.
15:03 masak the DWIM in this case is "you get laziness for free, no extra typing needed!"
15:04 jnthn You could get rid of the whole issue by saying that for never produces anything, just Nil
15:04 masak +1
15:04 jnthn Except then you can't use for the write list comprehensions.
15:04 jnthn *to
15:04 jnthn Or do for
15:05 masak for some reason I'm fine with statement_mod for yielding results.
15:05 masak but for the block form to do it feels wasteful and weird.
15:07 jnthn Anyway, I'm tired of this whole topic. Rakudo is currently closest to the current spec. If the spec on this changes, I'll be happy to work on changing things to be in line with the updates. In the meantime, the ticket just wants to say that Rakudo shoulda warned (as per current spec) and needs to implement the --> Nil thing.
15:08 masak thank you for your time. sorry about being grouchy when things break my code.
15:08 woolfy joined #perl6
15:08 am0c joined #perl6
15:11 jnthn not_gerd: Does the fix for #942 risk utf-8 chunks getting split, or is that handled further up?
15:11 timotimo jnthn: the qregex test asks for the QRegex::P6Regex compiler; there's a NQPP6QRegexJVM.class, but i can't quite figure out what exactly i have to getcomp to make that work :| i've put use NQPP6QRegex at the top and have tried lots of different combinations of the parts for the getcomp, but none have worked so far
15:12 jnthn timotimo: I believe it's registered under the same name
15:12 timotimo oh, ok
15:12 jnthn not_gerd: I'm guessing it's just at bytes at this level, so probably it's OK..
15:12 timotimo doesn't seem so. at least i'm still getting null pointer exceptions which seem to come from the getcomp returning null or nil or something
15:13 not_gerd jnthn: I don't *think* so - if I recall correctly, we do a partial decode and determine the bounds from that
15:13 timotimo scratch that, that wasn't actually correct.
15:13 not_gerd (bounds of valid data  in buffer, that is)
15:13 jnthn not_gerd: OK
15:14 jnthn not_gerd: Once that gets into Parrot then it's probably worth doing a version bump and seeing if it helps.
15:14 timotimo in fact, my $match  := $rxsub($cursor).MATCH; seems to be the line that causes the NPE
15:14 jnthn timotimo: Hmm.
15:14 timotimo so maybe it's the compilation step that failed, because that woul dhave set $rxsub? or maybe the cursor isn't right ...
15:14 not_gerd jnthn: it does fix HTTP::Easy for me
15:15 not_gerd but see the XXX in the rakudo patch
15:15 not_gerd the problem is that Parrot's readline does not guarantee to actually read a line for sockets
15:15 timotimo uh, i added a debug say statement and now the tests run (and fail) ... ?!
15:15 not_gerd imo that's a problem with parrot and should be fixed there
15:16 not_gerd however, as whiteknight actually implemented logic to break out of the loop that reads the data, I'm not confident I'm aware of all the issues involved
15:17 jnthn timotimo: I'm wondering if the bug is the same NPE as trying to run 49-regex-interpolation.t gives
15:18 jnthn timotimo: Does the error you see mention islist anywhere?
15:18 snuffles joined #perl6
15:19 timotimo nope, just lots and lots of invoke and invokeInternal
15:20 jnthn hmm
15:21 timotimo when you said it's registered under the same name, you did mean to tell me to run "getcomp('QRegex::P6Regex'), right?
15:22 FROGGS jnthn: when I get a Regex passed to INTERPOLATE, its .NFA gives me an RPMCA of RPMCAs of integers, is that right?
15:23 jnthn timotimo: Yeah
15:23 timotimo how do i safely figure out if the things like $rxsub and $cursor have sane contents?
15:23 jnthn timotimo: You can see it being registered under that name at the bottom of NQPP6Qregex.pm
15:23 jnthn Just checked that bit
15:24 jnthn Well, can do $obj.HOW.name($obj) to check they're the expected kind of thing
15:24 jnthn FROGGS: Yes.
15:24 timotimo mhm
15:24 jnthn FROGGS: That's a thing you can pass into merge_substates
15:25 FROGGS jnthn: really? in the other case I pass QAST::Regexes
15:25 jnthn FROGGS: No, those are passed to add_node, iirc
15:26 jnthn timotimo: Something odd...islist does a null check...
15:27 FROGGS jnthn: ahh right, I passed the ints to add_node too, my fault
15:27 jnthn timotimo: hm, huh...a CodeRef with a null STable...
15:27 jnthn FROGGS: Ah, that explains it ;)
15:28 timotimo say($rxsub.HOW.name($rxsub));  -  gives me a null pointer exception
15:29 FROGGS hmmmm, I think I should write a cronjob that saves `git diffs` of nqp and rakudo every ten minutes
15:30 jnthn timotimo: Yeah, same underlying issue.
15:30 jnthn timotimo: Think I'm getting clsoe on it...
15:30 pmurias spec discussion aside, it's the error message for return called from outside the routine less than awesome?
15:30 timotimo neat :)
15:32 masak pmurias: no, I think it's fine. what surprises me is that an ordinary return in an ordinary for loops can fail in the first place.
15:33 masak I understand the reason that it does, too. it has to do with iterators and laziness.
15:33 jnthn timotimo: Oh, hm.
15:34 jnthn timotimo: Seems that the actual issue is that an internals-y compilation unit object is leaking out where an invokable thingy is expected.
15:35 timotimo whoops, okay
15:39 sqirrel joined #perl6
15:40 FROGGS jnthn: cool, so nfa is working now for literals and Regexes. What should I do with assertions? do I have to make a regex to get its NFA or should I do something else?
15:41 jnthn FROGGS: Not sure what you mean...example?
15:43 ruoso joined #perl6
15:43 FROGGS rn: say "aaaaaaaaaaab" ~~ /<"a+b">+/
15:43 p6eval rakudo 8ea992: OUTPUT«[31m===[0mSORRY![3​1m===[0m�Unrecognized regex metacharacter < (must be quoted to match literally)�at /tmp/LWE1tVBTMm:1�------> [32msay "aaaaaaaaaaab" ~~ /<[33m�[31m"a+b">+/[0m�Unrecognized regex metacharacter " (must be quoted to match literally)�at /tmp/LW…
15:43 p6eval ..niecza v24-33-gfc6d5fd: OUTPUT«[31m===[0mSORRY![31m=​==[0m��Unrecognized regex assertion at /tmp/JrfjZtEQ4J line 1:�------> [32msay "aaaaaaaaaaab" ~~ /<[33m�[31m"a+b">+/[0m��Parse failed��»
15:43 FROGGS rn: say "aaaaaaaaaaab" ~~ /<$("a+b")>+/
15:43 p6eval rakudo 8ea992: OUTPUT«「aaaaaaaaaaab」␤␤»
15:43 p6eval ..niecza v24-33-gfc6d5fd: OUTPUT«Use of Nil as a string␤  at /home/p6eval/niecza/lib/CORE.setting line 1342 (warn @ 5) ␤  at /home/p6eval/niecza/lib/CORE.setting line 449 (Nil.Str @ 4) ␤  at <unknown> line 0 (ExitRunloop @ 0) ␤  at /home/p6eval/niecza/lib/CORE.setting line 2870 (Match.gis…
15:43 jnthn There's nothing to decide in that case, though?
15:44 jnthn You jsut eval and run?
15:44 jnthn Are you thinking more like /<@(...)>/ style things?
15:44 FROGGS r: say "aaaaaaaaaaab" ~~ /<@("a+b", "\d", "b")>+/
15:44 p6eval rakudo 8ea992: OUTPUT«[31m===[0mSORRY![3​1m===[0m�Unrecognized backslash sequence: '\d'�at /tmp/UXXU2kDe0A:1�------> [32msay "aaaaaaaaaaab" ~~ /<@("a+b", "\[33m�[31md", "b")>+/[0m�    expecting any of:�        postfix�        infix stopper�        infix or meta-infix�        pref…
15:44 FROGGS right
15:44 FROGGS r: say "aaaaaaaaaaab" ~~ /<@("a+b", "\\d", "b")>+/
15:44 p6eval rakudo 8ea992: OUTPUT«「aaaaaaaaaaab」␤␤»
15:45 jnthn Is that not the same as /<@a>/ generally?
15:45 FROGGS jnthn: it is
15:45 jnthn timotimo: Think I've got a fix
15:45 FROGGS I just asks if there is a cleverer way instead of evaling an anon regex
15:47 timotimo masak: do you know when the recording of your talk at fosdem recently can be uploaded or if it already is?
15:48 jnthn FROGGS: No, I don't think so...I think it is a case of doing that and then looking at the NFA of what was produced.
15:49 jnthn FROGGS: I mean, technically I guess you could just compile it as far as the AST, try to extract the right bit of that to feed to the NFA builder, and so forth...
15:49 jnthn FROGGS: But I'm not sure it's worth it.
15:49 jnthn FROGGS: You'd have to then go and finish compiling the winner(s)
15:49 jnthn I think it's probably a premature opt.
15:50 kst` joined #perl6
15:51 FROGGS hmmmm, okay
15:52 masak timotimo: I have no idea.
15:53 masak timotimo: I try not to sit around waiting for conf talks to be uploaded. it tends to be a while :)
15:53 timotimo right :(
15:53 timotimo i think i remembered whoever recorded that said it was at that time unencoded, but otherwise ready to get uploaded
15:53 timotimo was it lizmat?
15:58 dalek nqp-jvm-prep: 79e176f | jnthn++ | lib/QAST/JASTCompiler.nqp:
15:58 dalek nqp-jvm-prep: A little re-org.
15:58 dalek nqp-jvm-prep: review: https://github.com/jnthn/nqp​-jvm-prep/commit/79e176f8b1
15:58 dalek nqp-jvm-prep: ef1be4e | jnthn++ | nqp-src/NQP (2 files):
15:58 dalek nqp-jvm-prep: Don't leak compunits out, in general.
15:58 dalek nqp-jvm-prep:
15:58 dalek nqp-jvm-prep: Just give them to things that know what to do with them.
15:58 dalek nqp-jvm-prep: review: https://github.com/jnthn/nqp​-jvm-prep/commit/ef1be4e7f1
15:58 dalek nqp-jvm-prep: ddf70f4 | jnthn++ | nqp-src/NQPP6QRegex.pm:
15:58 dalek nqp-jvm-prep: Fix handle uniqueness issue.
15:58 dalek nqp-jvm-prep: review: https://github.com/jnthn/nqp​-jvm-prep/commit/ddf70f48cc
15:58 dalek nqp-jvm-prep: 43862dd | jnthn++ | t/nqp/49-regex-interpolation.t:
15:58 jnthn heh, it lost two lines
15:58 jnthn timotimo: Hopefully those help
15:58 timotimo i'll test
16:00 timotimo yesterday was the first time i missed loop labels in perl6
16:01 timotimo i wanted to redo an outer for loop from inside a while loop and couldn't (at least not easily)
16:02 PacoAir joined #perl6
16:02 PacoAir joined #perl6
16:05 ruoso timotimo, you have both control and error exceptions in Perl 6, you can do it that way
16:09 timotimo that's "not easily" to me; i am trying to solve one of the problems on rosettacode and thus want to have pretty and short code :)
16:09 timotimo jnthn: that makes matches succeed, cool!
16:10 timotimo but now: stack overflow errors happen at some point
16:12 masak balanced brackets: https://gist.github.com/masak/5129165 -- I just seemed to need to get this out of my system for the past two weeks or so. :)
16:12 masak if anyone knows of a better way to generate uniformly random balanced-bracket strings, I'd be very interested to know.
16:12 timotimo interesting, there's a null pointer exception, too ...
16:15 rindolf joined #perl6
16:21 LlamaRider joined #perl6
16:21 timotimo jnthn: http://paste.ee/p/yfryu - does this make any sense to you? the first 20 regex tests succeed and this one fails
16:22 timotimo it seems like the NPE results from the call to dump_str on the match object
16:23 timotimo hm, maybe that's what it does if the regex doesn't match the string or something?
16:34 Chillance joined #perl6
16:35 jnthn timotimo: My best guess is that the CATCH block is hit and then something it does causes an exception.
16:36 jnthn timotimo: And given I didn't finish up the exception stuff yet, that has bad consequences.
16:36 timotimo oh, that may very well be. i'll investigate!
16:36 jnthn The top mention of it dying in what are telling though
16:37 timotimo yes, it spits out the null pointer exception and then enters the CATCH block a bunch of times, then gets the stack overflow errors
16:37 timotimo should i comment out all regex tests that cause this behavior as kind of a "todo" thing and commit the rest to the repo?
16:37 jnthn timotimo: You could do that, yes
16:37 timotimo i'll do that later today
16:38 jnthn timotimo: Or maybe see if it does make it into the CATCH block and see where it explodes in there
16:39 timotimo it probably jumps into the true branch and tries to call nqp::index(~$_, $expect_substr)
16:39 jnthn oh, I wonder if the ~$_ is to blame...
16:39 timotimo not sure what the $_ is though
16:39 jnthn The exception I guess...
16:39 timotimo could be, yes
16:39 jnthn nqp-jvm: try { nqp::die('omgz'); CATCH { say("here") } }
16:40 p6eval nqp-jvm: OUTPUT«here␤»
16:40 jnthn nqp-jvm: try { nqp::die('omgz'); CATCH { say(~$_) } }
16:40 p6eval nqp-jvm: OUTPUT«Exception in thread "main" ␤Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "main"␤»
16:40 timotimo fwiw, when i comment out that code the tests all run (and of course that's not a fix at all)
16:40 jnthn nqp-jvm: try { nqp::die('omgz'); CATCH { say($_.WHAT) } }
16:40 p6eval nqp-jvm: OUTPUT«␤»
16:41 jnthn nqp-jvm: try { nqp::die('omgz'); CATCH { say($_.HOW.name($_)) } }
16:41 p6eval nqp-jvm: OUTPUT«BOOTException␤»
16:41 jnthn nqp-jvm: try { nqp::die('omgz'); CATCH { say(nqp::getmessage($_)) } }
16:41 p6eval nqp-jvm: OUTPUT«omgz␤»
16:41 timotimo should i use getmessage instead of ~$_?
16:42 jnthn You can try that, for sure.
16:43 timotimo when i just replace ~$_ with nqp::getmessage($_) i get null pointer exceptions every time i enter the catch block, followed by the catch block being entered
16:43 timotimo i'll be afk for a bit
16:43 cognominal joined #perl6
16:45 dalek nqp-jvm-prep: 8ac4de5 | jnthn++ | src/org/perl6/nqp/runtime/Ops.java:
16:45 dalek nqp-jvm-prep: Avoid null exception messages.
16:45 dalek nqp-jvm-prep: review: https://github.com/jnthn/nqp​-jvm-prep/commit/8ac4de54fa
16:45 jnthn timotimo: When you get back, ^^ may help (still need the getmessage)
16:54 SamuraiJack__ joined #perl6
17:08 lizmat timotimo: thanks for the reminder about FOSDAM talks.
17:08 lizmat not all of them got recorded, or completely recorded
17:09 lizmat most of them are not quite in focus, and in HD
17:09 lizmat I'm wondering whether it makes sense to downgrade the video quality even further for downloadable / streamable experience
17:12 lizmat and the audio is not too good either.  This has taught me that using a Nikon D800 is not really a good way of recording presentations
17:14 * lizmat afk for most of the evening
17:19 simcop2387 joined #perl6
17:19 simcop2387 joined #perl6
17:19 timotimo oh, right
17:20 timotimo i'll check that change after a commute, jnthn :)
17:20 skids joined #perl6
17:21 grondilu rakudo warns me about useless use of [] with metaoperator?
17:21 grondilu rn:  sub infix:<m+> { ($^a + $^b) mod 13 }; say ^13 Z[m+] ^13;
17:21 p6eval niecza v24-33-gfc6d5fd: OUTPUT«0 2 4 6 8 10 12 1 3 5 7 9 11␤»
17:21 p6eval ..rakudo 8ea992: OUTPUT«Potential difficulties:�    Useless use of [] around infix op�    at /tmp/AKRpun407P:1�    ------> [32m:<m+> { ($^a + $^b) mod 13 }; say ^13 Z[[33m�[31mm+] ^13;[0m�0 2 4 6 8 10 12 1 3 5 7 9 11�»
17:22 PacoAir joined #perl6
17:22 grondilu using [] is not useless even when not necessary, is it?  It can always be used for clarity.
17:22 jnthn std: say ^13 Z[m+] ^13;
17:22 p6eval std 86b102f: OUTPUT«[31m===[0mSORRY![31m===[0m�Null pattern not allowed at /tmp/icKAMFYlcu line 1:�------> [32msay ^13 Z[m+[33m�[31m] ^13;[0m�    expecting any of:�    infix or meta-infix�    regex atom�     semicolon list� statement end�Parse failed�FAILED 00:00 45m�»…
17:22 jnthn oops
17:22 jnthn std: sub infix:<m+> { ($^a + $^b) mod 13 }; say ^13 Z[m+] ^13;
17:22 p6eval std 86b102f: OUTPUT«ok 00:00 46m␤»
17:23 colomon n: sub infix:<m+> { ($^a + $^b) mod 13 }; say ^13 Z[m+] ^13;
17:23 p6eval niecza v24-33-gfc6d5fd: OUTPUT«0 2 4 6 8 10 12 1 3 5 7 9 11␤»
17:23 jnthn grondilu: I incorporated that message from STD yesterday. It's not meant to trigger inside of a meta-op.
17:23 grondilu well, it does, apparently.
17:23 isomorphisms joined #perl6
17:28 jac50 joined #perl6
17:30 grondilu r: say ^3 Z[+] ^3
17:30 p6eval rakudo 8ea992: OUTPUT«0 2 4␤»
17:39 jnthn huh, it only triggers it on a user-defined op?
17:39 James_ joined #perl6
17:45 bbkr joined #perl6
17:49 masak rn: https://gist.github.com/masak/5129165
17:49 p6eval niecza v24-33-gfc6d5fd: OUTPUT«Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object␤  at Builtins.InvokeSub (Niecza.P6any obj, Niecza.Variable[] pos) [0x00000] in <filename unknown>:0 ␤  at Niecza.Kernel.ToComposable (Niecza.STable arg…
17:49 p6eval ..rakudo 8ea992: OUTPUT«[[]][[]][[]]␤»
17:50 masak hm, I wonder what Niecza stumbles on there.
17:51 masak that's a weird error. reproducible locally.
17:54 masak rn: constant C = 41, 42, 43; say C[1]
17:54 p6eval niecza v24-33-gfc6d5fd: OUTPUT«Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object␤  at Builtins.InvokeSub (Niecza.P6any obj, Niecza.Variable[] pos) [0x00000] in <filename unknown>:0 ␤  at Niecza.Kernel.ToComposable (Niecza.STable arg…
17:54 p6eval ..rakudo 8ea992: OUTPUT«42␤»
17:54 masak there it is.
17:56 jnthn rn: constant C = (41, 42, 43); say C[1]
17:56 p6eval niecza v24-33-gfc6d5fd: OUTPUT«Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object␤  at Builtins.InvokeSub (Niecza.P6any obj, Niecza.Variable[] pos) [0x00000] in <filename unknown>:0 ␤  at Niecza.Kernel.ToComposable (Niecza.STable arg…
17:56 p6eval ..rakudo 8ea992: OUTPUT«42␤»
17:56 jnthn (just checking it's not a precedence discrepancy)
17:57 stevan_ joined #perl6
18:02 cognominal joined #perl6
18:06 dalek rakudo/nom: 5963753 | jnthn++ | src/Perl6/Grammar.pm:
18:06 dalek rakudo/nom: Turn off check giving false positives for now.
18:06 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/5963753fb6
18:08 dalek rakudo/nom: 8d510e3 | jnthn++ | src/Perl6/ModuleLoader.pm:
18:08 dalek rakudo/nom: One pir:: => nqp::.
18:08 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/8d510e35dd
18:11 census joined #perl6
18:11 marloshouse left #perl6
18:13 PacoAir_ joined #perl6
18:15 timotimo jnthn, were you going to make exceptions work soon?
18:16 jnthn timotimo: Finishing that lot up is fairly high on my todo list, yes.
18:16 jnthn (Probably next few days.)
18:16 timotimo neato
18:16 jnthn afk for a bit
18:17 timotimo maybe i will be able to get the regex tests in acceptable shape today
18:18 cognominal joined #perl6
18:21 lichtkind_ joined #perl6
18:23 pmurias_ joined #perl6
18:24 pmurias joined #perl6
18:24 pmurias jnthn: what is needed for automatic precompilation for rakudo & nqp?
18:33 arnsholt Apparently the Rakudo dyncall library is "hardly maintained". That was news to me ^_^
18:36 jnthn pmurias: The tricky part is knowing that nothing you depend on has been invalidated before loading the pre-compiled version. It's not a Horribly Impossible problem, just needs care to get right.
18:36 jnthn pmurias: Then there's the "where do we store the pre-compiled things" which needs to be configurable.
18:37 jnthn pmurias: An environment variable specifying that is a good start.
18:37 jnthn arnsholt: Um, who said it was hardly maintained? o.O
18:38 arnsholt jnthn: http://lists.parrot.org/pipermail/​parrot-dev/2013-March/007420.html
18:39 James_ joined #perl6
18:39 jnthn oh, parrot-dev...
18:45 * arnsholt tries to ask about it in #parrot
19:00 moritz o/
19:00 PacoAir_ joined #perl6
19:02 arnsholt \o moritz
19:02 masak moritz! \o/
19:03 masak "oh, parrot-dev" pretty much sums it up.
19:05 jnthn welcome back, moritz  :)
19:07 pmurias jnthn: is it to be expected that defining HLL::Backend::JavaScript in a seperate file causes problems?
19:08 * timotimo doesn't understand
19:08 pmurias jnthn: it's not seen, but HLLBackendJavaScript is
19:10 jnthn pmurias: Yeah, NQP's nested package handling is naive...
19:12 jnthn pmurias: Though not entirely sure why that case ain't handled...
19:14 woolfy left #perl6
19:22 xinming joined #perl6
19:37 wk joined #perl6
19:39 pmurias jnthn: isn't it a similiar reason to why you use QAST::CompilerJAST instead of QAST::Compiler::JAST?
19:39 jnthn pmurias: Yes :)
19:39 bbkr star: use JSON::RPC::Client; JSON::RPC::Client.new( url => "http://bbkr.org:8080" ).locate('perlgeek.de').say # paid/free GeoIP database support :)
19:39 p6eval star 2013.02: OUTPUT«("area_code" => 0, "city" => "Fürth", "continent_code" => "EU", "country" => "Germany", "country_code" => "DE", "dma_code" => 0, "latitude" => "49.466702", "longitude" => "10.966700", "postal_code" => "90763", "region" => "Bayern", "region_code" => "02", "time_zone"…
19:39 jac50 joined #perl6
19:41 masak whoa.
19:41 masak we don't accept system calls and file I/O on p6eval, but arbitrary *network* calls are OK? :P
19:42 jnthn masak: Sure, they're going to somebody else's system :P
19:43 masak oh, indeed.
19:43 bbkr https://github.com/bbkr/GeoIPerl6 - please test on your machines if you have some spare time
19:44 bbkr so far OS X 10.7 and Ubuntu 12.04 works with paid and free (from repositories) databases
19:44 pmurias jnthn: what we would need is a better load_module in src/ModuleLoader.pm?
19:44 arnsholt bbkr: Sorry for being so slow to respond to your Zavolaj bug reports, BTW
19:44 arnsholt My time on Macs has been greatly reduced recently =/
19:45 jnthn pmurias: If the problem is in global merging, yes
19:45 bbkr arnsholt: that's fine, I also didn't have much time for Perl6 lately :)
19:47 PacoAir_ joined #perl6
20:00 dalek nqp: a4fa7e4 | (Arne Skjærholt)++ | src/6model/reprs/VMArray.c:
20:00 dalek nqp: Serialize and deserialize VMArray REPR data.
20:00 dalek nqp: review: https://github.com/perl6/nqp/commit/a4fa7e45cc
20:00 dalek nqp: b553620 | (Arne Skjærholt)++ | src/6model/reprs/VMArray.c:
20:00 dalek nqp: Refactor get_pos_{int,float} logic.
20:00 dalek nqp: review: https://github.com/perl6/nqp/commit/b5536205b5
20:00 dalek nqp: e45782b | (Arne Skjærholt)++ | src/6model/reprs/VMArray.c:
20:00 dalek nqp: Refactor null_pos and set_pos_{int,float} logic.
20:00 dalek nqp: review: https://github.com/perl6/nqp/commit/e45782b5c6
20:00 dalek nqp: 7399985 | (Arne Skjærholt)++ | src/6model/reprs/VMArray.c:
20:00 dalek nqp: Serialize and deserialize VMArrays.
20:00 dalek nqp: review: https://github.com/perl6/nqp/commit/7399985def
20:04 jnthn arnsholt: Does your serialization format match what I did for VMArray on the JVM the other day, ooc? :)
20:04 * jnthn figures it'll be pretty close :)
20:05 arnsholt That's a very good question!
20:06 arnsholt repr_data is serialized as only the type object. The rest of it (bits and kind) is reconstructed from that
20:06 arnsholt The object itself is ->elems and then the elements
20:09 arnsholt Oh, and the serialization/deserialization loops branch on type for each element ATM
20:09 arnsholt Not the most efficient way to do it, but saved me some implementation time. If performance in the serialization logic matters I can fix that once I get things working
20:22 PacoAir joined #perl6
20:30 Ulti FROGGS: https://vimeo.com/61476623  sorry the quality is kind of low... the source video is better
20:33 timotimo i get really weird behavior from the CATCH block, things like a pyramid of "not " before the "ok" :D
20:33 timotimo i think i shall wait for exceptions to work properly
20:35 FROGGS Ulti++
20:39 James_ joined #perl6
20:42 szabgab joined #perl6
20:42 szabgab good daytime
20:42 szabgab I have not been here for a while....
20:43 szabgab rakudo: my $x = "text"; say "{ $x.WHAT }"
20:43 p6eval rakudo 8d510e: OUTPUT«use of uninitialized value of type Str in string context  in block  at /tmp/nV69nBrwtL:1␤␤␤»
20:43 Ulti FROGGS: the original video is here http://mattoates.co.uk/files/rakudo_git.mp4 works in VLC for me but not some other players :S
20:44 szabgab method calls don't work in interpolation any more?
20:44 timotimo hello mister gabo :)
20:45 timotimo szabgab: the problem is different, the value of WHAT is the type class and those are undefined
20:45 timotimo r: my $x = "text"; say "{ $x.WHAT.^name }"
20:46 p6eval rakudo 8d510e: OUTPUT«Str␤»
20:46 szabgab rakudo: my $x = "text"; say $x.WHAT
20:46 p6eval rakudo 8d510e: OUTPUT«(Str)␤»
20:46 arnsholt jnthn: What's the correct way to make an op create a sixmodel object?
20:46 szabgab timotimo: the thing is that I noticed this with some of the method calls in an application
20:47 szabgab after compiling rakudo for the first time in monthes
20:48 szabgab hmm, but I just wrote a simple example an it works there, strange, I need to look into those classes
20:49 timotimo well, feel free to paste it and i'll have a look (not that i'd be an expert or anything)
20:49 timotimo have you tried the debugger for rakudo yet?
20:49 timotimo it's quite spiffy
20:52 FROGGS Ulti: I only use VLC, so that's pretty fine :o)
20:52 FROGGS thanks!
20:52 szabgab oh, I am using qq{} in the code and not ""
20:52 szabgab rakudo: my $x = "text"; say $x.WHAT
20:52 p6eval rakudo 8d510e: OUTPUT«(Str)␤»
20:52 jnthn arnsholt: allocate, then initialize
20:53 szabgab err. sorry
20:53 jnthn arnsholt: See any of the box opes, for example
20:53 jnthn *ops
20:54 szabgab class X { has $.name };my $z = X.new(name => 'Foo'); print " {$z.name} ";  print qq{ {$z.name} }
20:54 szabgab rakudo: class X { has $.name };my $z = X.new(name => 'Foo'); print " {$z.name} ";  print qq{ {$z.name} }
20:54 p6eval rakudo 8d510e: OUTPUT« Foo  {X<-518084861>.name} »
20:55 szabgab so qq{ } is not the same as ""
20:55 szabgab ?
20:55 jnthn szabgab: qq and "" imply the same thing
20:55 jnthn szabgab: Trouble is that you picked {...} as your delimeters
20:55 szabgab it used to work
20:56 jnthn Yes, Rakudo used to not follow the standard grammar properly there.
20:56 jnthn Or maybe STD had it the other way around once too...
20:56 szabgab ah, so it was incorrect back then?
20:56 jnthn Yeah
20:56 szabgab oh my
20:56 szabgab fixing  the perl6maven.com generating code
20:56 szabgab ...
20:56 szabgab thanks!
20:57 jnthn I'm pretty sure Rakudo has it as STD does, since I recall discussing the rationale for it being this way with TimToady++ as I worked on it.
20:57 timotimo szabgab: yeah, your perl6maven posts appeared in my reader and the links were all broken :(
20:58 jnthn You can just pick a different quoter though
20:59 jnthn r: say qq[ abc { "omgz".flip } def ]
20:59 p6eval rakudo 8d510e: OUTPUT« abc zgmo def ␤»
20:59 szabgab timotimo: sorry or that :) now  you know why ...
20:59 szabgab I am fixing it right now
20:59 szabgab jnthn: I go with []
21:00 timotimo jnthn: so is {} inside qq{} not working a bug in rakudo? i don't fully understand
21:00 arnsholt jnthn: Oh, right. I forgot about nqp.ops. No way to do it directly in NQP via QAST/Operations.nqp?
21:00 masak r: say qq{omg}
21:00 p6eval rakudo 8d510e: OUTPUT«omg␤»
21:00 geekosaur timotimo, as I read the above discussion, it's per spec
21:00 masak r: say qq{omg { 2 + 2 } wtf}
21:00 p6eval rakudo 8d510e: OUTPUT«omg { 2 + 2 } wtf␤»
21:00 masak timotimo: no, I think it's to spec.
21:00 jnthn timotimo: No, it's not a bug.
21:01 masak std: qq{omg { $variable } wtf}
21:01 p6eval std 86b102f: OUTPUT«[31m===[0mSORRY!​[31m===[0m�Variable $variable is not predeclared at /tmp/n03I4ldgLt line 1:�------> [32mqq{omg { [33m�[31m$variable } wtf}[0m�Check failed�FAILED 00:00 42m�»
21:01 masak wtf :)
21:01 FROGGS hehe
21:01 masak oh right.
21:01 timotimo ok
21:01 masak yes, it still interpolates, of course.
21:01 jnthn yeah, if you take a look at STD's nibble
21:01 jnthn It does
21:01 jnthn || <starter> <nibbler> <stopper>
21:01 jnthn || <escape>
21:02 jnthn Meaning that a nesting of the delim beats and escape sequence.
21:02 jnthn Closures are an escape.
21:02 jnthn *an
21:03 jnthn The top line is why you can do stuff like
21:03 jnthn r: say q{ if $x = 42 { say "it's the answer" } }
21:03 p6eval rakudo 8d510e: OUTPUT« if $x = 42 { say "it's the answer" } ␤»
21:03 jnthn And the nested { and } are counted
21:04 masak *nod*
21:06 bruges joined #perl6
21:18 not_gerd joined #perl6
21:20 not_gerd golfed my module compilation failure as far as I could
21:20 not_gerd see https://github.com/gerdr/rakudobug if anyone wants to reproduce
21:24 PacoAir joined #perl6
21:25 masak not_gerd: nice golf.
21:25 masak not_gerd: ooc, how much of the module hierarchy is needed?
21:26 masak does the bug trigger even without the PASM and/or PASM::Backend prefixes on the modules?
21:26 not_gerd masak: the hierarchy is necessary
21:27 masak both levels?
21:28 not_gerd I believe so, but feel free to experiment
21:32 masak it just seemed unlikely to my spider sense that *two* levels would be necessary to trigger the bug.
21:33 domidumont joined #perl6
21:36 not_gerd masak: I just tried again to remove either level, and both appear necessary
21:39 masak ok.
21:39 masak if I were you, I'd map out the order in which packages/classes are defined. might turn up something interesting.
21:40 jnthn not_gerd++ # putting the thing in a git repo, which'll make it easy for me to recreate
21:40 jnthn Does it have an acompanying RT?
21:40 masak like, sometimes when you include A::B, the A package will get a stub that can be replaced later.
21:41 jnthn I did fix a bunch of this stuff a while back. Thought I'd nailed these issues. :(
21:45 not_gerd module load order is consistent: https://gist.github.com/gerdr/5130590
21:45 not_gerd I can create an RT ticket if so desired
21:47 jnthn not_gerd: Plesae do create the RT, and link to the github repo in it.
21:47 jnthn not_gerd: It's the best way to ensure it doesn't get lost.
21:47 jnthn I'll try and look at it during this week though.
21:48 timotimo if i want to build my own "is foobar", i'll add a multi trait-mod:<is>(Routine $a, :foobar), right?
21:49 jnthn _, not -
21:49 jnthn and :$foobar!
21:49 timotimo oh, ok
21:49 jnthn Make it required
21:49 timotimo why the $ though?
21:50 jnthn std: sub foo(:foobar) { }
21:50 p6eval std 86b102f: OUTPUT«[31m===[0mSORRY!​[31m===[0m�Malformed parameter at /tmp/PmFKsqmcyb line 1:�------> [32msub foo(:[33m�[31mfoobar) { }[0m�    expecting any of:�       formal parameter�       named parameter�Parse failed�FAILED 00:00 42m�»
21:50 timotimo ah, duh :)
21:50 jnthn Because it's not valid syntax without ;)
21:52 masak maybe it should be... :)
21:53 masak std: sub foo(:$foobar) {}
21:53 p6eval std 86b102f: OUTPUT«ok 00:00 43m␤»
21:53 masak we admit sub foo(42), why not sub foo(:foobar) ?
21:54 not_gerd jnthn: just submitted as #117117
21:54 not_gerd ++jnthn for looking into it
21:56 colomon masak: it has to have a named parameter with that name, we don't care what the value is?
21:57 masak right.
21:57 jnthn std: sub foo(:foobar()) { }
21:57 p6eval std 86b102f: OUTPUT«[31m===[0mSORRY!​[31m===[0m�Malformed parameter at /tmp/GBmxKAeYUI line 1:�------> [32msub foo(:foobar([33m�[31m)) { }[0m�    expecting any of:�     named_param_term�       new name to be defined� parameter�      routine_def�    signature�Parse failed�FAILED 00:00 42m�»…
21:58 jnthn std: sub foo(:\foobar) { }
21:58 p6eval std 86b102f: OUTPUT«ok 00:00 43m␤»
21:58 jnthn not_gerd: thanks
22:03 jnthn 'night, #perl6
22:04 diakopter o/
22:04 colomon \o
22:05 lue hello o/
22:06 diakopter hi
22:07 masak lue! \o/
22:12 timotimo i can use signatures in given/when, right? what's the signature for that? :|
22:12 timotimo i've tried ten things so far :|
22:12 diakopter (the_eleventh_thing)
22:13 not_gerd r: given \(42, :foo<x>) { when :($pos, :$foo!) { say 'works' } }
22:13 p6eval rakudo 8d510e: OUTPUT«works␤»
22:14 timotimo oh, a ":"
22:14 timotimo i've tried \ and |, but neither worked. i did not expect :. thanks!
22:15 masak no-one expects the colon inquisition!
22:15 not_gerd but everyone wants the colon
22:15 not_gerd I don't think that's true for the inquisition
22:16 masak though maybe for Spanish... :)
22:16 timotimo hehe
22:16 timotimo r: given \(42, :foo<x>) { when :($pos, :$foo!) { say 'works'; say $pos } }
22:16 p6eval rakudo 8d510e: OUTPUT«[31m===[0mSORRY!​[31m===[0m�Variable '$pos' is not declared�at /tmp/2S9Ne0gBs7:1�------> [32m :($pos, :$foo!) { say 'works'; say $pos[33m�[31m } }[0m�    expecting any of:�        postfix�»
22:16 timotimo do i need a pointy block?
22:18 lue r: given \(42, :foo<x>) { when :($pos, :$foo!) { say 'works'; say $_[0] } }
22:18 p6eval rakudo 8d510e: OUTPUT«works␤42␤»
22:18 timotimo that's unfortunate :|
22:19 timotimo well, not really surprising though
22:19 masak I dunno. I could argue that one both ways.
22:19 masak it would be a great thing for pattern matching if that one actually *did* bind $pos in the block.
22:19 timotimo you mean you wouldn't want names to be clobbered by signatures?
22:20 masak right, that could be an argument against.
22:20 masak but it seems a weak argument to me.
22:20 timotimo that's what i intended to do
22:20 not_gerd r: given \(42, :foo<x>) { when :($pos, :$foo!) { (-> $pos, :$foo { say $pos })(|$_) } }
22:20 p6eval rakudo 8d510e: OUTPUT«42␤»
22:20 masak because the clobbering isn't really clobbering. it's lexical overriding.
22:20 timotimo ah, so a pointy block does make it work! (but very ugly :D)
22:21 lue may Signature<pos_var> ?
22:21 masak $^pos ?
22:21 masak make it a little shorter...
22:21 masak anyway, 'night, #perl6
22:21 lue r: sub foo($bar, :$bar) { say "I'm alive!" }; foo(1,:bar(2));
22:21 p6eval rakudo 8d510e: OUTPUT«[31m===[0mSORRY![3​1m===[0m�Redeclaration of symbol $bar�at /tmp/xSY0IIybRR:1�------> [32msub foo($bar, :$bar[33m�[31m) { say "I'm alive!" }; foo(1,:bar(2));[0m�»
22:21 timotimo 'night masak!
22:22 lue So I'd be fine with $_<pos> in timotimo's example code
22:22 not_gerd perhaps matching against a signature should do something useful with $/
22:24 not_gerd or is $/ supposed to always be tied to regex matching?
22:24 lue not_gerd: I'd guess so. Also it wouldn't work if part of your when { } block does some pattern matching.
22:24 timotimo does something speak against the syntax when -> $foo, :$bar { ... }?
22:24 timotimo is that evil and terrible?
22:28 not_gerd you could also get rid of given/when and just do a multi dispatch on local subs
22:28 timotimo but i can't have anonymous multi subs ;)
22:29 lue r: anon multi sub marine($a) { "expect failure" };
22:29 p6eval rakudo 8d510e: OUTPUT«[31m===[0mSORRY![31m===[0m�Cannot use 'anon' with individual multi candidates. Please declare an anon-scoped proto instead�at /tmp/b1hYn0kgO0:1�------> [32multi sub marine($a) { "expect failure" }[33m�[31m;[0m�    expecting any of:�        postfix�        s…
22:29 lue ?? /me is intrigued with anon proto ...
22:30 timotimo oh that's interesting
22:31 timotimo "Cannot put proto on anonymous routine"
22:32 lue r: anon proto sub foo(|) {*}; my &a = multi sub foo($a) { say $a }; my &b = multi sub foo($a, $b) { say $a + $b; }; a(5); b(4,5);
22:32 p6eval rakudo 8d510e: OUTPUT«5␤9␤»
22:32 timotimo but that's not anonymous, that's called foo!
22:32 lue the anon makes in anonymous
22:33 timotimo so you have to identify it with a name, but the name gets discarded?
22:33 lue http://perlcabal.org/syn/S​02.html#Scope_declarators
22:34 lue It gives pretty names for errors and allows for recursive anonymous subs.
22:36 timotimo hmm
22:36 timotimo doesn't seem very helpful
22:38 cognominal joined #perl6
22:53 not_gerd you could also get rid of given/when and just do a multi dispatch on local subs
22:54 not_gerd looks like there's an echo in here ;)
22:54 not_gerd timotimo: the closest I got to 'anonymous' dispatch using multis is https://gist.github.com/gerdr/5130877
22:56 not_gerd bye, #perl6
22:57 not_gerd left #perl6
22:57 diakopter o/
22:57 xinming joined #perl6
23:01 timotimo that is ugly :(
23:28 census_ joined #perl6
23:29 timotimo hm, how do i check that a junction turns into the right thing in a test case? :|
23:31 timotimo i suppose i have to do some magic with Mu and such .. ?
23:31 timotimo but i thouht when i try to get the values out of a junction i'm doing it wrong
23:32 timotimo oh, i can .Str it!
23:35 timotimo rn: sub tp($a, $b, $c) { "$a $b $c" }; my Mu $res = tp("dog", 1|2, 10&20); say $res.Str;
23:35 p6eval rakudo 8d510e: OUTPUT«any(all("dog 1 10", "dog 1 20"), all("dog 2 10", "dog 2 20"))␤»
23:35 p6eval ..niecza v24-33-gfc6d5fd: OUTPUT«all(any("dog 1 10", "dog 2 10"), any("dog 1 20", "dog 2 20"))␤»
23:36 timotimo that's good.
23:37 geekosaur something demorgan-ed wrong?
23:42 dayangkun joined #perl6
23:42 cognominal joined #perl6
23:43 timotimo no, not quite
23:43 timotimo it's just the rule that the leftmost & junction will be run before the leftmost | junction
23:43 timotimo so, i've added this test, should i let it fail with rakudo or add a todo fudge already?
23:44 cognominal joined #perl6
23:45 geekosaur I was commenting in the difference between niecza and rakudo
23:49 colomon timotimo: if you know if fails in rakudo, add a todo
23:50 timotimo good.
23:50 timotimo i may even add a fix soon-ish? who knows! :)
23:51 dalek roast: b88a9d9 | (Timo Paulssen)++ | S03-junctions/autothreading.t:
23:51 dalek roast: autothreading order tests (& before |)
23:51 dalek roast: review: https://github.com/perl6/roast/commit/b88a9d95c2
23:52 colomon timotimo++

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

Perl 6 | Reference Documentation | Rakudo