Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2012-10-25

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:10 dayangkun joined #perl6
00:32 azawawi joined #perl6
00:44 gdey joined #perl6
00:50 azawawi hi
00:51 diakopter hi
00:51 azawawi tadzik: ping
00:52 azawawi phenny: tell tadzik http://feather.perl6.nl:3000/module/Acme;Meow broken?
00:52 phenny azawawi: I'll pass that on when tadzik is around.
00:52 anuby joined #perl6
00:57 huf joined #perl6
00:58 havenn joined #perl6
01:08 tokuhiro_ joined #perl6
01:19 anuby_ joined #perl6
01:20 UncleFester6 joined #perl6
01:20 UncleFester6 azawawi ping
01:21 azawawi :)
01:21 azawawi UncleFester6: png
01:22 rummik joined #perl6
01:22 UncleFester6 I managed to install the updated LWP::Simple with panda and Rakudo Star-09 ok.  Did you ever get that resolved?
01:22 azawawi UncleFester6: let me check it
01:23 bakedb joined #perl6
01:23 bbeans joined #perl6
01:24 * azawawi runs q{ panda install LWP::Simple }
01:25 azawawi UncleFester6: installs but...
01:30 azawawi_ joined #perl6
01:30 azawawi_ UncleFester6: sorry got dc
01:31 azawawi_ UncleFester6: use LWP::Simple; LWP::Simple.get('http://feather.perl6.nl:3000/projects.json')   # works... great
01:31 azawawi_ UncleFester6: use LWP::Simple; LWP::Simple.get('http://google.com')    # returns invalid encoding windows-1256
01:31 azawawi_ UncleFester6: exact message is {invalid encoding 'windows-1256'}
01:32 UncleFester6 looking ...
01:35 UncleFester6 WFM ?? hmmm ...
01:36 UncleFester6 azawai - are you outside the United States now?
01:36 UncleFester6 s/azawai/azawawi/
01:39 UncleFester6 Yes - I get the error for www.google.jo ...
01:40 UncleFester6 google.ca does not have the problem ...  I will look into the problem and try to post a fix in a few days if that's OK ...
01:43 azawawi_ yeah jordan... correct google.jo => windows-1256 although shouldnt it be utf8
01:43 azawawi_ i guess they support older IE browsers by using that
01:44 azawawi_ for Farabi6 i need HTTPS + HTTP
01:45 azawawi_ right now im using wget in farabi6 until there is a viable p6 implementation
01:45 azawawi_ https is needed for github file access
01:46 azawawi_ UncleFester6: and thanks :) UncleFester6++
01:46 UncleFester6 Not really aware of the status on https although it doesn't seem to work :(
01:46 UncleFester6 bbl
01:46 UncleFester6 left #perl6
01:47 azawawi_ star: use LWP::Simple; LWP::Simple.get('https://github.com/tadzik/perl6-MPD/');
01:47 p6eval star 2012.07:  ( no output )
01:59 azawawi joined #perl6
02:02 diakopter rn: my $a=4; sub b($c) { sub { $c } }; my $d = b($a); $a++; say $d()
02:02 p6eval rakudo 0e866a, niecza v22-14-g136ddcf: OUTPUT«4␤»
02:04 diakopter see, there, I would call $c a "copy" of the parameter, which makes "is copy" seem out of place if I add it
02:04 diakopter "is rw" would make more sense
02:04 diakopter imho
02:05 diakopter s/parameter/argument/
02:17 CharellKing joined #perl6
02:28 grondilu joined #perl6
02:30 * azawawi is having fun... Farabi std viv syntax check nearly done
02:41 * skids wonders whether a "without replacement" version of X/cross might be useful, or whether he's just missing a good idiom
02:43 skids e.g. say it was W, (1,2,3) W (4,5,6) would give (1,5),(1,6),(2,4),(2,6),(3,4),(3,5)
02:46 diakopter skids: do you have a use case?
02:46 skids Mostly some of the formulas in digest calculations.
02:48 skids e.g. [+|] ($a,$b,$c) W+& ($a, $b, $c)
02:49 havenn_ joined #perl6
02:55 bbeans joined #perl6
03:05 japhb First try at allomorphic types --> segfault.  Wheeeee ...
03:06 fgomez joined #perl6
03:09 grondilu joined #perl6
03:12 grondilu rn: sort *.sin, ^10;
03:12 p6eval rakudo 0e866a, niecza v22-14-g136ddcf:  ( no output )
03:12 grondilu rn: say sort *.sin, ^10;
03:12 p6eval rakudo 0e866a, niecza v22-14-g136ddcf: OUTPUT«5 4 6 0 3 9 7 1 2 8␤»
03:12 grondilu rn: sort &sin, ^10;
03:12 p6eval rakudo 0e866a: OUTPUT«Cannot call 'sin'; none of these signatures match:␤:(num $x)␤:(Numeric \x)␤:(Cool \x)␤␤  in sub sin at src/gen/CORE.setting:2479␤  in block  at src/gen/CORE.setting:5777␤  in method sort at src/gen/CORE.setting:5771␤  in sub sort at src/gen/CORE.setting:1526␤  in b…
03:12 p6eval ..niecza v22-14-g136ddcf:  ( no output )
03:12 MikeFair_ joined #perl6
03:13 grondilu n: say sort *.sin, ^10;
03:13 p6eval niecza v22-14-g136ddcf: OUTPUT«5 4 6 0 3 9 7 1 2 8␤»
03:13 grondilu n: say max *.sin, ^10;
03:13 p6eval niecza v22-14-g136ddcf: OUTPUT«Unhandled exception: Cannot use value like WhateverCode as a number␤  at <unknown> line 0 (ExitRunloop @ 0) ␤  at /home/p6eval/niecza/lib/CORE.setting line 293 (Any.Numeric @ 6) ␤  at <unknown> line 0 (ExitRunloop @ 0) ␤  at /home/p6eval/niecza/lib/CORE.se…
03:14 grondilu so if I want the max I must sort first?
03:14 grondilu n: say max sort *.sin, ^10;
03:14 p6eval niecza v22-14-g136ddcf: OUTPUT«9␤»
03:15 grondilu nah
03:16 skids Often I've wished the "none of these signatures matched" error would show the types of the offered arguments.
03:16 grondilu n: say .end given sort *.sin, ^10;
03:17 p6eval niecza v22-14-g136ddcf: OUTPUT«9␤»
03:17 grondilu rn: say (sort *.sin, ^10).end;
03:17 p6eval rakudo 0e866a, niecza v22-14-g136ddcf: OUTPUT«9␤»
03:17 grondilu ?  why 9 ?
03:18 bakedb__ joined #perl6
03:18 grondilu rn: my @a = sort *.sin, ^10; say @a, " --> ", @a.end;
03:18 p6eval rakudo 0e866a, niecza v22-14-g136ddcf: OUTPUT«5 4 6 0 3 9 7 1 2 8 --> 9␤»
03:18 skids rn: say max (.sin for ^10)
03:18 p6eval niecza v22-14-g136ddcf: OUTPUT«0.98935824662338179␤»
03:18 p6eval ..rakudo 0e866a: OUTPUT«0.989358246623382␤»
03:18 sorear grondilu: why not 9?
03:18 grondilu shouldn't it be 8?
03:18 sorear grondilu: .end returns the last index, not the last value
03:18 sorear it's the same as .elems - 1
03:18 grondilu oh
03:19 grondilu ok
03:20 * grondilu wishes there was a method to get the last value.  .[*-1] is annoying to type.
03:21 grondilu r: use MONKEY_TYPING; class Array { method last { self.[*-1] } }; say [^10].last
03:21 p6eval rakudo 0e866a: OUTPUT«No such method 'last' for invocant of type 'Array'␤  in block  at /tmp/tsG3XSfvms:1␤␤»
03:22 sorear grondilu: augment class
03:22 grondilu r: use MONKEY_TYPING; augment class Array { method last { self.[*-1] } }; say [^10].last
03:22 p6eval rakudo 0e866a: OUTPUT«9␤»
03:22 grondilu cool
03:24 grondilu r: use MONKEY_TYPING; augment role Positional { method last { self.[*-1] } }; say (^10).last
03:24 p6eval rakudo 0e866a: OUTPUT«===SORRY!===␤Cannot augment role Positional, since roles are immutable␤at /tmp/FDTp0f46Mg:1␤»
03:24 grondilu *
03:30 grondilu r: multi max(&f, @a) { sort(&f, @a)[*-1] }; say max *.sin, ^10;
03:30 p6eval rakudo 0e866a: OUTPUT«8␤»
03:30 grondilu r: multi max(&f, @a) { max map &f, @a }; say max *.sin, ^10;
03:30 p6eval rakudo 0e866a: OUTPUT«Cannot call 'max'; none of these signatures match:␤:(&f, @a)␤␤  in sub max at /tmp/qMNowvZmdS:1␤  in block  at /tmp/qMNowvZmdS:1␤␤»
03:31 grondilu isn't max defined as multi in core?
03:33 grondilu n: say max map *.sin, ^10;
03:33 p6eval niecza v22-14-g136ddcf: OUTPUT«0.98935824662338179␤»
03:33 grondilu nah
03:37 skids rn: $_ = (1,2,3); $_[.end].say; # works if your array is the topic
03:37 p6eval niecza v22-14-g136ddcf: OUTPUT«Unhandled exception: Unable to resolve method end in type Parcel␤  at /tmp/G2tk649Pr7 line 1 (mainline @ 4) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4215 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4216 (module-CORE @ 579) ␤  at /home…
03:37 p6eval ..rakudo 0e866a: OUTPUT«3␤»
03:38 skids ok, well works on rakudo
04:04 bakedb___ joined #perl6
04:05 japhb rn: class A { has Int $.a handles * }; A.new(a => 1).Numeric
04:05 p6eval niecza v22-14-g136ddcf: OUTPUT«[31m===[0mSORRY![31m===[0m��Action method trait_mod:handles not yet implemented at /tmp/3_d9T8EVyf line 1:�------> [32mclass A { has Int $.a handles * [33m�[31m}; A.new(a => 1).Numeric[0m��Trait 0 not available on variables at /tmp/3_d9T8EVyf line …
04:05 p6eval ..rakudo 0e866a: OUTPUT«Cannot call 'Numeric'; none of these signatures match:␤:(Mu:U \v: Mu *%_)␤␤  in method Numeric at src/gen/CORE.setting:791␤  in block  at /tmp/aMmPpNWf1D:1␤␤»
04:05 japhb OK, granted that niecza doesn't handle it yet, but I *thought* that should work for rakudo these days.
04:06 japhb Am I missing something obvious?
04:09 kaleem joined #perl6
04:16 TimToady wildcards nyi
04:17 japhb narble garble
04:17 japhb Sigh
04:18 japhb That makes writing allomorphic type classes kinda painful.
04:21 japhb r: class A is Bool { }; A.new.Bool
04:21 p6eval rakudo 0e866a:  ( no output )
04:21 japhb r: class A is Bool { }; A.new.Bool; say "Alive"
04:21 p6eval rakudo 0e866a: OUTPUT«Alive␤»
04:22 japhb Huh.  Segfault here in the REPL
04:22 japhb (With up-to-date rakudo)
04:24 popl joined #perl6
04:26 * azawawi finally ... ~/std/viv output is rendered as inline problem messages inside Farabi6 ... oh yeah! :)
04:27 azawawi TimToady++
04:28 Leconite joined #perl6
04:28 Leconite left #perl6
04:29 grondilu here is a message I got from projecteuler after posting a perl6 on-liner: «  Here I spent an hour or so creating a struct that technically adds any integer with an infinite amount of digits and most of you are making it look like nothing with your one or two liners haha. »  Good perl6 advert, guys :)
04:30 christop` joined #perl6
04:30 Alpha64 joined #perl6
04:48 cognominal joined #perl6
04:49 bbeans joined #perl6
04:50 bakedb_ joined #perl6
04:53 azawawi http://feather.perl6.nl:3030/  # Farabi6 modern Perl edit with viv syntax check feature on/off switch
04:53 azawawi s/edit/editor/ :)
04:53 havenn joined #perl6
04:54 azawawi phenny: tell rindolf you werent getting any input because of a bug in new commits of HTTP::Easy
04:54 phenny azawawi: I'll pass that on when rindolf is around.
05:01 DarthGandalf joined #perl6
05:17 raiph joined #perl6
05:18 raiph azawawi: ping
05:18 azawawi raiph: pong
05:19 raiph "could not connect to feather.perl6.nl:3030" # is that just me?
05:20 azawawi let me check
05:21 azawawi yup server is down :)
05:27 azawawi raiph: http://feather.perl6.nl:3030/  # up again
05:27 azawawi raiph: i think it segfault and exits... will investigate
05:28 Alpha64 joined #perl6
05:30 GlitchMr joined #perl6
05:32 raiph azawawi: first, in case I haven't already said this: looks great. second, syntax checking the default hello world code doesn't seem to do anything
05:33 azawawi yeah im fixing the workflow as i go
05:33 azawawi thanks for checking it out
05:34 azawawi i should get session management working with tabs...
05:35 azawawi my objective is to use farabi to write farabi :)
05:36 bakedb__ joined #perl6
05:36 azawawi open with autocomplete-style history and save functionality  is next
05:43 bakedb___ joined #perl6
05:47 grondilu nr: given 4 { when 1, 2 ... 9 { say "less than 10" } }
05:47 p6eval rakudo 0e866a, niecza v22-14-g136ddcf:  ( no output )
05:48 grondilu can't I use sequences in smart match?
05:48 grondilu nr: given 4 { when any 1, 2 ... 9 { say "less than 10" } }
05:48 p6eval rakudo 0e866a, niecza v22-14-g136ddcf: OUTPUT«less than 10␤»
05:49 flightrecorder joined #perl6
05:49 FROGGS joined #perl6
05:50 GlitchMr grondilu: when doesn't mean "in array" anymore
05:50 GlitchMr For that, you should either use range (1..9) or any() function or method
05:51 grondilu ok, I'll go for any().
05:52 GlitchMr joined #perl6
05:52 GlitchMr I've no idea what happened
05:52 GlitchMr I still could write messages, I even have seen them on irc.perl6.org, but I couldn't read anything from server. So, I've reconnected.
05:57 birdwindupbird joined #perl6
05:59 cognominal joined #perl6
06:01 FROGGS good morning
06:01 tadzik good morning #perl6
06:01 phenny tadzik: 00:52Z <azawawi> tell tadzik http://feather.perl6.nl:3000/module/Acme;Meow broken?
06:05 tadzik phenny: tell azawawi indeed, fixed now. Strange thing though :)
06:05 phenny tadzik: I'll pass that on when azawawi is around.
06:21 colomon joined #perl6
06:25 birdwindupbird joined #perl6
06:41 nlpplz joined #perl6
06:43 PZt joined #perl6
06:43 jnthn japhb: As for has Int $.a handles *, the problem is that * is a fallback, after we failed to dispatch by looking at the MRO. And we find the default Numeric in the MRO and call that.
06:46 jnthn (To clarify, we find the proto method; it's the inner multi-dispatch that then fails)
06:49 domidumont joined #perl6
06:51 jnthn japhb: I'm curious about using delegation for the alomorphs; I thought Niecza defiend them as things like class IntStr is Str is Int { } or so.
06:51 jnthn So that they ~~ Int and ~~ Str
06:52 jnthn phenny: tell japhb If you don't backlog, see http://irclog.perlgeek.de/​perl6/2012-10-25#i_6097300 :)
06:52 phenny jnthn: I'll pass that on when japhb is around.
06:55 bakedb__1 joined #perl6
06:58 bbeans joined #perl6
07:03 bakedb_ joined #perl6
07:06 PZt joined #perl6
07:07 bbeans joined #perl6
07:08 am0c joined #perl6
07:20 domidumont joined #perl6
07:21 fgomez joined #perl6
07:31 bakedb___ joined #perl6
07:36 bbeans joined #perl6
07:40 bakedb_ joined #perl6
07:41 bakedb_ joined #perl6
07:46 bakedb_ joined #perl6
07:50 bakedb_ joined #perl6
07:51 bakedb_ joined #perl6
08:04 bakedb_ joined #perl6
08:06 bakedb_ joined #perl6
08:16 kresike joined #perl6
08:16 kresike hello all you happy perl6 people
08:17 jnthn o/ kresike
08:17 FROGGS hi kresike
08:17 kresike jnthn, FROGGS o/
08:23 dalek perl6-examples: b3ea22a | (Gerhard R)++ | euler/prob029-gerdr (2 files):
08:23 dalek perl6-examples: [euler/prob029] add more 6ish versions
08:23 dalek perl6-examples: review: https://github.com/perl6/perl​6-examples/commit/b3ea22a2f1
08:25 rindolf joined #perl6
08:33 cognominal joined #perl6
08:34 cognominal joined #perl6
08:35 dalek perl6-examples: 349db40 | (Gerhard R)++ | euler/prob029-gerdr.pl:
08:35 dalek perl6-examples: [euler/prob029] add FIXME note: broken for more general input
08:35 dalek perl6-examples: review: https://github.com/perl6/perl​6-examples/commit/349db4057c
08:48 cognominal_ joined #perl6
09:00 dakkar joined #perl6
09:09 kaleem joined #perl6
09:13 phenny joined #perl6
09:13 cognominal joined #perl6
09:17 araujo joined #perl6
09:18 cognominal_ joined #perl6
09:20 masak morning, #perl6
09:20 dayangkun joined #perl6
09:20 daxim joined #perl6
09:22 jnthn o/ masak
09:34 cognominal joined #perl6
09:47 masak I must confess I don't really "get" #perl11. I'm not sure what kind of conversation was meant to take place there.
09:48 masak the parts that have been logged seem to be mostly about things like SvNV and people being rude/jerks. that is, Perl 5 stuff. :P
09:49 masak the one comment about Perl 6 I found was this: http://irclog.perlgeek.de/p​erl11/2012-10-14#i_6061608
09:51 masak perhaps we're seeing the effects of unintended-but-obvious-in-retrospect consequences here. create a channel where Perl 5 and Perl 6 people can collaborate freely, and you will find that (a) for every Perl 6 person, there are 20 Perl 5 people, and (b) most of them aren't so into Perl 6.
09:52 masak someone could say "so go in there and make it better!". but I don't understand what they are talking about most of the time. I guess that's how many newcomers feel about #perl6.
09:54 hoelzro masak: that it will never take off? or what?
09:56 masak right. the whole comment, basically.
09:57 masak I wouldn't be surprised if many agree. heck, I may agree, too. (though why exactly 10 years? why not 5 or 20?)
09:58 leont joined #perl6
09:58 masak but it feels a weird thing to bring up on a channel for p5/p6 collaboration. maybe it would feel *less* weird if the rest of the backlog over there was actually about p5/p6 collaboration.
09:59 bakedb_ joined #perl6
09:59 masak oh, ingy++ steps in to defend. that's something, at least.
10:02 nwc10 14th - that's *so* last week :-)
10:02 brrt joined #perl6
10:03 masak well, I saw #perl11 in the list of channels, and went "hey, what's this?"
10:03 nwc10 question about the IRC logger - if I understand it correctly, it only links to channels on days where there is activity
10:04 nwc10 is there a way to make it only show links where there is *actual* activity - ie not just joins and parts?
10:05 masak not that I know.
10:12 dayangkun joined #perl6
10:13 masak oh, here they actually explain what the channel is about: http://irclog.perlgeek.de/p​erl11/2012-10-15#i_6064279
10:13 masak (though, nobody agrees, apparently) :)
10:20 masak "This should be a lesson to educators: You don't need to start kids off on some fake programming language like Scratch. We have something they can understand and actually use later." http://therealkatie.net/bl​og/2012/oct/24/career-day/
10:26 brrt this is pretty fascinating stuff (from the perl11 channel): http://blog.headius.com/2012/09/a​voiding-hash-lookups-in-ruby.html
10:28 mucker joined #perl6
10:29 masak brrt: there is a story about a programming language designer who shocked his PhD students by putting linked lists in his lexpads instead of hash tables. guess what: his way was faster.
10:30 brrt masak: seriously? that is somewhat hilarious
10:30 masak s/in his/in the implementation of his/
10:30 brrt i had a toy implementation of scheme that used linked lists :-p back when i didn't know how hash tables work
10:30 masak if not the Oberon language, then some language from that family. and I don't think it was Wirth, but someone else.
10:31 moritz if a lexpad is usually very small, I can imagine that
10:31 brrt a lexpad is usually very small
10:31 moritz especially if you compile symbol lookups to the pointers
10:31 moritz r: say CORE::.keys.elems
10:31 p6eval rakudo 0e866a: OUTPUT«425␤»
10:31 brrt 10 variables are a lot for a single routine
10:32 brrt and, if as moritz say, you use symbols rather than strings
10:33 brrt things get simpler still
10:33 masak moritz: well, compiling to pointers is just common sense, I think. but there's no way to remove the "two lexpads up" cost at runtime, in a language where you have not only static lexpdads but runtime lexpads, too. that is, most languages.
10:33 brrt also, you might as well put a simple array, augmenting the lexpad is rare
10:34 brrt i.e. the cases where a compiler cannot predict the number of fields the lexpad has to take
10:34 masak but yes, the cost of the linked list happens mostly during compilation.
10:34 masak maybe the extra lookup cost of the linked list is much smaller than the setup cost of the hash.
10:38 dalek perl6-examples: dc828c7 | (Gerhard R)++ | euler/prob029-gerdr (2 files):
10:38 dalek perl6-examples: [euler/prob029] fix, merge and add MAIN() to my solution
10:38 dalek perl6-examples: review: https://github.com/perl6/perl​6-examples/commit/dc828c7594
10:46 pmurias joined #perl6
10:47 pmurias masak: re what's #perl11 about: look at perl11.org
10:47 bakedb__ joined #perl6
10:49 daxim now I'm dumber than before
10:52 pmurias daxim: ?
10:52 masak pmurias: thanks. I hadn't seen that URL before.
10:54 pmurias masak: it's in the #perl11 channel topic
10:56 masak ah. well, I haven't actually been on the channel.
11:02 cognominal_ joined #perl6
11:04 brrt joined #perl6
11:05 Su-Shee_ joined #perl6
11:07 SmokeMachine joined #perl6
11:26 dalek perl6-examples: dc602bd | (Gerhard R)++ | euler/prob029-gerdr.pl:
11:26 dalek perl6-examples: [euler/prob029] bikeshedding and benchmarking
11:26 dalek perl6-examples: review: https://github.com/perl6/perl​6-examples/commit/dc602bd93d
11:45 sivoais joined #perl6
12:02 tokuhiro_ joined #perl6
12:08 havenn joined #perl6
12:11 mat_mat joined #perl6
12:22 cognominal joined #perl6
12:26 Moukeddar joined #perl6
12:30 mtk joined #perl6
12:46 PacoAir joined #perl6
12:46 havenn joined #perl6
12:56 hash_table joined #perl6
12:59 [Coke] nqp: class augment String { method get_list() { return ["eek"] }; my $a := "3"; say($a.get_list());
12:59 p6eval nqp: OUTPUT«Malformed package declaration at line 2, near "String { m"␤current instr.: 'panic' pc 13089 (src/stage2/gen/NQPHLL.pir:4619) (src/stage2/gen/NQPHLL.pm:324)␤»
12:59 [Coke] nqp: class augment String { method get_list() { return ["eek"] } }; my $a := "3"; say($a.get_list());
12:59 p6eval nqp: OUTPUT«Malformed package declaration at line 2, near "String { m"␤current instr.: 'panic' pc 13089 (src/stage2/gen/NQPHLL.pir:4619) (src/stage2/gen/NQPHLL.pm:324)␤»
13:00 [Coke] r: class augment String { method get_list() { return ["eek"] } }; my $a := "3"; say($a.get_list());
13:00 p6eval rakudo 0e866a: OUTPUT«===SORRY!===␤Unable to parse $*PKGDECL definition at line 2, near "String { m"␤»
13:00 [Coke] r: augment class  String { method get_list() { return ["eek"] } }; my $a := "3"; say($a.get_list());
13:00 p6eval rakudo 0e866a: OUTPUT«===SORRY!===␤augment not allowed without 'use MONKEY_TYPING'␤at /tmp/l7BjSVPKV2:1␤»
13:00 [Coke] r: use MONKEY_TYPING; augment class  String { method get_list() { return ["eek"] } }; my $a := "3"; say($a.get_list());
13:00 p6eval rakudo 0e866a: OUTPUT«===SORRY!===␤You tried to augment class String, but it does not exist␤at /tmp/K1_TMtwTzk:1␤»
13:01 [Coke] nqp: use MONKEY_TYPING; augment class  String { method get_list() { return ["eek"] } }; my $a := "3"; say($a.get_list());
13:01 p6eval nqp: OUTPUT«"load_bytecode" couldn't find file 'MONKEY_TYPING.pbc'␤current instr.: '' pc 1785 (src/stage2/gen/module_loader.pir:773) (src/ModuleLoader.pm:59)␤»
13:01 [Coke] nqp: augment class  String { method get_list() { return ["eek"] } }; my $a := "3"; say($a.get_list());
13:01 p6eval nqp: OUTPUT«Confused at line 2, near "augment cl"␤current instr.: 'panic' pc 13089 (src/stage2/gen/NQPHLL.pir:4619) (src/stage2/gen/NQPHLL.pm:324)␤»
13:01 [Coke] nqp: class  String { method get_list() { return ["eek"] } }; my $a := "3"; say($a.get_list());
13:01 p6eval nqp: OUTPUT«Method 'get_list' not found for invocant of class 'String'␤current instr.: '' pc 76 ((file unknown):48) (/tmp/LaulZ5pGEP:1)␤»
13:01 [Coke] <sadface>
13:09 Psyche^ joined #perl6
13:11 bluescreen10 joined #perl6
13:14 _jaldhar_ joined #perl6
13:14 sudokode joined #perl6
13:15 tokuhiro_ joined #perl6
13:17 bakedb_ joined #perl6
13:22 GlitchMr joined #perl6
13:24 havenn joined #perl6
13:24 moritz rakudo.org gets so much comment spam that I'd like to globally disable comments on the site
13:25 FROGGS what about captchas?
13:28 masak moritz: +1
13:29 masak moritz: maybe with a global notice somewhere saying "if you would like to provide feedback, please do so through p6c or #perl6"
13:31 moritz FROGGS: captchas are annoying and not helpful, most of the time
13:33 flussence point them to /r/perl6 too, that doesn't get enough use
13:36 * hoelzro goes to /r/perl6, having just heard about it from flussence
13:36 hoelzro hey, I'm #3!
13:38 masak :)
13:40 pmurias joined #perl6
13:40 pmurias jnthn: do we use the QAST op lexotic for anything other than RETURN?
13:43 pmurias and is there a reason for quoting the method name in https://github.com/perl6/nqp/blob/m​aster/src/QAST/Operations.nqp#L953?
13:45 jnthn pmurias: At the moment just return, but I'd not be surprised if we ended up using it for more in the future.
13:46 jnthn pmurias: quoting is probably left-over from when the code was ported from PIR
13:46 jnthn (which needs all method names quoted)
13:57 sizz joined #perl6
14:01 havenn joined #perl6
14:02 stopbit joined #perl6
14:03 pmurias jnthn: how should I look up pir ops?
14:05 jnthn "look up"?
14:05 brrt pmurias: from the parrot repository
14:05 brrt either in docs
14:05 jnthn oh, as in what they mean
14:05 brrt or in src/ops/
14:05 brrt and then perldoc on the individual files
14:05 brrt they are pretty well documented
14:05 jnthn All the Parrot ones are documented, in theory. And the NQP ones are too in src/ops/nqp.ops
14:05 brrt although they can be confusing
14:06 skids joined #perl6
14:06 * pmurias gives up on understanding the pir ops in lexotic and just implements it as return
14:07 pmurias as I don't care about parrot at all
14:08 brrt https://github.com/parrot/parro​t/blob/master/src/ops/core.ops
14:08 brrt pmurias, parrot is fun :-)
14:08 jnthn pmurias: So long as you get the semantics the same, it's fine :)
14:09 jnthn pmurias: Note that the return can be from several nested blocks.
14:09 jnthn If you're compiling each QAST::Block to a JavaScript function, you need to make sure you return from the right one
14:09 pmurias I'm aware of that
14:09 jnthn OK
14:10 pmurias but I don't have a good solution for that, I'm afraid I'll have to use exceptions for that
14:10 jnthn Yes, and also find a way to deal with the need for it to be lexical.
14:10 brrt the 'solution' is continuations, if you have them
14:10 jnthn r: sub foo() { (1,2,3).map({ return 42 }).eager }; say foo()
14:10 p6eval rakudo 0e866a: OUTPUT«42␤»
14:11 jnthn The return needs to return from foo (lexically), not map (dynamically). That's what makes it a bit fiddly :)
14:11 * rjbs has a running (rakudo) perl6 again.  yay!
14:11 pmurias that's just checking if we got the correct exception ;)
14:11 rjbs mst++
14:12 pmurias jnthn: I'll expand the return test in nqp for more tricky cases
14:14 brrt jnthn: is that really the desired behavior?
14:14 brrt the difference between blocks and subs, i guess
14:14 jnthn brrt: yes
14:15 cognominal_ joined #perl6
14:15 brrt interesting
14:15 jnthn It's spec.
14:15 jnthn And it's what you want
14:15 brrt my lispish brain has some problems with it, but it does make sense
14:16 brrt in perl, there really is more than one way to do it
14:16 jnthn Otherwise sub foo(@a) { for @a { return 42 when 'answer' } } or so would not do what you wanted :)
14:16 jnthn (for loops are just syntax sugar for map calls)
14:17 brrt .. but map collects, and for doesn't, or does it
14:18 jnthn for collects too, if it's not in void context.
14:18 brrt rn: my @a = 1, 2, 3; my @b = for @a { $_ * 2 }; say @b.perl
14:18 p6eval niecza v22-14-g136ddcf: OUTPUT«Unhandled exception: Unable to resolve method from in type P6+{term:sym<∅>},{infix:sym<∈>},{infix:sym<(elem)>​},{infix:sym<∉>},{infix:sym<∋>},{infix:sym<(cont)>​},{infix:sym<∌>},{infix:sym<∪>},{infix:sym<(|)>},{​infix:sym<∩>},{infix:sym<(&)>},{infix:sym<(-)>}…
14:18 p6eval ..rakudo 0e866a: OUTPUT«===SORRY!===␤Confused␤at /tmp/d4qYVeQyY4:1␤»
14:18 jnthn Need a "do"
14:18 jnthn rn: my @a = 1, 2, 3; my @b = do for @a { $_ * 2 }; say @b.perl
14:18 p6eval niecza v22-14-g136ddcf: OUTPUT«[].list␤»
14:18 p6eval ..rakudo 0e866a: OUTPUT«Array.new(2, 4, 6)␤»
14:18 brrt rn: my @a = 1, 2, 3; my @b = do for @a { $_ * 2 }; say @b.perl
14:19 p6eval niecza v22-14-g136ddcf: OUTPUT«[].list␤»
14:19 p6eval ..rakudo 0e866a: OUTPUT«Array.new(2, 4, 6)␤»
14:19 brrt nice
14:29 kaare_ joined #perl6
14:31 cognominal_ joined #perl6
14:37 [Coke] jnthn: is there a way to augment nqp classes like String?
14:37 jnthn [Coke]: There is no NQP class String
14:37 [Coke] Figured I'd try that out rather than try to get the HLL mapping working.
14:37 jnthn [Coke]: You're confusing Parrot's type system and NQPs.
14:38 [Coke] oh, is that String the parrot String?
14:38 jnthn They don't intersect.
14:38 jnthn Right.
14:38 jnthn NQP still uses bits of both.
14:38 [Coke] nqp: say(String.WHAT);
14:38 p6eval nqp: OUTPUT«␤»
14:38 cosimo joined #perl6
14:38 hash_table joined #perl6
14:38 havenn joined #perl6
14:38 jnthn Rakudo doesn't use hll mapping or expose Parrot types, fwiw.
14:39 jnthn Well, it does for its custom lexpad I guess.
14:39 jnthn But not for anything "user facing"
14:39 * [Coke] wonders if he can augment parrot types from nqp, then. Or get parrot subclasses instead of nqp subclasses, since they don't seem to be equivalent.
14:40 [Coke] (though, to be fair, I haven't tried to distill my core issue of not being able to do an HLL mapping down to a simple test file.)
14:43 jnthn [Coke]: It really depends what your goals are. If your goal is "a compiler that targets Parrot" you could go that way and it should mostly work out. If your goal is "a compiler that will, without too many changes, work on anything else that NQP lets you target in the future", then avoiding depending on Parrot's HLL mapping is probably for the best.
14:46 [Coke] My goal was "get partcl working again with the minimum amount of effort". :)
14:46 brrt [Coke]++ for that
14:46 xinming_ joined #perl6
14:48 japhb jnthn, I haven't done my backlogging yet, but just looking at where you highlighted me ... Niecza has internal support for a "dualvar", and then exposes that through role Niecza::Dualvar, so class IntStr is Int does Niecza::Dualvar.  Given that Kernel.cs says "// Truly vile hack to make dualvars work.", I was hoping to avoid that kind of invasive work in Rakudo.  So first I tried 'class IntStr is Int is Str { has $!string handles < Str gis
14:48 phenny japhb: 06:52Z <jnthn> tell japhb If you don't backlog, see http://irclog.perlgeek.de/​perl6/2012-10-25#i_6097300 :)
14:48 japhb t >; has $!value handles *; }' but that resulted in reliable segfaults.  So then I tried it again with *just* delegation, got the dispatch failures, and golfed my way to what I posted last night.  So I'm stuck at the moment.
14:49 jnthn japhb: But if you inherit from Int and Str you already have something capable of storing both an int and a str.
14:49 jnthn Well, apart from it's not an int, it's a bigint thingy
14:49 jnthn japhb: 6model is capable of such things, but currently only from the C API to it.
14:51 japhb Done entirely at the Perl 6 level, how would I see the attributes of Int and Str where I would store the respective values?  Or are you saying that I have to do 6model hackery to get at them?
14:51 japhb s/Perl 6/NQP and Perl 6/
14:53 Exodist joined #perl6
14:53 jnthn japhb: I'm saying that currently, we only expose ops like nqp::p6box_n(...), for example
14:53 jnthn It internally does an allocate, initialize and set_num
14:54 japhb following you so far
14:54 jnthn We don't have ops that use a single object to box two primitive types.
14:54 jnthn It's not that we need to do any low-level 6model hackery. It supports it well enough already, it's just that bit of functionality isn't exposed in any way to NQP or Rakudo space.
14:55 japhb OK, it sounds like you're suggesting writing said double-primitive boxing ops, and basically having the equivalent of Niecza's low-level dualvar, yes?
14:56 japhb But perhaps less painful because 6model is designed to handle that level of crazy.
14:56 jnthn yes, write the ops to construct these kinds of thing.
14:57 japhb OK, guess it's time to learn 6model a little more thoroughly.  :-)
14:57 * japhb had held out some home that Perl 6 was powerful enough to do that all in "user space", so to speak, but perhaps I was pushing it a bit too far.
14:58 japhb *hope
14:58 pmurias what is a dualvar?
14:58 [Coke] jnthn: but you're right. if I stop trying to target parrot through nqp and just target nqp, I'll no doubt have an easier time of it.
14:59 brrt a scalar that holds both a string and a number at the same time
14:59 brrt in p5, you have a 'use dualvar'; which allows you to manipulate this
15:00 brrt (a p5 scalar always holds both, but they are supposed to be in sync)
15:00 pmurias do we have them in Perl6?
15:01 japhb pmurias: yes ... the result of the val() sub, which I'm trying to implement in Rakudo
15:04 * pmurias found it in the spec
15:04 japhb Well, I guess val() is a very specific subset of the general dualvar concept, but still, the basic functionality is required.
15:05 japhb bbiab
15:07 mucker joined #perl6
15:08 benabik joined #perl6
15:15 havenn joined #perl6
15:21 alester joined #perl6
15:27 kresike bye folks
15:31 masak fare thee well, kresike.
15:32 * masak .oO( why is it "fare thee well", and not "fare thou well"? )
15:32 japhb @kids[$_].delivered = True for ^2;
15:32 brrt left #perl6
15:32 masak japhb: \o/
15:33 masak japhb: heartfelt congratulations.
15:33 japhb *chuckle* Not *that* kind of delivered.  ;-)
15:33 masak oh!
15:33 masak heh. :)
15:33 masak beg pardon, I am not a native speaker of your language... :P
15:34 * PerlJam wonders if kid 0 feels any lesser for being 0    ;)
15:34 masak dang, PerlJam++ beat me to it :P
15:35 benabik joined #perl6
15:46 jnthn japhb, [Coke]: Got caught up with $client-task. Decommute now, will backlog when I'm home :)
15:48 colomon joined #perl6
15:52 havenn_ joined #perl6
15:53 gdey joined #perl6
15:55 kaleem joined #perl6
16:05 circlepuller joined #perl6
16:09 SamuraiJack joined #perl6
16:10 havenn joined #perl6
16:13 japhb @kids[2].delivered(:to($pre-school));  # Breath easy, masak.  ;-)
16:13 masak ;)
16:14 masak I hear breathing is the key in these circumstances.
16:14 japhb :-D
16:14 masak by the way, there's a strong case for making those two different methods, and not rely on nameds to separate the two usages. :P
16:14 TimToady heavy breathing is usually involved somewhere...  :)
16:14 japhb I refactored my API after the first failed test
16:15 japhb TimToady, ;-)
16:16 TimToady when I hear "She delivered a baby" my default assumption is that she is a doctor.
16:16 TimToady even more so for He
16:17 flussence or a stork
16:17 TimToady usually we "had" or "gave birth to" for the other thing
16:17 TimToady *we use
16:18 japhb Clearly my mistake was the boolean attribute, which led to masak++'s interpretation "has been delivered"
16:19 TimToady use of "delivered" for "gave birth to" sounds kinda elizabethan to my ear
16:19 arlinius joined #perl6
16:19 skids r: sub a ($f) { (1,2,3).map: { return $_ } }; a(1).say # Should this blow up like it does, or should it just slap an implicit eager on there when it sees the return?
16:19 p6eval rakudo 0e866a: OUTPUT«Attempt to return outside of any Routine␤  in block  at src/gen/CORE.setting:462␤  in block  at /tmp/Qlf3Zdg_uu:1␤␤»
16:19 japhb Huh.  Sounds perfectly modern to me, if a bit impersonal.
16:20 * japhb looks for the accent grave so as to spell "birthed" with two syllables
16:22 * jnthn is back
16:22 TimToady skids: um, I'm guessing neither?
16:23 jnthn skids: It's behaving as expected.
16:23 TimToady it should not blow up, because the return should lexotically return from the sub
16:23 japhb jnthn: in black?
16:23 jnthn TimToady: Huh. The map is lazy. We *already* returned from the sub.
16:23 TimToady ah, so we did
16:24 jnthn And we try to iterate afterwards.
16:24 jnthn phew :)
16:24 * TimToady blames lack of coffee, but that's a crock :)
16:24 * jnthn wasn't looking forward to trying to implement the solution to that one :P
16:24 jnthn japhb: I am, actually, wearing quite a bit of black today :)
16:25 * [Coke] could use a crock of coffe, and is wearing all black.
16:26 TimToady [Coke]: you know, you can start wearing a few accents of red; that's how recovering goths do it...
16:28 TimToady Y'know, if I'd just admit my mistakes before I make them, it'd save a world of misunderstandings...
16:28 domidumont joined #perl6
16:29 diakopter join #perl11
16:29 diakopter heh
16:29 diakopter wrong network
16:30 * jnthn hands diakopter a slash
16:31 jnthn japhb: I guess the options are to add new ops specific to doing this double-boxing, or just adding a few ones that call the appropriate REPR set functions from the boxing API.
16:32 MayDaniel joined #perl6
16:34 [Coke] TimToady: I apparently give off a more johnny cash than goth vibe.
16:39 TimToady even johnny cash is goth at halloween, especially since he's dead
16:43 ingy ouch!
16:43 perigrin Also Johnny did do those NIN covers.
16:44 ingy this parrot is NOT goth.
16:44 ingy it's merely pining for the Nails...
16:44 perigrin The Norwegian Black ... beautiful eyeliner!
16:45 TimToady no, it's pining for the Fords.
16:45 perigrin it wouldn't be if it had been driving one. stupid car.
16:45 ingy My volvo is a ford :(
16:45 diakopter reminds me of the knights who say Nimh
16:45 TimToady you know what happens if you play a country song backwards?
16:46 diakopter your dog comes back to life?
16:46 TimToady and your pickup starts running again
16:46 TimToady not to mention the girlfriend coming back
16:46 ingy all of them?
16:46 ingy from Texas?!
16:48 diakopter anyone know how to remove oneself from the maintainer's list of a CPAN distribution?
16:48 diakopter I was added to one a few years ago and now I'm tired of getting RT mail
16:49 diakopter and the other maintainer isn't replying to my email
16:58 TimToady change your name?
17:01 GlitchMr block e-mails?
17:01 FROGGS diakopter: you might ask modules@cpan.org (or perl.org?), or ANDK
17:02 FROGGS or module-authors or what it was
17:02 FROGGS on pause.perl.org you can give up maintainership, but I dont know if that fits your needs
17:02 diakopter oh, that's probably what I want
17:03 diakopter it's been so long...
17:08 diakopter FROGGS: found/did it; thanks
17:11 Chillance joined #perl6
17:18 flussence I've spent about 20 seconds thinking about an idea: taint checking using role + type checking
17:20 flussence as in, sub print_html(HTMLEscapedStr $s) { ... } (but with better names that don't drive people crazy to use)
17:21 masak flussence: there is some wording about a Taint enum in S12.
17:21 masak might interest you.
17:21 masak never been implemented AFAIK.
17:22 pmurias in the absence of threads contextuals can be turned into globals and local?
17:25 TimToady local is one of the major reasons P5 has trouble with threads, of course :)
17:26 flussence masak: that does sound like what I'm thinking of, but it seems a bit narrowly defined. I wonder if it'll turn into a hierarchy of "safe for use" roles, like exceptions are today
17:26 TimToady pmurias: but yes, that's precisely what STD does
17:26 flussence (so you can't pass an Untainted::HTML to a SQL function and so on)
17:26 TimToady (for the p5 backend)
17:30 felher jnthn++ #blog post from yesterday
17:30 pmurias TimToady: is there a different backend?
17:31 moritz yes, a .NET/CLR backend
17:31 moritz called niecza
17:32 felher jnthn: i find trace points to be a nice idea :)
17:36 orafu joined #perl6
17:36 TimToady masak: re "fare thee well", all I can say is that the Indo-European word "fare" comes from also gives us "ferry", "ford", and "port", any of which can have transitive meanings when used as a verb
17:36 TimToady however, this does not explain why it is "fare thee", and not "fare thyself"
17:37 TimToady maybe it's one of those things like "Just look at you!"
17:37 masak maybe.
17:37 TimToady where it's objectifying the 2nd person to make it seems like someone else
17:38 TimToady or "F*ck you!" and such
17:39 TimToady or maybe it's using "you" as a referent to a 3rd-person notion in the speaker's mind, pragmatically "I'm not really speaking to you, but about you."
17:41 TimToady so even though the form of the verb seems to indicate a command to the hearer, it's really more like a Whatever for the subject of the sentence
17:43 masak so, "fare thee well" is really directed at a third party? that makes sense, since kresike had already left the room. ;)
17:43 TimToady such that it's perfectly proper (or imperfectly improper) for one to drop the F-bomb on a hearer you can't actually hear you, such as the driver of another car
17:43 sjohnson joined #perl6
17:44 HarryS joined #perl6
17:45 TimToady well, yeah, something like "I wish the Universe to do a good job of ferrying this person named 'you'"
17:46 TimToady of course, all this analysis is beside the point when you have a fossilized form that people just repeat because they heard it that way, not because they've analyzed it in their head
17:47 TimToady .oO(Go not to the linguists for advice, for they will say both "Yes" and "Huh?")
17:47 leont joined #perl6
17:55 TimToady the top three elements on the stack should probably be named .ult, .penult, and .antepenult
17:55 TimToady (referreing to the .last proposed earlier)
17:55 TimToady ((esp since "last" means something else in Perl))
18:01 * masak .oO( because we never overload terms? ) :P
18:04 tadzik is it just me, or perlcabal.org/syn/ is very slow?
18:05 masak joined #perl6
18:16 awwaiid just you
18:16 leont left #perl6
18:17 awwaiid pretty instant here
18:32 benabik joined #perl6
18:32 fgomez joined #perl6
18:33 cognominal joined #perl6
18:41 HarryS joined #perl6
18:43 havenn joined #perl6
18:47 dalek ecosystem: 0f96f3c | tadzik++ | META.list:
18:47 dalek ecosystem: Add Test::Harness
18:47 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/0f96f3c8b9
18:47 tadzik http://goo.gl/WPSDR
18:58 jnthn tadzik: :D
18:58 tadzik there should be a Panda on that picture
18:58 tadzik feeling the Wind of Change in its ears
18:58 colomon what a great picture!
19:00 jnthn tadzik: There is photoshop... :)
19:01 tadzik If I could use it, I'd make an Obama saying "Not Bad Man"
19:03 jnthn meh, googling for "panda leaning out of a car" doesn't find a picture of one.
19:03 jnthn It did find a monorail panda though
19:04 birdwindupbird joined #perl6
19:04 [Coke] tadzik: http://www.kevincharnas.com/upload​ed_images/panda-driving-726147.jpg
19:05 [Coke] >close enough<
19:05 tadzik ahaha
19:05 tadzik I knew this with a caption
19:05 tadzik http://axelrod5.tripod.com/funny/thumbnail​s/400x300/panda_20makes_20more_20sense.jpg this one :)
19:05 [Coke] tadzik: hee!
19:06 changedNicks joined #perl6
19:06 jnthn nice!
19:07 skids Ah, was just about to link that one.
19:07 changedNicks joined #perl6
19:11 skids .oO(in addition to the "last" keyword, proposed .last also doesn't play well with .first semantics)
19:12 havenn joined #perl6
19:13 skids Somedays I want to strip a thesaurus of unreasonably cumbersome words and produce a "coders thesaurus".
19:18 flussence rn: say '12345' ~~ /({my @nums = 1..4})+/
19:18 p6eval rakudo 0e866a: OUTPUT«(timeout)»
19:18 p6eval ..niecza v22-14-g136ddcf: OUTPUT«(timeout)Potential difficulties:â�¤  @nums is declared but not used at /tmp/x4BONmavFh line 1:â�¤------> [32msay '12345' ~~ /({my [33mâ��[31m@nums = 1..4})+/[0mâ�¤â�¤Â»
19:22 zby_home joined #perl6
19:27 mathw joined #perl6
19:31 raiph joined #perl6
19:40 HarryS joined #perl6
19:45 mat_mat >>28555549
19:46 araujo joined #perl6
19:47 araujo joined #perl6
20:02 jnthn r: say defined try eval '!!omg!!! syntax fA1l!'
20:02 p6eval rakudo 0e866a: OUTPUT«True␤»
20:02 jnthn r: say so try eval '!!omg!!! syntax fA1l!'
20:02 p6eval rakudo 0e866a: OUTPUT«True␤»
20:02 jnthn r: say WHAT try eval '!!omg!!! syntax fA1l!'
20:02 p6eval rakudo 0e866a: OUTPUT«X::Syntax::Confused()␤»
20:03 jnthn r: try eval '!!omg!!! syntax fA1l!'; say so $!
20:03 p6eval rakudo 0e866a: OUTPUT«True␤»
20:03 jnthn r: try eval '42'; say so $!
20:03 p6eval rakudo 0e866a: OUTPUT«False␤»
20:03 jnthn precedence.t does
20:03 jnthn ok((not defined try eval '4 !'),  "Whitespace not allowed before user-defined postfix");
20:04 * jnthn glances through S04
20:05 flussence this turned out to be much harder than it looks: http://www.reddit.com/r/dail​yprogrammer/comments/122c4t/
20:06 masak flussence: ooh
20:06 jnthn S04 doesn't seem to say afaict
20:07 * jnthn changes it to dies_ok( { eval '4 !' }, ... ); which should work for Niecza too
20:08 flussence masak: right now I've got as far as m:ex/^ (1\d || 2<[0..6]> || \d)+ $/ which is returning strings longer than the input. I'm pretty lost :(
20:08 masak flussence: seems one could use the :exhaustive flag on regexes to get all possible parsings.
20:10 masak flussence: how about m:ex/^ [(\d ** 1..2) <?{ $0 <= 26 }>]+ $/ ?
20:10 arnsholt For that kind of task I usually think of Prolog =)
20:10 SamuraiJack joined #perl6
20:10 popl joined #perl6
20:11 masak r: say "aaa" ~~ m:ex/a/
20:11 p6eval rakudo 0e866a: OUTPUT«False␤»
20:11 masak hm.
20:11 masak r: say "aaa" ~~ m/a/
20:11 p6eval rakudo 0e866a: OUTPUT«「a」␤␤»
20:11 masak why would :ex make things return False?
20:12 jnthn masak: Be careful with m. It matches immediately.
20:13 jnthn Meaning that what you actually smart-match against is what gets returned by match.
20:13 jnthn ~~ m/.../ may well be an anti-pattern, especially if you add modifiers.
20:13 jnthn r: say "aaa" ~~ rx:ex/a/
20:14 p6eval rakudo 0e866a: OUTPUT«===SORRY!===␤Adverb ex not allowed on rx␤at /tmp/nh2fdGKKDl:1␤»
20:14 jnthn Hm :)
20:14 masak ok, so I shouldn't combine ~~ and :ex
20:14 jnthn r: $_ = "aaa"; say m:ex/a/
20:14 p6eval rakudo 0e866a: OUTPUT«a a a␤»
20:14 masak \o/
20:14 flussence r: say m:ex/a/ given 'aaa'
20:14 p6eval rakudo 0e866a: OUTPUT«a a a␤»
20:14 jnthn masak: Seems so. But that feels warty.
20:15 masak r: $_ = "123"; .say for m:ex/^ [(\d ** 1..2) <?{ $0 <= 26 }>]+ $/
20:15 p6eval rakudo 0e866a: OUTPUT«「123」␤ 0 => 「12」␤ 0 => 「3」␤␤「123」␤ 0 => 「12」␤ 0 => 「1」␤ 0 => 「23」␤␤「123」␤ 0 => 「12」␤ 0 => 「1」␤ 0 => 「23」␤ 0 => 「2」␤ 0 => 「3」␤␤»
20:15 jnthn masak: But I think it's a known issue (at a design level...Rakudo is behaving to current spec afaik)
20:15 masak r: $_ = "123"; say .Str for m:ex/^ [(\d ** 1..2) <?{ $0 <= 26 }>]+ $/
20:15 p6eval rakudo 0e866a: OUTPUT«123␤123␤123␤»
20:15 masak heh :)
20:15 masak r: $_ = "123"; say .list for m:ex/^ [(\d ** 1..2) <?{ $0 <= 26 }>]+ $/
20:15 p6eval rakudo 0e866a: OUTPUT«12 3␤12 1 23␤12 1 23 2 3␤»
20:17 bruges joined #perl6
20:22 flussence .oO( hm, I wonder what font I need to get those fancy brackets in the terminal... )
20:24 masak may I suggest that the above output is outright wrong?
20:24 arnsholt masak: I wouldn't disagree with that =)
20:24 masak I would expect '12 3', '1 23', '1 2 3'.
20:25 jnthn I don't even know what :ex is meant to do, so no clue. :)
20:25 masak it would seem to me :ex is passed down to subrules.
20:25 masak or something.
20:25 jnthn I thought it was meant to produce all the possible ways it can match.
20:25 masak aye.
20:26 flussence am I imagining things, or did we have an :all at one point that would've worked that way?
20:26 flussence says here :ex implies :overlap, wouldn't that mean it can be done without that?
20:26 masak hm, why would :ex imply overlap?
20:27 masak maybe I'm misremembering things.
20:27 dalek roast: 00ff866 | jnthn++ | S06-traits/precedence.t:
20:27 dalek roast: Use dies_ok instead of 'defined try'.
20:27 dalek roast: review: https://github.com/perl6/roast/commit/00ff866dd0
20:30 flussence the :ex-ample in S05:576 doesn't work in rakudo either.
20:31 flussence ...probably because it's doing exactly that ~~ m// thing mentioned earlier :)
20:32 masak I still haven't understood what went wrong with ~~ m//
20:32 masak something is serisouly fishy there.
20:32 masak seriously*
20:32 flussence n: 'abc' ~ m/a/
20:32 p6eval niecza v22-14-g136ddcf: OUTPUT«Unhandled exception: Unable to resolve method match in type Any␤  at /tmp/F6NApKRi_c line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4215 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4216 (module-CORE @ 579) ␤  at /home/…
20:32 flussence erm
20:32 flussence n: say 'abc' ~~ m/a/
20:32 p6eval niecza v22-14-g136ddcf: OUTPUT«#<match from(0) to(1) text(a) pos([].list) named({}.hash)>␤»
20:32 masak anyway, :overlap shouldn't be a problem for us in my regex above, since I'm anchoring it to both ends of the string.
20:33 LordVorp I'm on a forum that often has attached files with names that look like: "Sample (10).tos".  When I click Download, I get a file named "Sample %2810%29.tos". Is there a switch or setting that will make these come down w/o escapes?
20:33 flussence ww?
20:34 LordVorp wow TOTALL ww
20:34 LordVorp !
20:34 * LordVorp blushes
20:34 flussence heh :)
20:35 sorear hey LordVorp.  welcome to the nonlurkers. :D
20:35 masak no there's no going back.
20:35 LordVorp haha thank you.
20:35 masak now you must try Perl 6. :P
20:36 LordVorp i've been watching P6 vicariously for some time but haven't quite gotten my feet wet yet.
20:36 * masak splashes some water on LordVorp's feet
20:36 LordVorp is it still prudent to simply start with the Apocalypse docs and go from there?
20:36 masak LordVorp: gosh, no.
20:36 masak LordVorp: if you must read something, read http://doc.perl6.org/
20:37 LordVorp will do
20:37 * LordVorp starts to learn something interesting...
20:37 masak LordVorp: but most of all, pick a small task and try to code it up. that tends to cause the right questions to be asked.
20:37 LordVorp yep.
20:37 masak we're all very eager to answer beginner questions.
20:40 colomon r: sub cycle($start) { $start, { when * !%% 2 { 3 * $n + 1 }; when * %% 2 { $n / 2 }; } ... 1 }; say cycle(22)
20:40 p6eval rakudo 0e866a: OUTPUT«===SORRY!===␤Variable $n is not declared␤at /tmp/5YOnNtVvA3:1␤»
20:40 HarryS joined #perl6
20:41 colomon r: sub cycle($start) { $start, { when * !%% 2 { 3 * $_ + 1 }; when * %% 2 { $_ / 2 }; } ... 1 }; say cycle(22)
20:41 p6eval rakudo 0e866a: OUTPUT«22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1␤»
20:42 jnthn r: sub bicycle($start) { ($start, { when * !%% 2 { 3 * $_ + 1 }; when * %% 2 { $_ / 2 }; } ... 1) xx 2 }; say bicycle(22)
20:42 p6eval rakudo 0e866a: OUTPUT«22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1␤»
20:44 kurahaupo joined #perl6
20:47 Moukeddar joined #perl6
20:47 masak Moukeddar! \o/
20:47 Moukeddar Good evening #perl6, masak o/
20:52 dalek roast: a011579 | jnthn++ | S06-traits/precedence.t:
20:52 dalek roast: Fudge for Rakudo.
20:52 dalek roast: review: https://github.com/perl6/roast/commit/a011579337
20:52 dalek rakudo/nom: 8c6ccf5 | jnthn++ | src/ (2 files):
20:52 dalek rakudo/nom: Some fixes to precedence handling.
20:52 dalek rakudo/nom:
20:52 dalek rakudo/nom: With these, we now pass all but 1 test of S06-traits/precedence.t.
20:52 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/8c6ccf5275
20:52 dalek rakudo/nom: c8d1bd6 | jnthn++ | t/spectest.data:
20:52 dalek rakudo/nom: Run S06-traits/precedence.t.
20:52 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/c8d1bd66dd
20:53 japhb jnthn, before you head to sleep ... :-)
20:53 benabik_ joined #perl6
20:53 japhb Where do you suggest I start researching to figure out how to do the dualvar functionality in Rakudo?
20:53 japhb (I figure I'll be reading a lot of code before I write any, since much of it will be in C it sounds like.)
20:54 dalek rakudo/nom: 75ee64b | jnthn++ | docs/ROADMAP:
20:54 dalek rakudo/nom: ROADMAP update.
20:54 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/75ee64b20a
20:55 masak japhb: all this for val() ?
20:55 havenn joined #perl6
20:55 jnthn japhb: Read 6model.h to figure out the REPR API
20:55 jnthn japhb: When you say "much of it" though, I think we're not talking much.
20:56 masak nr: say .^name for <42 4.2 1e3>
20:56 japhb masak, in one form or another I've been working on pieces of val() or things that want to call val() for a really damn long time.  It's like the curse of my Rakudo tenure.  ;-)
20:56 p6eval rakudo 0e866a: OUTPUT«Str␤Str␤Str␤»
20:56 p6eval ..niecza v22-14-g136ddcf: OUTPUT«IntStr␤RatStr␤NumStr␤»
20:56 japhb jnthn, OK, I hope you are correct.  :-)
20:57 jnthn japhb: See then for example perl6_box_str in perl6.ops
20:57 jnthn japhb: To explain what's needed...
20:57 masak japhb: I know how that feels. I've been wanting macros for years.
20:57 jnthn Boxing a primitive involves two steps:
20:57 * japhb is listening
20:57 japhb masak, I bet!
20:57 jnthn 1) allocate
20:58 jnthn 2) store the primitive type inside of the object
20:59 jnthn Int is a little bit different because it's really a big integer, but it's basically the same approach.
20:59 jnthn For example, the op taht boxes an int is:
20:59 jnthn PMC *type = Rakudo_types_int_get();
20:59 jnthn $1 = REPR(type)->allocate(interp, STABLE(type));
20:59 jnthn REPR($1)->box_funcs->set_int(interp, STABLE($1), OBJECT_BODY($1), $2);
20:59 jnthn If you're coming from a native integer
21:01 jnthn It occurs to me the easiest way to get what you want is really just to produce the FooStr in the same way you'd produce a Foo
21:01 jnthn And then write just one op that is something that sets the thing's string likeness
21:01 spanner joined #perl6
21:02 jnthn So it takes an existing object and a string and just calls the set_str on the boxing API.
21:02 jnthn Plus do a write-barrier in the op.
21:02 japhb Is there already a slot to store the string into?
21:03 jnthn If you inherit from Str also then yes.
21:06 jnthn To illustrate what's going on:
21:06 japhb jnthn, Am I correct in assuming that by '6model.h', you actually meant 'sixmodelobject.h'?
21:06 jnthn r: class SpecialStr { has str $!value is box_target; multi method gist(SpecialStr:D:) { self.Str() }; method Str() { self } }; my $x = nqp::box_s('blah', SpecialStr); say $x.WHAT; say $x;
21:06 p6eval rakudo 0e866a: OUTPUT«SpecialStr()␤blah␤»
21:06 * japhb still listening
21:06 jnthn japhb: uh, yes, sorry :)
21:07 jnthn Str is declared something like this. It's native str is marked with the "box_target" trait.
21:07 jnthn This means that if you use the type to box a native string, or you want to get a native string out of it, it will look at that slot.
21:08 japhb no problem.  BTW, I note that the only differences between the copies in Rakudo's src/binder/ and NQP's src/6model/ is the write barriers and the 3 typedefs right under 'Dynamic representation registration.' in the NQP version.  Is that just unintentional skew, or intended difference?
21:08 jnthn Unintentional skew
21:08 japhb Ah, OK
21:09 jnthn Surprising though because normally things explode very quickly if they are out of sync
21:09 jnthn Well, actually, the dynamic representation registration stuff is used nowhere in Rakudo
21:09 jnthn But it doesn't harm to have it. Feel free to sync them. (NQP one is latest.)
21:09 japhb Okie dokie
21:10 japhb So I guess my next question is, can there be multiple box_targets, as long as they have different native types?
21:11 jnthn Yes
21:11 japhb \o/
21:11 jnthn And it's not just about the 3 core native types
21:11 japhb Oh yeah, my job just got way easier
21:11 jnthn Any inlineable REPR can kinda have one too
21:11 jnthn Which is why the libtommath big int data structure can be inlined straight into the body of a Perl 6 Int.
21:11 japhb jnthn++ # Internal APIs that don't suck
21:11 japhb excellent
21:11 jnthn Rather than needing another level of indirection.
21:12 jnthn In the end this kinda thing is how we'll get things like packed arrays of compact structs.
21:12 * jnthn waves hands a bit :)
21:13 dalek rakudo/nom: 3619d77 | (Geoffrey Broadwell)++ | src/binder/sixmodelobject.h:
21:13 dalek rakudo/nom: Syncing unintentionally skewed 6model header, as per jnthn++
21:13 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/3619d77e7e
21:14 japhb I do like me some packed arrays, so that's good news ...
21:14 jnthn Like everything undone, it's on the todo list :)
21:14 japhb heh
21:14 japhb TODO: *
21:14 jnthn r: say *
21:14 p6eval rakudo 75ee64: OUTPUT«*␤»
21:14 jnthn Actually, that's todone :P
21:16 jnthn BTW, if nobody else jumps up to do it, I'll cut the month's R* release on Saturday or so.
21:16 japhb .oO( Is a list of TODO items countable, given that every TODO item can usually be broken into smaller TODOs recursively?)
21:18 jnthn I think that this recursion does terminate. However, $jnthn.comprehend-how-the-hell-STDs​-handling-of-operator-adverbs-works may take infinite time...
21:19 * jnthn decides, for the 5th time, not to work on that for now...
21:20 japhb heh
21:23 changedNicks joined #perl6
21:33 changedNicks joined #perl6
21:48 sizz joined #perl6
21:49 changedNicks joined #perl6
21:50 hash_table joined #perl6
21:51 changedNicks joined #perl6
21:52 soptnrs joined #perl6
21:56 thou joined #perl6
22:05 dalek nqp: acab2e7 | jnthn++ | src/QAST/Operations.nqp:
22:05 dalek nqp: Add some context introspection nqp:: ops.
22:05 dalek nqp:
22:05 dalek nqp: Whatever VM we target, we'll need to be able to talk about these in a
22:05 dalek nqp: first class way, and it'll be the same basic operations (chase the
22:05 dalek nqp: outer or caller chain, look at lexicals, etc.)
22:05 dalek nqp: review: https://github.com/perl6/nqp/commit/acab2e79d4
22:05 dalek nqp: f80be32 | jnthn++ | src/stage0/ (9 files):
22:05 dalek nqp: Update bootstrap to get new nqp:: ops.
22:05 dalek nqp: review: https://github.com/perl6/nqp/commit/f80be321b5
22:05 dalek nqp: a01efec | jnthn++ | src/ (4 files):
22:05 dalek nqp: Replace some Q:PIR with the various new ops.
22:05 dalek nqp: review: https://github.com/perl6/nqp/commit/a01efec6c0
22:10 masak r: sub ex($_) { return "" when ""; my ($f, $r) = .substr(0, 1), .substr(1); return $f when .chars == 1; my @r = ex $r; my ($f2, $r2) = .substr(0, 2), .substr(2); my @r2 = ex $r2; return $f2 < 27 ?? ("$f2 $_".trim for @r2) !! (), ("$f $_" for @r) }; sub l($s) { $s.words.map({($_ + "a".ord - 1).chr}).join }; say .&l for ex "123"
22:10 p6eval rakudo 75ee64: OUTPUT«lc␤aw␤abc␤»
22:10 masak yay
22:10 masak if at first you don't succeed... :)
22:11 masak though this would've been *so* much easier if :ex had worked to spec.
22:11 masak this is the first time I've wanted :ex
22:12 masak flussence: ^^^
22:17 flussence masak++
22:17 masak TDD++
22:17 flussence (I wonder if something [ab]using junctions would've worked...)
22:18 masak I tried .comb with a disjunction. the results were dissapointing.
22:18 masak rn: say "123".comb(/./ | /../)
22:18 p6eval rakudo 3619d7: OUTPUT«any(1, 2, 3, 12)␤»
22:18 p6eval ..niecza v22-14-g136ddcf: OUTPUT«any(["1", "2", "3"].list, ["12"].list)␤»
22:18 masak both of those answers are "wrong" from the perspective of the problme.
22:18 masak problem*
22:19 jnthn But unsurprising given how auto-threading works :)
22:19 masak seems what junctions do there is to mostly expose the internals of the .comb algorithm.
22:19 masak jnthn: yes.
22:19 jnthn (The junction never makes it into comb)
22:19 masak jnthn: perhaps if .comb had been defined recursively on the remaining string, it'd have worked.
22:20 * jnthn isn't sure he follows :)
22:20 jnthn If Rakudo passes spectest I'm running at the moment, we will have reached an interesting milestone...
22:22 masak oh?
22:24 whiteknight joined #perl6
22:25 dalek nqp: d82aa59 | jnthn++ | src/HLL/ (2 files):
22:25 dalek nqp: Eliminate use of lexpad_pull cheat.
22:25 dalek nqp:
22:25 dalek nqp: Logic re-written in terms of the new nqp:: ops.
22:25 dalek nqp: review: https://github.com/perl6/nqp/commit/d82aa5957d
22:25 dalek nqp: 843aec6 | jnthn++ | src/QRegex/P6Regex/Grammar.nqp:
22:25 dalek nqp: Stop loading now-unused PASTRegex library.
22:25 dalek nqp: review: https://github.com/perl6/nqp/commit/843aec6cd5
22:25 dalek nqp: 893a4d1 | jnthn++ | src/stage0/ (9 files):
22:25 dalek nqp: Update bootstrap to elminate PASTRegex usage.
22:25 dalek nqp: review: https://github.com/perl6/nqp/commit/893a4d1f00
22:25 jnthn And...
22:26 dalek nqp: c05f281 | jnthn++ | / (3 files):
22:26 dalek nqp: Eliminate callcontext cheat.
22:26 dalek nqp:
22:26 dalek nqp: This in turn means PASTRegex - the library the remaining .pir cheats
22:26 dalek nqp: were placed into - can now also go away. This means we have no .pir
22:26 dalek nqp: files in the NQP repository, apart from the generated-from-NQP stage0.
22:26 dalek nqp: review: https://github.com/perl6/nqp/commit/c05f28169a
22:26 arnsholt Cool!
22:32 masak jnthn++
22:32 masak 'night, #perl6
22:35 skids joined #perl6
22:40 jnthn japhb: One detail I forgot to mention: src/Perl6/Ops.pm is where we do nqp:: space things for the pir:: operations declared in src/ops/perl6.ops
22:40 jnthn (as in, that's where the mapping goes)
22:41 jnthn sleep &
23:00 tokuhiro_ joined #perl6
23:21 [Coke] jnthn++
23:33 [Coke] does nqp support typed method parameters?
23:33 [Coke] (i want to do a multi method, but method foo(String $string) {...} doesn't work.
23:35 [Coke] nqp: class A { method B(String $a) {say($a)} }; A.new().B("eek");
23:35 p6eval nqp: OUTPUT«Routine declaration requires a signature at line 2, near "(String $a"␤current instr.: 'panic' pc 13089 (src/stage2/gen/NQPHLL.pir:4619) (src/stage2/gen/NQPHLL.pm:324)␤»
23:35 [Coke] r: class A { method B(String $a) {say($a)} }; A.new().B("eek");
23:35 p6eval rakudo 3619d7: OUTPUT«===SORRY!===␤Invalid typename in parameter declaration at line 2, near " $a) {say("␤»
23:36 [Coke] r: class A { method B(Str $a) {say($a)} }; A.new().B("eek");
23:36 p6eval rakudo 3619d7: OUTPUT«eek␤»
23:36 [Coke] guess I'll do a single untyped method and put a switch in. :|
23:54 adu joined #perl6
23:55 [Coke] \o/ [llength "a b c"] now returns 3 in partcl again. That took too long. :)
23:57 adu o/
23:59 fgomez joined #perl6

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

Perl 6 | Reference Documentation | Rakudo