»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend! Set by sorear on 4 February 2011. |
|||
00:01
adu_ left
00:11
Infamous joined
00:12
PacoAir left
00:14
jac50 left
00:21
PacoAir joined,
PacoAir left
00:29
adu_ joined
00:33
LlamaRider left
|
|||
[Coke] | rakudo now up to 16 failures, niecza 8, pugs 2. | 00:52 | |
(those pugs failures are sporadic) | 00:53 | ||
rakudo's new failures are in S26-documentation/09-configuration.t | 00:56 | ||
00:58
adu_ left
01:15
Infamous left
01:22
Chillance left
|
|||
timotimo | i wish rosettacode had some function to give me pages that are tasks, but not in the perl6 group :| | 01:26 | |
TimToady | you an unimplemented in Perl 6 page? | 01:28 | |
you mean* | |||
there is one | |||
rosettacode.org/wiki/Reports:Tasks_..._in_Perl_6 | |||
or did you mean something else? | |||
timotimo | oooh! | 01:30 | |
that is so neat :) | |||
oh, those are many more than i expected | 01:31 | ||
"the developers thought of everything" i must say | |||
01:32
census left
|
|||
TimToady | there aren't so few of them that we have to worry much about developer collisions yet | 01:34 | |
timotimo | :) | 01:36 | |
01:39
bowtie left
|
|||
timotimo | hm, opengl bindings would not be terrifically hard to make with zavolaj, i imagine ... | 01:40 | |
01:40
isomorphisms joined
|
|||
timotimo | i think i'll try to implement this prettily: rosettacode.org/wiki/Brownian_tree | 01:44 | |
diakopter | bonus if you can beat TI-83 BASIC in codesize | 01:45 | |
timotimo | i'll try to get a good balance of "short" and "readable". should be totally doable in perl6 ;) | 01:47 | |
hm, there seems to be quite a bit of freedom in those exercises | 01:50 | ||
diakopter | well, people take liberties, anyway | ||
timotimo | sure | 01:52 | |
01:54
marloshouse joined
01:57
PacoAir joined
|
|||
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… | ||
timotimo | hm :| | ||
r: my %h; %h{1}{2} = 5; say %h; | 02:03 | ||
p6eval | rakudo 8ea992: OUTPUT«("1" => {"2" => 5}).hash» | ||
timotimo | i keep forgetting this | ||
02:04
adu_ joined
|
|||
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:1use of uninitialized value of type Any in string context in block at /tmp/nuwzWSmTz0:1use of uninitialized value of type Any in string context in block at /tmp/nuwzWSmTz… | ||
TimToady | heh | 02:09 | |
02:09
adu_ left
|
|||
timotimo | use of uninitialized variable $s of type Any in numeric context | 02:10 | |
i do not understand why | |||
i don't have a $s anywhere in my code ... ?! | |||
TimToady | it'll be somewhere in the setting, probably | 02:11 | |
timotimo | ah, probably | ||
02:11
adu_ joined
|
|||
timotimo | it seems like it comes from something like this: | 02:11 | |
r: my %h; %h{1}{2} == 5; | |||
p6eval | rakudo 8ea992: OUTPUT«use of uninitialized variable $v of type Any in numeric context in block at /tmp/YKysIoZaog:1» | ||
lue | is the C<==> a typo in your code? | 02:12 | |
timotimo | it's in an if in my code | ||
02:13
PacoAir left
|
|||
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/lMU9S30pUv:1I live!» | ||
lue | r: my %h; %h{1}{2} == 5; say "I live!"; | ||
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:1I live!» | ||
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:1I 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? | ||
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… | ||
timotimo | hmm | ||
apparently not? | |||
r: my %h; say %h{10} :exists; | 02:18 | ||
p6eval | rakudo 8ea992: OUTPUT«False» | ||
timotimo | r: my %h; say %h<<"foo">> :exists; | 02:20 | |
p6eval | rakudo 8ea992: OUTPUT«False» | ||
timotimo | r: my %h; my $x = 10; say %h<<$x|$x>> :exists; | ||
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» | ||
timotimo | huh? | ||
oh yeah, the first speck of thingie will take a loooong time to settle | 02:22 | ||
this "redo" isn't working as i expect it... oh, oops :) | 02:24 | ||
02:25
ggoebel_ left
|
|||
timotimo | oh, yeah, this will be slooooooow | 02:28 | |
i have a version now that works and outputs ascii "art" | 02:43 | ||
02:45
isBEKaml joined
02:48
arlinius joined
02:49
dayangkun joined
|
|||
timotimo | slowperl is slow | 02:50 | |
timotimo tries on niecza | 02:57 | ||
oh, timing the run while compiling niecza doesn't make terribly much sense | 02:58 | ||
i hope i won't have to change too many things to make it run :| | 02:59 | ||
changing the somewhat clever position checking code that used junctions to not using junctions makes niecza work and it's significantly faster | 03:09 | ||
03:09
zacts joined,
orafu left,
orafu joined
|
|||
timotimo | 3:05.30elapsed <- rakudo | niecza -> 0:12.30elapsed | 03:09 | |
for a 60x60 field with 500 particles | 03:10 | ||
isBEKaml | 3 hrs? | ||
timotimo | minutes | 03:11 | |
isBEKaml | *whew* :D | ||
timotimo | ;) | ||
i wonder if niecza will get functioning junctions? | |||
colomon | n: my $a = 5; say "Now?" if $a = 4 | 5 | 6; | 03:12 | |
timotimo | niecza is in reduced development mode, right? | ||
p6eval | niecza v24-33-gfc6d5fd: OUTPUT«Now?» | ||
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 99 109 1110 910 1010 1111 911 1011 11» | ||
timotimo | oh? | ||
colomon | Right now TimToady and I make occasional minor Niecza changes to track new bits of std, and that's about it. | ||
timotimo | so it *should* in theory have worked? | ||
colomon | timotimo: I don't know what you tried to do. | ||
(I mean, more specifically than "used junctions") | 03:14 | ||
timotimo | while not %W{($x-1|$x|$x+1) ~ "|" ~ ($y-1|$y|$y+1)} :exists { | 03:15 | |
this was supposed to check all the neighbours of the particle for existing particles | |||
that check never triggered | |||
oh, indeed. this is interesting | 03:17 | ||
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! | |||
zacts | is perl6 usable now for everyday projects? | ||
timotimo | so junctions work, but nested junctions don't? | ||
colomon | n: my $x = 10; my $y =11; say ($x-1|$x|$x+1) ~ "|" ~ ($y-1|$y|$y+1) | 03:18 | |
p6eval | niecza v24-33-gfc6d5fd: OUTPUT«any(9, 10, 11)|any(10, 11, 12)» | ||
timotimo | yup, that's broken indeed | ||
colomon | r: my $x = 10; my $y =11; say ($x-1|$x|$x+1) ~ "|" ~ ($y-1|$y|$y+1) | ||
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))» | ||
timotimo | do you feel like that would be something niecza should get? | ||
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 | ||
timotimo | oh? huh? | 03:22 | |
03:22
adu_ left
|
|||
timotimo | "If two or more arguments are junctive, then the argument that is chosen to be "autothreaded" is:" does that help? | 03:23 | |
03:24
Rix left
|
|||
colomon | lue: I would think that infix:<~> is supposed to autothread. | 03:24 | |
timotimo | gotta run | ||
bbl, though | |||
lue | I also expect it to concatenate strings, not magically cause behavior similar to infix:<Z> or infix:<X> | 03:25 | |
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
03:30
isBEKaml` joined
|
|||
timotimo | but junctions are magic | 03:31 | |
lue | r: say any(9,10,11) | any(10,11,12) | ||
p6eval | rakudo 8ea992: OUTPUT«any(any(9, 10, 11), any(10, 11, 12))» | ||
colomon | I've got to say I'm not at all sure I understand nested anys. | ||
timotimo | so why should tilde magically override the magic of junctions? | ||
03:32
isBEKaml left
|
|||
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:32 | |
03:32
isBEKaml` is now known as isBEKaml
|
|||
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:33 | |
in particular a strong is inconsistent with the junction type | 03:34 | ||
lue | r: say (1|2|3).Str | ||
p6eval | rakudo 8ea992: OUTPUT«any(1, 2, 3)» | ||
lue | wait, so infix:<~> doesn't coerce to Str? | ||
colomon | nr: say (1|2|3|) ~ "hello" | ||
p6eval | niecza v24-33-gfc6d5fd: OUTPUT«===SORRY!===Bogus term at /tmp/DGAnIT3ZNi line 1:------> say (1|2|3|⏏) ~ "hello"Parse failed» | 03:35 | |
..rakudo 8ea992: OUTPUT«===SORRY!===Bogus statementat /tmp/y4ytKNausK:1------> say (1|2|3|⏏) ~ "hello" expecting any of: postfix infix stopper infix or meta-infix prefix or term prefix or meta-prefix»… | |||
colomon | nr: say (1|2|3) ~ "hello" | ||
p6eval | rakudo 8ea992: OUTPUT«any(1hello, 2hello, 3hello)» | ||
..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… | |||
timotimo | this is the string coercion called on each own item | ||
colomon | nr: say (1|2|3) + 3 | ||
p6eval | rakudo 8ea992, niecza v24-33-gfc6d5fd: OUTPUT«any(4, 5, 6)» | ||
colomon | hmmm... works on infix:<+> but not infix:<~>? (in niecza) | 03:36 | |
timotimo | junction does not drive from any | ||
it is a sibling to any | |||
03:37
isBEKaml left
|
|||
timotimo | that should be why it ought to auto thread | 03:37 | |
colomon, do you think sorear would agree to fix this? | 03:38 | ||
colomon | timotimo: no idae. | ||
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))» | ||
lue | r: say any(9,10,11) ~ "»ö«" ~ any(10,11,12) | ||
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))» | ||
colomon | timotimo: may be that I can fix it, if it's specific to infix:<~> | ||
03:40
adu_ joined
|
|||
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:41 | |
timotimo | oh, maybe a , would have been more idiomatic | 03:44 | |
i think nested anys are not too bad | 03:47 | ||
i mean this is mostly about evaluating as booleans | |||
so evaluate a nested any by evaluating all of the inner anys and see if any of then are true | 03:48 | ||
03:48
telex left
|
|||
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
03:51
xinming left
03:53
xinming joined
03:56
arlinius left
|
|||
timotimo | :) | 03:59 | |
rn: say substr("camel", 0|1, 2&3); | 04:02 | ||
p6eval | niecza v24-33-gfc6d5fd: OUTPUT«all(any("ca", "am"), any("cam", "ame"))» | ||
..rakudo 8ea992: OUTPUT«any(all(ca, cam), all(am, ame))» | |||
timotimo | now *that* is interesting | 04:03 | |
in this case, the specs say that rakudo is in the wrong and niecza is in the right | |||
TimToady | right | ||
timotimo | also, i managed to make niecza work correctly like this: | 04:04 | |
TimToady | no wait | ||
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 | ||
you resolve the left first | |||
p6eval | rakudo 8ea992: OUTPUT«(timeout)10|10().hash10|11().hash10|12().hash11|10().hash11|11().hash11|12().hash12|10().hash12|11().hash12|12().hashbup10|10().hash10|11().hash10|12().hash11|10().hash11|11().hash11|12().hash12|10().hash12|11().hash12|12().hash… | ||
..niecza v24-33-gfc6d5fd: OUTPUT«(timeout)10|10{}10|11{}10|12{}11|10{}11|11{}11|12{}12|10{}12|11{}12|12{}bup10|10{}10|11{}10|12{}11|10{}11|11{}11|12{}12|10{}12|11{}12|12{}bup10|10{}10|11{}10|12{}11|10{}11|11{}11|12{}12|10{}12|11{}12|12… | |||
timotimo | oops, there's a say too much | ||
TimToady | so you should get substr("camel", 0, 2&3) as the first resolution | ||
timotimo | but you see how it says 10|11 and such? | ||
diakopter | please watch; decide to laugh for yourself: www.liveleak.com/view?i=df8_1362850413 | 04:06 | |
timotimo | perlcabal.org/syn/S09.html#Junctions - i took the example from here | ||
TimToady | oh, yes, by that niecza is righter | 04:07 | |
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" } | ||
p6eval | rakudo 8ea992: OUTPUT«===SORRY!===Undeclared name: W used at line 1» | ||
..niecza v24-33-gfc6d5fd: OUTPUT«===SORRY!===Undeclared name: 'W' used at line 1Unhandled 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… | |||
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" } | ||
that's what i meant to write. | |||
colomon | TimToady: any idea why niecza's infix:<~> takes an arbitrary number of arguments? | ||
timotimo | see how niecza now passes the inner junctions into $x and $y and they are then not autothreaded | ||
p6eval | niecza v24-33-gfc6d5fd: OUTPUT«(timeout)any(10, 11, 12),any(10, 11, 12)bupany(10, 11, 12),any(10, 11, 12)bupany(10, 11, 12),any(10, 11, 12)bupany(10, 11, 12),any(10, 11, 12)bupany(10, 11, 12),any(10, 11, 12)bupany(10, 11, 12),any(10, 11, 12)bupany(10, 11, 12),any(10, 11, 12)… | ||
..rakudo 8ea992: OUTPUT«(timeout)any(10, 11, 12),any(10, 11, 12)bupany(10, 11, 12),any(10, 11, 12)bupany(10, 11, 12),any(10, 11, 12)bupany(10, 11, 12),any(10, 11, 12)bupany(10, 11, 12),any(10, 11, 12)bupany(10, 11, 12),any(10, 11, 12)bupany(10, 11, 12),any(10, 11, 12)bupany(… | |||
TimToady | timotimo++ for actually reading the spec :) | 04:09 | |
timotimo | er, wait, what? | ||
rakudo show sthe same behavior? now i am thoroughly surprised. | |||
maybe parameters to pointy blocks are Mu by default | 04:10 | ||
rn: say (-> $x, $y { say $x, $y }).signature | |||
p6eval | rakudo 8ea992: OUTPUT«:(Mu $x, Mu $y)» | ||
..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… | |||
timotimo | ah, indeed! | ||
TimToady | colomon: ~ is list associative | ||
colomon | TimToady: ah | 04:11 | |
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)))» | ||
timotimo | diakopter: the translation must be made up | 04:13 | |
i cannot explain it any other way | |||
diakopter | I strongly believe the translation is true | ||
timotimo | in that case, that's ridiculous | 04:14 | |
anyway, i'll go get my almost-daily cup of hot snow | |||
diakopter | that a country would give such ludicrous propaganda to its prisoners/victims? | 04:15 | |
mmm tasty snow | 04:16 | ||
timotimo | do they expect the people will believe this? or is this a kind of "throw feces enough and something will stick" situation? | 04:17 | |
diakopter | likely most of them don't have any evidence to the contrary, so why not believe it | 04:18 | |
timotimo | hmm, probably true | ||
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:41 | ||
04:46
adu_ left
04:52
preflex_ joined
04:54
preflex left,
preflex_ is now known as preflex
05:05
census joined
05:20
SamuraiJack joined,
adu joined
05:35
adu left,
adu joined
05:36
adu left,
adu joined
06:12
zacts left
06:23
census left
06:24
adu left
06:34
adu joined
06:41
adu left
06:46
am0c joined
07:00
raiph left
07:02
raiph joined
07:13
kaare__ joined
07:16
wk joined
07:18
jaldhar_ left
07:20
jaldhar_ joined
07:24
xinming left
07:26
xinming joined
07:34
FROGGS joined
07:35
jaldhar_ left
07:38
jaldhar_ joined
07:39
SamuraiJack left,
SamuraiJack joined
08:19
Myk267 joined,
isomorphisms left
08:23
Myk267 left
09:05
wk left
09:07
SamuraiJack_ joined,
SamuraiJack left
09:15
_ilbot left
09:17
Khisanth left
09:19
donaldh left
09:21
donaldh joined
09:23
_ilbot joined
09:24
kst joined
09:32
Khisanth joined
09:44
spider-mario joined
09:51
DarthGandalf joined
|
|||
masak | good antenoon, #perl6 | 09:57 | |
FROGGS | hi masak | 09:58 | |
masak | <zacts> is perl6 usable now for everyday projects? | 10:01 | |
this went unanswered in the backlog. | |||
diakopter | masak: HI | 10:07 | |
masak: zacts is still logged in, just not on this channel :) | |||
masak | also, I had no idea America was in such a bad place. | 10:08 | |
good thing that the trees are still full of snow to heat. | |||
10:10
jac50 joined
|
|||
sorear | are you referring to the storm system on the other side? | 10:10 | |
masak | I'm referring to irclog.perlgeek.de/perl6/2013-03-10#i_6570639 | 10:11 | |
seriously, the North Korean who put that together seems to have an unhealthy fixation with heating snow. | |||
s/with/on/ | 10:12 | ||
diakopter | masak: yes, it's terrible. | ||
there are some classic lines in there | |||
masak | "They will be eaten on Tuesday." being one of them? :) | ||
diakopter | truly poetic | ||
sorear | heating snow? is that what they use in the DPRK because they can't afford coal? | 10:13 | |
diakopter | sorear: watch the video to join the in-joke :) | 10:14 | |
it's short. | |||
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 | ||
jnthn | "The other parts of America, often disguised as foreign countries in Europe..." | ||
masak | :P | ||
oh, *that's* what he said. | 10:16 | ||
imagine the work that must have gone into suspending disbelief *prior* to this video. | |||
that's almost more scary. | 10:17 | ||
FROGGS | they are yummi >.< | ||
*g* | |||
hehe | |||
jnthn | "These telephones no longer work. There is noone to call" | ||
masak | FROGGS: yeah, but there's only one cup of hot snow per person per day. | ||
FROGGS | ya, hehe | ||
diakopter | jnthn: ROTFL. | ||
masak | at least the poor Americans get cake in the end by the kindly North Koreans. | 10:18 | |
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? | ||
FROGGS | masak: but "friends" is just made up | ||
FROGGS makes more hot snow | 10:21 | ||
diakopter makes yellow snow | |||
FROGGS | O.o | ||
eeeeks | |||
masak | huf: oh, true. death to the bourgeoisie. | 10:22 | |
diakopter | ownership is overrated | ||
masak | there's probably even enough bums in the series to still make the hot-snow video credible. | ||
diakopter | also Seinfeld | 10:23 | |
huf | masak: now you're talking! :) | ||
masak | and Phoebe used to live in a cardboard box. | ||
huf | masak: that's just her being excentric | ||
the rich have strange tastes | 10:24 | ||
sorear | .oO( the moon of Saturn? ) |
||
most commonly spelled 'eccentric' around here | |||
masak | yes, that's the spelling, everywhere :) | ||
huf | huh. my dict lied to me then. | 10:25 | |
masak | oh, br "excentric". | ||
my bad :) | |||
diakopter | reminds me of execrable | ||
masak | that word seems to be trending on Twitter recently. | 10:26 | |
10:30
jac50 left
|
|||
diakopter | anyone here have access to springerlink? | 10:30 | |
FROGGS | hmmm, it answeres the question as well if I dont know what it is, I guees :/ | 10:32 | |
10:33
fhelmberger joined
|
|||
masak | clearly it has something to do with knights :) | 10:34 | |
or links to knights. | |||
or left of knights. | |||
10:35
fhelmberger left
|
|||
FROGGS | or about somebody who is bad to knights | 10:35 | |
arnsholt | diakopter: Via my university, yeah | ||
10:36
huf left
|
|||
masak | rn: say 0 ** 0 | 10:42 | |
p6eval | rakudo 8ea992, niecza v24-33-gfc6d5fd: OUTPUT«1» | ||
10:46
huf joined
11:01
am0c left
|
|||
grondilu | about the new List permutation method: why is it not a Positional method? | 11:02 | |
(so that one can get it when implementing Positional) | |||
jnthn | Generally, .foo => .list.foo delegators live in Any | ||
masak | it's not really "feature envy", it's more like "feature skew". | 11:04 | |
jnthn | urks | 11:05 | |
NQP has support for BUILD. However, since there are no submethods in NQP, one BUILD is seen for all subclasses. | 11:06 | ||
Which is why the dupe SC registrations... | |||
masak | :( | ||
maybe make it a sub? | 11:07 | ||
jnthn | Just gonna make BUILDPLAN only look for methods in exactly that class. | ||
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
|
|||
jnthn | Guess I musta just forgot to add the check... | 11:08 | |
arnsholt | One of the benefits of multiple backends | 11:12 | |
masak .oO( port to another platform! you'll find bugs, we promise! ) | 11:17 | ||
11:19
isBEKaml joined
|
|||
dalek | p: e408df4 | jnthn++ | src/how/NQPClassHOW.pm: Lookup of BUILD shouldn't see inherited ones. Doing it this way since NQP has no submethods. |
11:19 | |
p-jvm-prep: ecd78f9 | jnthn++ | nqp-src/nqp-mo.pm: Get BUILD fix. |
11:20 | ||
Ulti | diakopter: I have access to springer link afaik | 11:23 | |
isBEKaml | OHHAI, #perl6! | 11:36 | |
11:36
dayangkun left
|
|||
masak | o/ | 11:39 | |
isBEKaml | masak: You should vacation more often. Your bug-finding-productivity shot up in the first week! :P | 11:41 | |
11:45
not_gerd joined
|
|||
not_gerd | o/ | 11:45 | |
11:46
wk joined
|
|||
masak | isBEKaml: I know! and yes, I *should* vacation more often! :P | 11:48 | |
masak gets on a train | 11:49 | ||
12:00
woosley1 joined
|
|||
masak | teaching Perl for two days :) | 12:22 | |
spider-mario | :) | 12:23 | |
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." -- perl.plover.com/yak/12views/samples/notes.html | 12:25 | |
isBEKaml | that's MJD, right? | 12:26 | |
masak | yes. | 12:27 | |
MJD++ | |||
isBEKaml | ah, yes - I liked his HOP book. :) | ||
12:31
SunilJoshi joined
|
|||
masak | the whole of Talk 4 can be obsoleted with one word nowadays: Moose. | 12:31 | |
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. | ||
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:37 | |
(of books to read) | 12:38 | ||
tadzik | ph<TAB><TAB> | 12:39 | |
phenny, oh, where are you now :( | |||
anyway, I added rosettacode.org/wiki/Documentation#Perl_6 just now :) | |||
not_gerd just fixed sockets | |||
now, if only someone would take on irclog.perlgeek.de/perl6/2013-03-09#i_6569852 | |||
masak | tadzik: s/as it happened in Perl 5/as in Perl 5/ | 12:41 | |
Perl 5 is not gone, and Perl 6 is not replacing it ;) | |||
tadzik | ohh, I really wrote that? :D | ||
fixed, thanks | 12:42 | ||
12:46
bowtie joined
12:47
cognominal joined,
SunilJoshi left
|
|||
jnthn | tadzik: Tehre's not an attributeHOW, thething is just called Attribute :) | 12:58 | |
13:00
isBEKaml left
13:01
cognominal left
13:04
SunilJoshi joined
13:08
SunilJoshi left
13:21
not_gerd left
|
|||
masak | rn: say pick 1..5 | 13:26 | |
p6eval | rakudo 8ea992: OUTPUT«Nil» | 13:27 | |
..niecza v24-33-gfc6d5fd: OUTPUT«» | |||
colomon | rn: say (1..5).pick | 13:28 | |
p6eval | rakudo 8ea992, niecza v24-33-gfc6d5fd: OUTPUT«2» | ||
tadzik | jnthn: yeah, I noticed I still haven't fixed WHY there | 13:29 | |
it does not segfault now, but the test fails | |||
also: anyone willing to share a cheap room for YAPC::EU? | |||
grondilu | tadzik: shouldn't you have used #| instead of #= at the beginning of blocks? | 13:34 | |
grondilu talks about rosettacode.org/wiki/Documentation#Perl_6 | 13:35 | ||
13:35
cognominal joined,
PacoAir joined
|
|||
tadzik | grondilu: not if I'm talking about working examples :> | 13:35 | |
grondilu | oh, ok | ||
tadzik | I still haven't stopped feeling uneasy about #| :) | 13:36 | |
is it spec already? | |||
grondilu | yeah, it has been for quite a long time, hasn't it? | ||
tadzik | heh, maybe | 13:41 | |
13:47
census joined
13:51
census left
14:00
zb left
|
|||
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:02 | |
14:08
jlaire joined
|
|||
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:09 | |
14:13
cognominal left
14:17
census joined
14:19
REPLeffect joined
|
|||
FROGGS | tadzik: rosettacode.org/wiki/Documentation#Perl_6 # say say? | 14:21 | |
14:22
Psyche^ joined
|
|||
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» | ||
..niecza v24-33-gfc6d5fd: OUTPUT«alive» | |||
masak | rakudo, what in all the... | ||
masak refuses to swear very loudly, to avoid a long discussion with jnthn about the excellent stability of Rakudo in 2013 :( :( :( | 14:25 | ||
14:25
domidumont joined
|
|||
masak submits a rakudobug | 14:25 | ||
14:25
Patterner left,
Psyche^ is now known as Patterner
|
|||
FROGGS | rn: sub x { return 2 for 1 }; my $three = x; say "alive" | 14:26 | |
p6eval | rakudo 8ea992: OUTPUT«alive» | ||
..niecza v24-33-gfc6d5fd: OUTPUT«Potential difficulties: $three is declared but not used at /tmp/VrWBbBK_BI line 1:------> sub x { return 2 for 1 }; my ⏏$three = x; say "alive"alive» | |||
FROGGS | masak: so it's sink context? | 14:27 | |
masak | good catch. yes, must be. | ||
FROGGS | new features always come with new bugs bundled :o) | ||
masak | the RT ticket will not contain any bile against Rakudo, by the way. | ||
I vent here, not on RT. | 14:28 | ||
rn: sub x { return }; x; say "alive" | 14:29 | ||
p6eval | rakudo 8ea992, niecza v24-33-gfc6d5fd: OUTPUT«alive» | ||
14:30
cognominal joined
|
|||
FROGGS | might be good to assign it to moritz | 14:30 | |
masak | feel free. | ||
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» | ||
masak | no, it's not sink context. | ||
masak adds to the ticket | 14:33 | ||
FROGGS | hmmmm | ||
tadzik | FROGGS: whoops whoops | ||
FROGGS | tadzik: :o) | ||
tadzik | fixed, thanks :) | 14:34 | |
14:35
mtk left
|
|||
masak | should I unassign moritz? :) | 14:35 | |
better not. something tells me that even if this isn't directly related to sink context, maybe it's indirectly related. | 14:37 | ||
14:38
mtk joined
|
|||
masak decides to do a bisect | 14:38 | ||
FROGGS | nom: sub x { return 5 for 1 }; say x | ||
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» | ||
FROGGS | masak++ | 14:39 | |
masak | using a while loop is a decent workaround, by the way. | ||
14:43
not_gerd joined
|
|||
not_gerd | r: sub x { sink return 5 for 1 }; say x | 14:43 | |
p6eval | rakudo 8ea992: OUTPUT«5» | ||
not_gerd | looks like sink context to me | 14:44 | |
14:44
pmurias joined
|
|||
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 | ||
that's bitten me with gather/take as well | 14:45 | ||
masak adds this to the ticket | |||
pmurias | jnthn: what would be the best way to compile a single file to both javascript and pir (under the new backend seperation scheme) | ||
jnthn | sub x { return for 1 }; x; say "alive" | 14:47 | |
So, the for is really a map and it's not in sink context. | |||
So the return executes afterwards. | 14:48 | ||
not_gerd | lexotic return should probably force sink context | ||
jnthn | ...what? | 14:49 | |
After Rakudo got sink context and people discovered these things, something got spec'd to the degree it should tell you about this. | |||
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 | ||
jnthn | As for whining about stability, well, it's easy to be stable if we ignore the spec. | ||
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. | ||
jnthn | Then go whine about the spec. | ||
masak | yes. | 14:51 | |
maybe I simply really dislike this type of unexpected laziness. | |||
clearly, *clearly* it was not my intent as a programmer, to return outside of the routine! arrrgh! | |||
jnthn | masak: github.com/perl6/specs/commit/e5b8...08ca9d220a | ||
That's the bit added in response to pepole running into the thing you mentioned. | 14:52 | ||
Especially the last paragraph. | |||
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. | ||
masak | "...which may surprise some people." -- YA THINK!? | ||
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. | ||
it was literally a "hey, I can move this return inside of the for loop" moment. | |||
masak glares on the spec | |||
not_gerd | lexoticity and least surprise > laziness | ||
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" | ||
p6eval | rakudo 8ea992, niecza v24-33-gfc6d5fd: OUTPUT«5alive» | ||
masak adds "always put an unnecessary 'return' after the last 'for' in a routine" to his list of best Perl 6 practices | 14:57 | ||
not_gerd | personally, I'd just make for eager by default | 14:58 | |
but what do I know ;) | |||
masak | yes, I expect for loops to be eager. | 14:59 | |
and it doesn't seem to be just TimToady who likes to indulge in the notion that 'for' and 'map' are exactly synonymous. | 15:00 | ||
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
|
|||
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 | ||
masak | +1 | ||
jnthn | Except then you can't use for the write list comprehensions. | ||
*to | |||
Or do for | |||
masak | for some reason I'm fine with statement_mod for yielding results. | 15:05 | |
but for the block form to do it feels wasteful and weird. | |||
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:07 | |
masak | thank you for your time. sorry about being grouchy when things break my code. | 15:08 | |
15:08
woolfy joined,
am0c joined
|
|||
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 | ||
jnthn | timotimo: I believe it's registered under the same name | 15:12 | |
timotimo | oh, ok | ||
jnthn | not_gerd: I'm guessing it's just at bytes at this level, so probably it's OK.. | ||
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 | ||
timotimo | scratch that, that wasn't actually correct. | ||
not_gerd | (bounds of valid data in buffer, that is) | ||
jnthn | not_gerd: OK | ||
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 | ||
jnthn | timotimo: Hmm. | ||
timotimo | so maybe it's the compilation step that failed, because that woul dhave set $rxsub? or maybe the cursor isn't right ... | ||
not_gerd | jnthn: it does fix HTTP::Easy for me | ||
but see the XXX in the rakudo patch | 15:15 | ||
the problem is that Parrot's readline does not guarantee to actually read a line for sockets | |||
timotimo | uh, i added a debug say statement and now the tests run (and fail) ... ?! | ||
not_gerd | imo that's a problem with parrot and should be fixed there | ||
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 | ||
timotimo: Does the error you see mention islist anywhere? | 15:18 | ||
15:19
snuffles joined
|
|||
timotimo | nope, just lots and lots of invoke and invokeInternal | 15:19 | |
jnthn | hmm | 15:20 | |
timotimo | when you said it's registered under the same name, you did mean to tell me to run "getcomp('QRegex::P6Regex'), right? | 15:21 | |
FROGGS | jnthn: when I get a Regex passed to INTERPOLATE, its .NFA gives me an RPMCA of RPMCAs of integers, is that right? | 15:22 | |
jnthn | timotimo: Yeah | 15:23 | |
timotimo | how do i safely figure out if the things like $rxsub and $cursor have sane contents? | ||
jnthn | timotimo: You can see it being registered under that name at the bottom of NQPP6Qregex.pm | ||
Just checked that bit | |||
Well, can do $obj.HOW.name($obj) to check they're the expected kind of thing | 15:24 | ||
FROGGS: Yes. | |||
timotimo | mhm | ||
jnthn | FROGGS: That's a thing you can pass into merge_substates | ||
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 | |
timotimo: Something odd...islist does a null check... | |||
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... | ||
FROGGS: Ah, that explains it ;) | |||
timotimo | say($rxsub.HOW.name($rxsub)); - gives me a null pointer exception | 15:28 | |
FROGGS | hmmmm, I think I should write a cronjob that saves `git diffs` of nqp and rakudo every ten minutes | 15:29 | |
jnthn | timotimo: Yeah, same underlying issue. | 15:30 | |
timotimo: Think I'm getting clsoe on it... | |||
pmurias | spec discussion aside, it's the error message for return called from outside the routine less than awesome? | ||
timotimo | neat :) | ||
15:31
mberends left
15:32
cognominal left
|
|||
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:32 | |
I understand the reason that it does, too. it has to do with iterators and laziness. | 15:33 | ||
jnthn | timotimo: Oh, hm. | ||
timotimo: Seems that the actual issue is that an internals-y compilation unit object is leaking out where an invokable thingy is expected. | 15:34 | ||
timotimo | whoops, okay | 15:35 | |
15:40
sqirrel joined
|
|||
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:40 | |
jnthn | FROGGS: Not sure what you mean...example? | 15:41 | |
15:43
ruoso joined
|
|||
FROGGS | rn: say "aaaaaaaaaaab" ~~ /<"a+b">+/ | 15:43 | |
p6eval | rakudo 8ea992: OUTPUT«===SORRY!===Unrecognized regex metacharacter < (must be quoted to match literally)at /tmp/LWE1tVBTMm:1------> say "aaaaaaaaaaab" ~~ /<⏏"a+b">+/Unrecognized regex metacharacter " (must be quoted to match literally)at /tmp/LW… | ||
..niecza v24-33-gfc6d5fd: OUTPUT«===SORRY!===Unrecognized regex assertion at /tmp/JrfjZtEQ4J line 1:------> say "aaaaaaaaaaab" ~~ /<⏏"a+b">+/Parse failed» | |||
FROGGS | rn: say "aaaaaaaaaaab" ~~ /<$("a+b")>+/ | ||
p6eval | rakudo 8ea992: OUTPUT«「aaaaaaaaaaab」» | ||
..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… | |||
jnthn | There's nothing to decide in that case, though? | 15:44 | |
You jsut eval and run? | |||
Are you thinking more like /<@(...)>/ style things? | |||
FROGGS | r: say "aaaaaaaaaaab" ~~ /<@("a+b", "\d", "b")>+/ | ||
p6eval | rakudo 8ea992: OUTPUT«===SORRY!===Unrecognized backslash sequence: '\d'at /tmp/UXXU2kDe0A:1------> say "aaaaaaaaaaab" ~~ /<@("a+b", "\⏏d", "b")>+/ expecting any of: postfix infix stopper infix or meta-infix pref… | ||
FROGGS | right | ||
r: say "aaaaaaaaaaab" ~~ /<@("a+b", "\\d", "b")>+/ | |||
p6eval | rakudo 8ea992: OUTPUT«「aaaaaaaaaaab」» | ||
jnthn | Is that not the same as /<@a>/ generally? | 15:45 | |
FROGGS | jnthn: it is | ||
jnthn | timotimo: Think I've got a fix | ||
FROGGS | I just asks if there is a cleverer way instead of evaling an anon regex | ||
timotimo | masak: do you know when the recording of your talk at fosdem recently can be uploaded or if it already is? | 15:47 | |
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:48 | |
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 | ||
FROGGS: But I'm not sure it's worth it. | |||
FROGGS: You'd have to then go and finish compiling the winner(s) | |||
I think it's probably a premature opt. | 15:50 | ||
15:50
kst` joined
|
|||
FROGGS | hmmmm, okay | 15:51 | |
15:52
kst left
|
|||
masak | timotimo: I have no idea. | 15:52 | |
timotimo: I try not to sit around waiting for conf talks to be uploaded. it tends to be a while :) | 15:53 | ||
timotimo | right :( | ||
i think i remembered whoever recorded that said it was at that time unencoded, but otherwise ready to get uploaded | |||
was it lizmat? | |||
dalek | p-jvm-prep: 79e176f | jnthn++ | lib/QAST/JASTCompiler.nqp: A little re-org. |
15:58 | |
p-jvm-prep: ef1be4e | jnthn++ | nqp-src/NQP (2 files): Don't leak compunits out, in general. Just give them to things that know what to do with them. |
|||
p-jvm-prep: ddf70f4 | jnthn++ | nqp-src/NQPP6QRegex.pm: Fix handle uniqueness issue. |
|||
p-jvm-prep: 43862dd | jnthn++ | t/nqp/49-regex-interpolation.t: 8ac4de5 | jnthn++ | src/org/perl6/nqp/runtime/Ops.java: |
|||
jnthn | heh, it lost two lines | ||
timotimo: Hopefully those help | |||
timotimo | i'll test | ||
16:00
am0c left,
PacoAir left
|
|||
timotimo | yesterday was the first time i missed loop labels in perl6 | 16:00 | |
i wanted to redo an outer for loop from inside a while loop and couldn't (at least not easily) | 16:01 | ||
16:02
PacoAir joined,
PacoAir left
16:03
PacoAir joined,
census left
|
|||
ruoso | timotimo, you have both control and error exceptions in Perl 6, you can do it that way | 16:05 | |
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 | |
jnthn: that makes matches succeed, cool! | 16:10 | ||
but now: stack overflow errors happen at some point | |||
masak | balanced brackets: 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 | |
if anyone knows of a better way to generate uniformly random balanced-bracket strings, I'd be very interested to know. | |||
timotimo | interesting, there's a null pointer exception, too ... | 16:13 | |
16:15
rindolf joined
16:21
LlamaRider joined
|
|||
timotimo | jnthn: paste.ee/p/yfryu - does this make any sense to you? the first 20 regex tests succeed and this one fails | 16:21 | |
it seems like the NPE results from the call to dump_str on the match object | 16:22 | ||
hm, maybe that's what it does if the regex doesn't match the string or something? | 16:23 | ||
16:29
pmurias left
16:34
Chillance joined
|
|||
jnthn | timotimo: My best guess is that the CATCH block is hit and then something it does causes an exception. | 16:35 | |
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! | ||
jnthn | The top mention of it dying in what are telling though | ||
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 | |
should i comment out all regex tests that cause this behavior as kind of a "todo" thing and commit the rest to the repo? | |||
jnthn | timotimo: You could do that, yes | ||
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 | ||
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... | ||
timotimo | not sure what the $_ is though | ||
jnthn | The exception I guess... | ||
timotimo | could be, yes | ||
jnthn | nqp-jvm: try { nqp::die('omgz'); CATCH { say("here") } } | 16:40 | |
p6eval | nqp-jvm: OUTPUT«here» | ||
jnthn | nqp-jvm: try { nqp::die('omgz'); CATCH { say(~$_) } } | ||
p6eval | nqp-jvm: OUTPUT«Exception in thread "main" Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "main"» | ||
timotimo | fwiw, when i comment out that code the tests all run (and of course that's not a fix at all) | ||
jnthn | nqp-jvm: try { nqp::die('omgz'); CATCH { say($_.WHAT) } } | ||
p6eval | nqp-jvm: OUTPUT«» | ||
jnthn | nqp-jvm: try { nqp::die('omgz'); CATCH { say($_.HOW.name($_)) } } | 16:41 | |
p6eval | nqp-jvm: OUTPUT«BOOTException» | ||
jnthn | nqp-jvm: try { nqp::die('omgz'); CATCH { say(nqp::getmessage($_)) } } | ||
p6eval | nqp-jvm: OUTPUT«omgz» | ||
timotimo | should i use getmessage instead of ~$_? | ||
jnthn | You can try that, for sure. | 16:42 | |
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 | |
i'll be afk for a bit | |||
16:43
cognominal joined
|
|||
jnthn | timotimo: When you get back, ^^ may help (still need the getmessage) | 16:46 | |
16:51
crab2313 left
16:54
SamuraiJack_ left,
SamuraiJack__ joined
17:08
simcop2387 left
|
|||
lizmat | timotimo: thanks for the reminder about FOSDAM talks. | 17:08 | |
not all of them got recorded, or completely recorded | 17:09 | ||
most of them are not quite in focus, and in HD | |||
I'm wondering whether it makes sense to downgrade the video quality even further for downloadable / streamable experience | 17:10 | ||
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:12 | ||
lizmat afk for most of the evening | 17:14 | ||
17:19
simcop2387 joined,
simcop2387 left,
simcop2387 joined
|
|||
timotimo | oh, right | 17:19 | |
i'll check that change after a commute, jnthn :) | 17:20 | ||
17:20
skids joined
17:21
PacoAir left
|
|||
grondilu | rakudo warns me about useless use of [] with metaoperator? | 17:21 | |
rn: sub infix:<m+> { ($^a + $^b) mod 13 }; say ^13 Z[m+] ^13; | |||
p6eval | niecza v24-33-gfc6d5fd: OUTPUT«0 2 4 6 8 10 12 1 3 5 7 9 11» | ||
..rakudo 8ea992: OUTPUT«Potential difficulties: Useless use of [] around infix op at /tmp/AKRpun407P:1 ------> :<m+> { ($^a + $^b) mod 13 }; say ^13 Z[⏏m+] ^13;0 2 4 6 8 10 12 1 3 5 7 9 11» | |||
17:22
PacoAir joined
|
|||
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; | ||
p6eval | std 86b102f: OUTPUT«===SORRY!===Null pattern not allowed at /tmp/icKAMFYlcu line 1:------> say ^13 Z[m+⏏] ^13; expecting any of: infix or meta-infix regex atom semicolon list statement endParse failedFAILED 00:00 45m»… | ||
jnthn | oops | ||
std: sub infix:<m+> { ($^a + $^b) mod 13 }; say ^13 Z[m+] ^13; | 17:23 | ||
p6eval | std 86b102f: OUTPUT«ok 00:00 46m» | ||
colomon | n: sub infix:<m+> { ($^a + $^b) mod 13 }; say ^13 Z[m+] ^13; | ||
p6eval | niecza v24-33-gfc6d5fd: OUTPUT«0 2 4 6 8 10 12 1 3 5 7 9 11» | ||
jnthn | grondilu: I incorporated that message from STD yesterday. It's not meant to trigger inside of a meta-op. | ||
grondilu | well, it does, apparently. | ||
17:24
isomorphisms joined
17:26
not_gerd left
17:28
jac50 joined
|
|||
grondilu | r: say ^3 Z[+] ^3 | 17:30 | |
p6eval | rakudo 8ea992: OUTPUT«0 2 4» | ||
jnthn | huh, it only triggers it on a user-defined op? | 17:39 | |
17:39
James_ joined,
James_ is now known as Guest71434
17:43
jac50 left
17:45
bbkr joined
17:49
Guest71434 is now known as jac50
|
|||
masak | rn: 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:50 | |
..rakudo 8ea992: OUTPUT«[[]][[]][[]]» | |||
masak | hm, I wonder what Niecza stumbles on there. | ||
that's a weird error. reproducible locally. | 17:51 | ||
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… | ||
..rakudo 8ea992: OUTPUT«42» | |||
masak | there it is. | ||
17:55
cognominal left
|
|||
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… | ||
..rakudo 8ea992: OUTPUT«42» | |||
jnthn | (just checking it's not a precedence discrepancy) | 17:57 | |
17:57
stevan_ left,
stevan_ joined
18:02
cognominal joined,
stevan_ left
|
|||
dalek | kudo/nom: 5963753 | jnthn++ | src/Perl6/Grammar.pm: Turn off check giving false positives for now. |
18:06 | |
kudo/nom: 8d510e3 | jnthn++ | src/Perl6/ModuleLoader.pm: One pir:: => nqp::. |
18:09 | ||
18:11
census joined,
marloshouse left
18:12
cognominal left
18:13
PacoAir_ joined
18:14
PacoAir left,
PacoAir_ is now known as PacoAir
|
|||
timotimo | jnthn, were you going to make exceptions work soon? | 18:15 | |
jnthn | timotimo: Finishing that lot up is fairly high on my todo list, yes. | 18:16 | |
(Probably next few days.) | |||
timotimo | neato | ||
jnthn | afk for a bit | ||
timotimo | maybe i will be able to get the regex tests in acceptable shape today | 18:17 | |
18:18
cognominal joined
18:21
lichtkind_ joined
18:23
pmurias_ joined
18:24
pmurias joined
|
|||
pmurias | jnthn: what is needed for automatic precompilation for rakudo & nqp? | 18:24 | |
18:24
pmurias_ left,
lichtkind left
18:30
LlamaRider left
|
|||
arnsholt | Apparently the Rakudo dyncall library is "hardly maintained". That was news to me ^_^ | 18:33 | |
18:33
wk left
18:35
Targen left
|
|||
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 | |
pmurias: Then there's the "where do we store the pre-compiled things" which needs to be configurable. | 18:37 | ||
pmurias: An environment variable specifying that is a good start. | |||
arnsholt: Um, who said it was hardly maintained? o.O | |||
arnsholt | jnthn: lists.parrot.org/pipermail/parrot-d...07420.html | 18:38 | |
18:39
James_ joined
|
|||
jnthn | oh, parrot-dev... | 18:39 | |
18:40
James_ is now known as Guest40611
18:43
jac50 left
|
|||
arnsholt tries to ask about it in #parrot | 18:45 | ||
moritz | o/ | 19:00 | |
19:00
PacoAir_ joined
19:01
PacoAir left,
PacoAir_ is now known as PacoAir
|
|||
arnsholt | \o moritz | 19:02 | |
masak | moritz! \o/ | 19:03 | |
"oh, parrot-dev" pretty much sums it up. | |||
jnthn | welcome back, moritz :) | 19:06 | |
pmurias | jnthn: is it to be expected that defining HLL::Backend::JavaScript in a seperate file causes problems? | 19:07 | |
timotimo doesn't understand | 19:08 | ||
pmurias | jnthn: it's not seen, but HLLBackendJavaScript is | ||
jnthn | pmurias: Yeah, NQP's nested package handling is naive... | 19:10 | |
pmurias: Though not entirely sure why that case ain't handled... | 19:12 | ||
19:15
woolfy left
19:20
xinming left
19:22
xinming joined
19:32
SamuraiJack__ left
19:37
wk joined
19:38
sqirrel left
|
|||
pmurias | jnthn: isn't it a similiar reason to why you use QAST::CompilerJAST instead of QAST::Compiler::JAST? | 19:39 | |
jnthn | pmurias: Yes :) | ||
bbkr | star: use JSON::RPC::Client; JSON::RPC::Client.new( url => "bbkr.org:8080" ).locate('perlgeek.de').say # paid/free GeoIP database support :) | ||
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
|
|||
masak | whoa. | 19:41 | |
we don't accept system calls and file I/O on p6eval, but arbitrary *network* calls are OK? :P | |||
jnthn | masak: Sure, they're going to somebody else's system :P | 19:42 | |
masak | oh, indeed. | 19:43 | |
bbkr | github.com/bbkr/GeoIPerl6 - please test on your machines if you have some spare time | ||
19:44
Guest40611 left
|
|||
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? | ||
arnsholt | bbkr: Sorry for being so slow to respond to your Zavolaj bug reports, BTW | ||
My time on Macs has been greatly reduced recently =/ | |||
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:46 | |
19:48
PacoAir_ joined,
PacoAir left,
PacoAir_ is now known as PacoAir
|
|||
dalek | p: a4fa7e4 | (Arne Skjærholt)++ | src/6model/reprs/VMArray.c: Serialize and deserialize VMArray REPR data. |
20:00 | |
p: b553620 | (Arne Skjærholt)++ | src/6model/reprs/VMArray.c: Refactor get_pos_{int,float} logic. |
|||
p: e45782b | (Arne Skjærholt)++ | src/6model/reprs/VMArray.c: Refactor null_pos and set_pos_{int,float} logic. |
|||
p: 7399985 | (Arne Skjærholt)++ | src/6model/reprs/VMArray.c: Serialize and deserialize VMArrays. |
|||
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 :) | |||
arnsholt | That's a very good question! | 20:05 | |
repr_data is serialized as only the type object. The rest of it (bits and kind) is reconstructed from that | 20:06 | ||
The object itself is ->elems and then the elements | |||
Oh, and the serialization/deserialization loops branch on type for each element ATM | 20:09 | ||
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:20
PacoAir left
20:22
PacoAir joined
20:26
domidumont left
|
|||
Ulti | FROGGS: vimeo.com/61476623 sorry the quality is kind of low... the source video is better | 20:30 | |
20:33
kaare__ left
|
|||
timotimo | i get really weird behavior from the CATCH block, things like a pyramid of "not " before the "ok" :D | 20:33 | |
i think i shall wait for exceptions to work properly | |||
FROGGS | Ulti++ | 20:35 | |
20:39
James_ joined
20:40
James_ is now known as Guest14786
20:42
szabgab joined
|
|||
szabgab | good daytime | 20:42 | |
I have not been here for a while.... | 20:43 | ||
20:43
jac50 left
|
|||
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» | ||
Ulti | FROGGS: the original video is here 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? | ||
timotimo | hello mister gabo :) | ||
szabgab: the problem is different, the value of WHAT is the type class and those are undefined | 20:45 | ||
r: my $x = "text"; say "{ $x.WHAT.^name }" | 20:46 | ||
p6eval | rakudo 8d510e: OUTPUT«Str» | ||
szabgab | rakudo: my $x = "text"; say $x.WHAT | ||
p6eval | rakudo 8d510e: OUTPUT«(Str)» | ||
arnsholt | jnthn: What's the correct way to make an op create a sixmodel object? | ||
szabgab | timotimo: the thing is that I noticed this with some of the method calls in an application | ||
after compiling rakudo for the first time in monthes | 20:47 | ||
hmm, but I just wrote a simple example an it works there, strange, I need to look into those classes | 20:48 | ||
timotimo | well, feel free to paste it and i'll have a look (not that i'd be an expert or anything) | 20:49 | |
have you tried the debugger for rakudo yet? | |||
it's quite spiffy | |||
FROGGS | Ulti: I only use VLC, so that's pretty fine :o) | 20:52 | |
thanks! | |||
szabgab | oh, I am using qq{} in the code and not "" | ||
rakudo: my $x = "text"; say $x.WHAT | |||
p6eval | rakudo 8d510e: OUTPUT«(Str)» | ||
jnthn | arnsholt: allocate, then initialize | 20:53 | |
szabgab | err. sorry | ||
jnthn | arnsholt: See any of the box opes, for example | ||
*ops | |||
szabgab | class X { has $.name };my $z = X.new(name => 'Foo'); print " {$z.name} "; print qq{ {$z.name} } | 20:54 | |
rakudo: class X { has $.name };my $z = X.new(name => 'Foo'); print " {$z.name} "; print qq{ {$z.name} } | |||
p6eval | rakudo 8d510e: OUTPUT« Foo {X<-518084861>.name} » | ||
szabgab | so qq{ } is not the same as "" | 20:55 | |
? | |||
jnthn | szabgab: qq and "" imply the same thing | ||
szabgab: Trouble is that you picked {...} as your delimeters | |||
szabgab | it used to work | 20:56 | |
jnthn | Yes, Rakudo used to not follow the standard grammar properly there. | ||
Or maybe STD had it the other way around once too... | |||
szabgab | ah, so it was incorrect back then? | ||
jnthn | Yeah | ||
szabgab | oh my | ||
fixing the perl6maven.com generating code | |||
... | |||
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. | ||
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 | ||
r: say qq[ abc { "omgz".flip } def ] | 20:59 | ||
p6eval | rakudo 8d510e: OUTPUT« abc zgmo def » | ||
szabgab | timotimo: sorry or that :) now you know why ... | ||
I am fixing it right now | |||
jnthn: I go with [] | |||
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? | ||
masak | r: say qq{omg} | ||
p6eval | rakudo 8d510e: OUTPUT«omg» | ||
geekosaur | timotimo, as I read the above discussion, it's per spec | ||
masak | r: say qq{omg { 2 + 2 } wtf} | ||
p6eval | rakudo 8d510e: OUTPUT«omg { 2 + 2 } wtf» | ||
masak | timotimo: no, I think it's to spec. | ||
jnthn | timotimo: No, it's not a bug. | ||
21:01
rindolf left
|
|||
masak | std: qq{omg { $variable } wtf} | 21:01 | |
p6eval | std 86b102f: OUTPUT«===SORRY!===Variable $variable is not predeclared at /tmp/n03I4ldgLt line 1:------> qq{omg { ⏏$variable } wtf}Check failedFAILED 00:00 42m» | ||
masak | wtf :) | ||
FROGGS | hehe | ||
masak | oh right. | ||
timotimo | ok | ||
masak | yes, it still interpolates, of course. | ||
jnthn | yeah, if you take a look at STD's nibble | ||
It does | |||
|| <starter> <nibbler> <stopper> | |||
|| <escape> | |||
Meaning that a nesting of the delim beats and escape sequence. | 21:02 | ||
Closures are an escape. | |||
*an | |||
The top line is why you can do stuff like | 21:03 | ||
r: say q{ if $x = 42 { say "it's the answer" } } | |||
p6eval | rakudo 8d510e: OUTPUT« if $x = 42 { say "it's the answer" } » | ||
jnthn | And the nested { and } are counted | ||
21:04
bruges_ left
|
|||
masak | *nod* | 21:05 | |
21:06
bruges joined
21:10
Guest14786 left
21:18
not_gerd joined
|
|||
not_gerd | golfed my module compilation failure as far as I could | 21:20 | |
see github.com/gerdr/rakudobug if anyone wants to reproduce | |||
21:23
PacoAir left
21:24
PacoAir joined
|
|||
masak | not_gerd: nice golf. | 21:25 | |
not_gerd: ooc, how much of the module hierarchy is needed? | |||
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 | ||
masak | both levels? | 21:28 | |
not_gerd | I believe so, but feel free to experiment | ||
masak | it just seemed unlikely to my spider sense that *two* levels would be necessary to trigger the bug. | 21:32 | |
21:33
domidumont joined
|
|||
not_gerd | masak: I just tried again to remove either level, and both appear necessary | 21:36 | |
masak | ok. | 21:39 | |
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
domidumont left
|
|||
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. | ||
jnthn | I did fix a bunch of this stuff a while back. Thought I'd nailed these issues. :( | 21:41 | |
not_gerd | module load order is consistent: gist.github.com/gerdr/5130590 | 21:45 | |
I can create an RT ticket if so desired | |||
jnthn | not_gerd: Plesae do create the RT, and link to the github repo in it. | 21:47 | |
not_gerd: It's the best way to ensure it doesn't get lost. | |||
I'll try and look at it during this week though. | |||
timotimo | if i want to build my own "is foobar", i'll add a multi trait-mod:<is>(Routine $a, :foobar), right? | 21:48 | |
jnthn | _, not - | 21:49 | |
and :$foobar! | |||
timotimo | oh, ok | ||
jnthn | Make it required | ||
timotimo | why the $ though? | ||
jnthn | std: sub foo(:foobar) { } | 21:50 | |
p6eval | std 86b102f: OUTPUT«===SORRY!===Malformed parameter at /tmp/PmFKsqmcyb line 1:------> sub foo(:⏏foobar) { } expecting any of: formal parameter named parameterParse failedFAILED 00:00 42m» | ||
timotimo | ah, duh :) | ||
jnthn | Because it's not valid syntax without ;) | ||
21:51
szabgab left
|
|||
masak | maybe it should be... :) | 21:53 | |
std: sub foo(:$foobar) {} | |||
p6eval | std 86b102f: OUTPUT«ok 00:00 43m» | ||
masak | we admit sub foo(42), why not sub foo(:foobar) ? | ||
not_gerd | jnthn: just submitted as #117117 | 21:54 | |
++jnthn for looking into it | |||
colomon | masak: it has to have a named parameter with that name, we don't care what the value is? | 21:56 | |
masak | right. | 21:57 | |
jnthn | std: sub foo(:foobar()) { } | ||
p6eval | std 86b102f: OUTPUT«===SORRY!===Malformed parameter at /tmp/GBmxKAeYUI line 1:------> sub foo(:foobar(⏏)) { } expecting any of: named_param_term new name to be defined parameter routine_def signatureParse failedFAILED 00:00 42m»… | 21:58 | |
jnthn | std: sub foo(:\foobar) { } | ||
p6eval | std 86b102f: OUTPUT«ok 00:00 43m» | ||
jnthn | not_gerd: thanks | ||
'night, #perl6 | 22:03 | ||
diakopter | o/ | 22:04 | |
colomon | \o | ||
22:04
PacoAir left
|
|||
lue | hello o/ | 22:05 | |
diakopter | hi | 22:06 | |
masak | lue! \o/ | 22:07 | |
timotimo | i can use signatures in given/when, right? what's the signature for that? :| | 22:12 | |
i've tried ten things so far :| | |||
diakopter | (the_eleventh_thing) | ||
not_gerd | r: given \(42, :foo<x>) { when :($pos, :$foo!) { say 'works' } } | 22:13 | |
p6eval | rakudo 8d510e: OUTPUT«works» | ||
timotimo | oh, a ":" | 22:14 | |
i've tried \ and |, but neither worked. i did not expect :. thanks! | |||
masak | no-one expects the colon inquisition! | 22:15 | |
not_gerd | but everyone wants the colon | ||
I don't think that's true for the inquisition | 22:16 | ||
masak | though maybe for Spanish... :) | ||
timotimo | hehe | ||
r: given \(42, :foo<x>) { when :($pos, :$foo!) { say 'works'; say $pos } } | |||
p6eval | rakudo 8d510e: OUTPUT«===SORRY!===Variable '$pos' is not declaredat /tmp/2S9Ne0gBs7:1------> :($pos, :$foo!) { say 'works'; say $pos⏏ } } expecting any of: postfix» | ||
timotimo | do i need a pointy block? | ||
lue | r: given \(42, :foo<x>) { when :($pos, :$foo!) { say 'works'; say $_[0] } } | 22:18 | |
p6eval | rakudo 8d510e: OUTPUT«works42» | ||
timotimo | that's unfortunate :| | 22:19 | |
well, not really surprising though | |||
masak | I dunno. I could argue that one both ways. | ||
it would be a great thing for pattern matching if that one actually *did* bind $pos in the block. | 22:20 | ||
timotimo | you mean you wouldn't want names to be clobbered by signatures? | ||
masak | right, that could be an argument against. | ||
but it seems a weak argument to me. | |||
timotimo | that's what i intended to do | ||
not_gerd | r: given \(42, :foo<x>) { when :($pos, :$foo!) { (-> $pos, :$foo { say $pos })(|$_) } } | ||
p6eval | rakudo 8d510e: OUTPUT«42» | ||
masak | because the clobbering isn't really clobbering. it's lexical overriding. | ||
timotimo | ah, so a pointy block does make it work! (but very ugly :D) | ||
lue | may Signature<pos_var> ? | 22:21 | |
masak | $^pos ? | ||
make it a little shorter... | |||
anyway, 'night, #perl6 | |||
lue | r: sub foo($bar, :$bar) { say "I'm alive!" }; foo(1,:bar(2)); | ||
p6eval | rakudo 8d510e: OUTPUT«===SORRY!===Redeclaration of symbol $barat /tmp/xSY0IIybRR:1------> sub foo($bar, :$bar⏏) { say "I'm alive!" }; foo(1,:bar(2));» | ||
timotimo | 'night masak! | ||
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 $/ | ||
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. | ||
timotimo | does something speak against the syntax when -> $foo, :$bar { ... }? | ||
is that evil and terrible? | |||
22:26
pmurias left
|
|||
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" }; | ||
p6eval | rakudo 8d510e: OUTPUT«===SORRY!===Cannot use 'anon' with individual multi candidates. Please declare an anon-scoped proto insteadat /tmp/b1hYn0kgO0:1------> ulti sub marine($a) { "expect failure" }⏏; expecting any of: postfix s… | ||
lue | ?? /me is intrigued with anon proto ... | 22:30 | |
timotimo | oh that's interesting | ||
"Cannot put proto on anonymous routine" | 22:31 | ||
22:31
cognominal left
|
|||
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«59» | ||
timotimo | but that's not anonymous, that's called foo! | ||
lue | the anon makes in anonymous | ||
timotimo | so you have to identify it with a name, but the name gets discarded? | 22:33 | |
lue | perlcabal.org/syn/S02.html#Scope_declarators | ||
It gives pretty names for errors and allows for recursive anonymous subs. | 22:34 | ||
timotimo | hmm | 22:36 | |
doesn't seem very helpful | |||
22:38
cognominal joined
22:52
felipe left
22:53
spider-mario left
|
|||
not_gerd | you could also get rid of given/when and just do a multi dispatch on local subs | 22:53 | |
looks like there's an echo in here ;) | 22:54 | ||
timotimo: the closest I got to 'anonymous' dispatch using multis is gist.github.com/gerdr/5130877 | 22:55 | ||
22:56
xinming left
|
|||
not_gerd | bye, #perl6 | 22:56 | |
22:57
nyuszika7h is now known as 13WAAQHWO,
not_gerd left
|
|||
diakopter | o/ | 22:57 | |
22:58
xinming joined
|
|||
timotimo | that is ugly :( | 23:01 | |
23:04
13WAAQHWO is now known as nyuszika7h
23:28
census_ joined
|
|||
timotimo | hm, how do i check that a junction turns into the right thing in a test case? :| | 23:29 | |
23:29
census left
|
|||
timotimo | i suppose i have to do some magic with Mu and such .. ? | 23:31 | |
but i thouht when i try to get the values out of a junction i'm doing it wrong | |||
oh, i can .Str it! | 23:32 | ||
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"))» | ||
..niecza v24-33-gfc6d5fd: OUTPUT«all(any("dog 1 10", "dog 2 10"), any("dog 1 20", "dog 2 20"))» | |||
timotimo | that's good. | 23:36 | |
23:36
cognominal left
|
|||
geekosaur | something demorgan-ed wrong? | 23:37 | |
23:42
dayangkun joined
23:43
cognominal joined
|
|||
timotimo | no, not quite | 23:43 | |
it's just the rule that the leftmost & junction will be run before the leftmost | junction | |||
so, i've added this test, should i let it fail with rakudo or add a todo fudge already? | |||
23:44
cognominal left,
cognominal joined
|
|||
geekosaur | I was commenting in the difference between niecza and rakudo | 23:45 | |
colomon | timotimo: if you know if fails in rakudo, add a todo | 23:49 | |
timotimo | good. | 23:50 | |
i may even add a fix soon-ish? who knows! :) | |||
23:51
cognominal left
|
|||
dalek | ast: b88a9d9 | (Timo Paulssen)++ | S03-junctions/autothreading.t: autothreading order tests (& before |) |
23:51 | |
colomon | timotimo++ | 23:52 |