Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2012-04-28

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:03 colomon AFK
00:07 dalek tablets: bb22c7d | (Herbert Breunung)++ | docs/appendix-a-index.txt:
00:07 dalek tablets: repair conj entry
00:07 dalek tablets: review: https://github.com/perl6/tablets/commit/bb22c7d9c7
00:18 eviltwin_b joined #perl6
00:20 wolfman2000 joined #perl6
00:38 allbery_b joined #perl6
00:41 scott_ joined #perl6
00:42 dalek tablets: e4a5245 | (Herbert Breunung)++ | docs/appendix- (3 files):
00:42 dalek tablets: explain quote protection and add dummy for quasiquoting
00:42 dalek tablets: review: https://github.com/perl6/tablets/commit/e4a52454aa
01:07 eviltwin_b joined #perl6
01:08 dalek tablets: 3ac7047 | (Herbert Breunung)++ | docs/appendix- (3 files):
01:08 dalek tablets: repair the new links and polish quote ops
01:08 dalek tablets: review: https://github.com/perl6/tablets/commit/3ac70472cd
01:21 allbery_b joined #perl6
01:26 dalek tablets: 87c0e37 | (Herbert Breunung)++ | docs/appendix-b-grouped.txt:
01:26 dalek tablets: backlinking mutable types
01:26 dalek tablets: review: https://github.com/perl6/tablets/commit/87c0e37ffd
01:26 tokuhirom joined #perl6
01:28 skids joined #perl6
01:33 eviltwin_b joined #perl6
01:38 rsimoes joined #perl6
01:39 dalek tablets: 4285762 | (Herbert Breunung)++ | docs/appendix-b-grouped.txt:
01:39 dalek tablets: backlinking Contextualizers
01:39 dalek tablets: review: https://github.com/perl6/tablets/commit/4285762130
01:40 allbery_b joined #perl6
01:49 noam joined #perl6
01:52 replore joined #perl6
01:58 lichtkind gnight
02:11 geekosaur joined #perl6
02:15 pomysl joined #perl6
02:15 pomysl joined #perl6
02:17 colomon n: sub mcf($x) { gather loop { my $a = $x.floor; take $a; $x = $x - $a; last if $x == 0; $x = 1 / $x; }; }; mcf(3)
02:17 p6eval niecza v16-23-gaa61ed5:  ( no output )
02:18 colomon n: sub mcf($x) { gather loop { my $a = $x.floor; take $a; $x = $x - $a; last if $x == 0; $x = 1 / $x; }; }; say mcf(3).erpl
02:18 p6eval niecza v16-23-gaa61ed5: OUTPUT«Unhandled exception: Unable to resolve method erpl in class List␤  at /tmp/VaQxAPhEna line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3840 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3841 (module-CORE @ 65) ␤  at /home/…
02:18 colomon n: sub mcf($x) { gather loop { my $a = $x.floor; take $a; $x = $x - $a; last if $x == 0; $x = 1 / $x; }; }; say mcf(3).perl
02:18 p6eval niecza v16-23-gaa61ed5: OUTPUT«Unhandled exception: assigning to readonly value␤  at /tmp/n_8gIsNTCf line 1 (ANON @ 2) ␤  at /tmp/n_8gIsNTCf line 1 (ANON @ 3) ␤  at <unknown> line 0 (KERNEL dogather @ 1) ␤  at /home/p6eval/niecza/lib/CORE.setting line 2354 (GatherIterator.reify @ 3) ␤  â€¦
02:19 colomon n: sub mcf($x is copy) { gather loop { my $a = $x.floor; take $a; $x = $x - $a; last if $x == 0; $x = 1 / $x; }; }; say mcf(3).perl
02:19 p6eval niecza v16-23-gaa61ed5: OUTPUT«(3, ).list␤»
02:20 colomon r: sub mcf($x is copy) { gather loop { my $a = $x.floor; take $a; $x = $x - $a; last if $x == 0; $x = 1 / $x; }; }; say mcf(3).perl
02:20 p6eval rakudo dda5b0: OUTPUT«Method 'eager' not found for invocant of class 'Integer'␤  in sub coro at src/gen/CORE.setting:4926␤  in method reify at src/gen/CORE.setting:4907␤  in method reify at src/gen/CORE.setting:4678␤  in method gimme at src/gen/CORE.setting:5065␤  in method perl at src/…
02:20 sorear o/ colomon
02:20 colomon \o
02:21 colomon you're totally right about fail.
02:29 awwaiid joined #perl6
02:32 jaldhar joined #perl6
02:32 ponbiki joined #perl6
02:36 colomon r: sub mcf($x is copy) { gather loop { my $a = $x.floor; say $a; take $a; $x = $x - $a; last if $x == 0; $x = 1 / $x; }; }; say mcf(3).perl
02:36 p6eval rakudo dda5b0: OUTPUT«3␤Method 'eager' not found for invocant of class 'Integer'␤  in sub coro at src/gen/CORE.setting:4926␤  in method reify at src/gen/CORE.setting:4907␤  in method reify at src/gen/CORE.setting:4678␤  in method gimme at src/gen/CORE.setting:5065␤  in method perl at sr…
02:36 colomon r: say 3.floor
02:36 p6eval rakudo dda5b0: OUTPUT«3␤»
02:43 eviltwin_b joined #perl6
02:47 colomon r: sub mcf($x is copy) { gather loop { my $a = $x.floor; say $a; take $a; $x = $x - $a; last if $x == 0; $x = 1 / $x; }; }; say mcf(3)[0].perl
02:47 p6eval rakudo dda5b0: OUTPUT«3␤3␤»
02:47 orafu joined #perl6
02:48 colomon r: sub mcf($x is copy) { gather loop { my $a = $x.floor; say $a; take $a; $x = $x - $a; last if $x == 0; $x = 1 / $x; }; }; say mcf(3)[1].perl
02:48 p6eval rakudo dda5b0: OUTPUT«3␤Method 'eager' not found for invocant of class 'Integer'␤  in sub coro at src/gen/CORE.setting:4926␤  in method reify at src/gen/CORE.setting:4907␤  in method reify at src/gen/CORE.setting:4678␤  in method gimme at src/gen/CORE.setting:5065␤  in method exists at …
02:50 leprevost joined #perl6
02:51 colomon r: sub mcf($x is copy) { gather loop { take 1; last; }; }; say mcf(3)[1].perl
02:51 p6eval rakudo dda5b0: OUTPUT«Method 'eager' not found for invocant of class 'Integer'␤  in sub coro at src/gen/CORE.setting:4926␤  in method reify at src/gen/CORE.setting:4907␤  in method reify at src/gen/CORE.setting:4678␤  in method gimme at src/gen/CORE.setting:5065␤  in method exists at sr…
02:52 colomon r: sub mcf($x is copy) { gather loop { take 1; last; }; }; say mcf(3)[0].perl
02:52 p6eval rakudo dda5b0: OUTPUT«1␤»
02:52 colomon r: sub mcf($x is copy) { gather loop { take 1; last; }; }; say mcf(3).perl
02:52 p6eval rakudo dda5b0: OUTPUT«Method 'eager' not found for invocant of class 'Integer'␤  in sub coro at src/gen/CORE.setting:4926␤  in method reify at src/gen/CORE.setting:4907␤  in method reify at src/gen/CORE.setting:4678␤  in method gimme at src/gen/CORE.setting:5065␤  in method perl at src/…
02:52 colomon r: sub mcf($x) { gather loop { take 1; last; }; }; say mcf(3).perl
02:52 p6eval rakudo dda5b0: OUTPUT«Method 'eager' not found for invocant of class 'Integer'␤  in sub coro at src/gen/CORE.setting:4926␤  in method reify at src/gen/CORE.setting:4907␤  in method reify at src/gen/CORE.setting:4678␤  in method gimme at src/gen/CORE.setting:5065␤  in method perl at src/…
02:54 colomon n: sub mcf($x) { gather loop { take 1; last; }; }; say mcf(3).perl
02:54 p6eval niecza v16-23-gaa61ed5: OUTPUT«Potential difficulties:�  $x is declared but not used at /tmp/DfIHt7g5uH line 1:�------> [32msub mcf([33m�[31m$x) { gather loop { take 1; last; }; }; [0m��(1, ).list�»
02:54 colomon n: sub mcf() { gather loop { take 1; last; }; }; say mcf(3).perl
02:54 p6eval niecza v16-23-gaa61ed5: OUTPUT«Unhandled exception: Excess arguments to mcf, used 0 of 1 positionals␤  at /tmp/IiS6Lzbwik line 0 (mcf @ 1) ␤  at /tmp/IiS6Lzbwik line 1 (mainline @ 2) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3840 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setti…
02:54 colomon n: sub mcf() { gather loop { take 1; last; }; }; say mcf().perl
02:54 p6eval niecza v16-23-gaa61ed5: OUTPUT«(1, ).list␤»
02:55 colomon r: sub mcf() { gather loop { take 1; last; }; }; say mcf().perl
02:55 p6eval rakudo dda5b0: OUTPUT«Method 'eager' not found for invocant of class 'Integer'␤  in sub coro at src/gen/CORE.setting:4926␤  in method reify at src/gen/CORE.setting:4907␤  in method reify at src/gen/CORE.setting:4678␤  in method gimme at src/gen/CORE.setting:5065␤  in method perl at src/…
03:01 allbery_b joined #perl6
03:13 geekosaur joined #perl6
03:18 colomon r: sub mcf() { gather take 1; }; say mcf().perl
03:18 p6eval rakudo dda5b0: OUTPUT«(1,).list␤»
03:23 Su-Shee_ joined #perl6
03:48 eviltwin_b joined #perl6
03:51 geekosaur joined #perl6
04:04 spaceships joined #perl6
04:05 replore joined #perl6
04:07 replore__ joined #perl6
04:51 moritz \o
04:52 birdwindupbird joined #perl6
04:55 moritz r: constant %a = a => 1, b => 2; say %h.WHAT
04:55 p6eval rakudo dda5b0: OUTPUT«===SORRY!===␤Variable %h is not declared␤at /tmp/doOHAVgQdK:1␤»
04:56 moritz r: constant %a = a => 1, b => 2; say %a.WHAT
04:56 p6eval rakudo dda5b0: OUTPUT«Parcel()␤»
04:59 JimmyZ joined #perl6
04:59 JimmyZ r: dir | say
04:59 p6eval rakudo dda5b0: OUTPUT«␤Method 'FLATTENABLE_LIST' not found for invocant of class 'Bool'␤  in block <anon> at /tmp/lYHiWy5y3l:1␤␤»
05:00 JimmyZ std: dir | say
05:00 p6eval std fab64fc: OUTPUT«[31m===[0mSORRY![31m===[0m�Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument at /tmp/lnnbmLF7qN line 1:�------> [32mdir | say[33m�[31m<EOL>[0m�Check failed�FAILED 00:00 40m�»
05:11 dalek DBIish: 45dd6aa | moritz++ | lib/DBDish/Pg.pm6:
05:11 dalek DBIish: [Pg] query type OIDs, and map them to p6 type names
05:11 dalek DBIish: review: https://github.com/perl6/DBIish/commit/45dd6aae4e
05:16 sivoais joined #perl6
05:17 dalek DBIish: 6718e68 | moritz++ | lib/DBDish/mysql.pm6:
05:17 dalek DBIish: [mysql] simplify fetchrow_hashref
05:17 dalek DBIish: review: https://github.com/perl6/DBIish/commit/6718e68191
05:20 eviltwin_b joined #perl6
05:33 itz joined #perl6
05:56 robinsmidsrod joined #perl6
05:59 kaare_ joined #perl6
06:01 robinsmidsrod joined #perl6
06:07 allbery_b joined #perl6
06:28 geekosaur joined #perl6
06:34 eviltwin_b joined #perl6
06:40 geekosaur joined #perl6
06:47 erkan joined #perl6
06:49 eviltwin_b joined #perl6
07:05 fglock joined #perl6
07:18 allbery_b joined #perl6
07:23 GlitchMr joined #perl6
07:52 eviltwin_b joined #perl6
07:52 dalek rakudo/nom: a25e7d1 | pmichaud++ | src/Perl6/Actions.pm:
07:52 dalek rakudo/nom: Make bare loop statement use Perl 6 True instead of Parrot 1 value.  Fixes RT #112654.
07:52 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/a25e7d1da2
07:58 allbery_b joined #perl6
08:02 dalek tablets: 368aaa2 | (Herbert Breunung)++ | docs/appendix- (2 files):
08:02 dalek tablets: fixing links of last nights endevour
08:02 dalek tablets: review: https://github.com/perl6/tablets/commit/368aaa2873
08:03 eviltwin_b joined #perl6
08:03 pmichaud colomon / sorear:   fail() returns a Failure value containing an unthrown exception.  If the returned Failure isn't marked as handled somehow, any attempt to use the Failure as a normal value throws the exception.  Essentially, fail() is a soft failure ("return something that throws an exception if you attempt to use it"), while die() is a hard failure ("throw an exception immediately").
08:03 phenny pmichaud: 25 Apr 21:53Z <moritz> tell pmichaud basing a star release on rakudo 2012.04.1 seems to give star the version 2012.04.1 too. Should we try to separate that? or just go with it?
08:03 phenny pmichaud: 25 Apr 21:54Z <moritz> tell pmichaud never mind, doesn't seem hard
08:03 phenny pmichaud: 26 Apr 09:01Z <moritz> ask pmichaud to please enable the issues on github for rakudo/star
08:04 pmichaud phenny: tell moritz issues for rakudo/star now enabled on github
08:04 phenny pmichaud: I'll pass that on when moritz is around.
08:05 moritz phenny: thanks
08:05 phenny moritz: 08:04Z <pmichaud> tell moritz issues for rakudo/star now enabled on github
08:05 moritz erm, pmichaud :-)
08:05 pmichaud sure thing :)
08:05 pmichaud afk, sleep
08:05 moritz dammit, /me not fast enough
08:19 tadzik good morning
08:20 moritz \o tadzik
08:25 moritz during rakudo compilation, it seems that the PIR and POST stages require the most memory
08:25 moritz do we keep the nodes from the previous phases around during POST and PIR generation?
08:32 tadzik good news of the day: https://github.com/PerlGameDev/SDL6/tree/experimental is being worked on \o/
08:35 geekosaur joined #perl6
08:41 fhelmberger joined #perl6
08:41 eviltwin_b joined #perl6
08:47 dalek Perlito: 205df32 | (Flavio S. Glock)++ | / (9 files):
08:47 dalek Perlito: Perlito5 - parser: move named-subs to the named-block module
08:47 dalek Perlito: review: https://github.com/fglock/Perlito/commit/205df3295a
08:58 geekosaur joined #perl6
08:59 bbkr joined #perl6
08:59 GlitchMr42 joined #perl6
09:03 erkan joined #perl6
09:05 geekosaur joined #perl6
09:09 dalek roast: 0e05bd5 | moritz++ | S04-statements/loop.t:
09:09 dalek roast: RT #112654, gather loop
09:09 dalek roast: review: https://github.com/perl6/roast/commit/0e05bd55ad
09:14 dalek Perlito: 6c32749 | (Flavio S. Glock)++ | / (3 files):
09:14 dalek Perlito: Perlito5 - parser: add "sub BEGIN {}" syntax
09:14 dalek Perlito: review: https://github.com/fglock/Perlito/commit/6c3274957d
09:24 thelazydeveloper joined #perl6
09:58 moritz std: 1<=>2
09:58 p6eval std fab64fc: OUTPUT«[31m===[0mSORRY![31m===[0m�Two terms in a row at /tmp/UACCRNtz2G line 1:�------> [32m1<=>[33m�[31m2[0m�    expecting any of:�       POST�   infix or meta-infix�    infixed function�       postcircumfix�  postfix�        postfix_prefix_meta_operator�   postop� statement
09:58 p6eval ..modifier loop␤Pa…
10:00 jnthn Good noon, #perl6
10:01 moritz good midday, jnthn
10:01 jnthn Mmm. I think I feel well enough today to write code again. \o/
10:01 moritz \o/
10:01 * moritz should blag about DBIish
10:03 * jnthn will finally do his much-delayed second post on the hackathon too :)
10:14 jnthn std: 42.blah (1)
10:14 p6eval std fab64fc: OUTPUT«[31m===[0mSORRY![31m===[0m�Two terms in a row (method call requires colon or parens to take arguments) at /tmp/nHvdZSaGBb line 1:�------> [32m42.blah [33m�[31m(1)[0m�    expecting any of:�        infix or meta-infix�    infixed function�       statement modifier
10:14 p6eval ..loop␤Parse f…
10:19 masak good postnoon, #perl6
10:19 birdwindupbird joined #perl6
10:26 PacoAir joined #perl6
10:28 JimmyZ joined #perl6
10:30 * moritz blug: http://perlgeek.de/blog-en/perl-6/2012-dbiish.html
10:30 moritz good pn, masak :-)
10:37 gfldex where in the S?? are traits explained?
10:37 jnthn 14 iirc
10:38 gfldex found it, tyvm
10:41 jnthn pzh
10:47 * masak .oO( spice it up with abbreviations in Russian! )
10:47 whiteknight joined #perl6
10:48 jnthn пж :P
10:52 dalek Perlito: 7c52512 | (Flavio S. Glock)++ | src5/lib/Perlito5/Javascript/Runtime.pm:
10:52 dalek Perlito: Perlito5 - javascript: add AUTOLOAD infrastructure
10:52 dalek Perlito: review: https://github.com/fglock/Perlito/commit/7c525122ae
10:54 eviltwin_b joined #perl6
11:05 masak how about that https://rt.perl.org/rt3/Ticket/Display.html?id=112634 , eh?
11:05 masak it feels like a "usability vs. gosh that's a lot of work to implement" thing.
11:06 masak https://rt.perl.org/rt3//Public/Bug/Display.html?id=112632 is just wrong. rejecting it now.
11:08 jnthn masak: I expect 112634 to work some day.
11:08 jnthn masak: I'm happy enough having it as an RT.
11:08 jnthn masak: BTW, I rejected one other ticket this morning too.
11:08 jnthn Ah, and yes, 112632 is also right to reject.
11:08 holysword joined #perl6
11:09 holysword hi there
11:09 holysword could anyone enlight me if it is possible to print colorful messages in terminal using perl6?
11:10 masak hi holysword
11:10 masak that should be possible, yes.
11:10 jnthn holysword: I used colorful output in my Grammar::Debugger module...I used...lemme check..
11:10 * masak rejects #112636 too
11:10 jnthn use Term::ANSIColor;
11:10 masak oh, moritz++ already did.
11:10 holysword okay, thanks. I have been trying to google it, couldn't find many directions
11:10 holysword thank you
11:11 jnthn https://github.com/tadzik/perl6-Term-ANSIColor/
11:11 jnthn It worked nicely for me.
11:11 holysword thank you =D
11:12 masak we really need to improve those TTIAR/whitespace errors in Rakudo.
11:12 jnthn masak: We do.
11:12 jnthn masak: We should land qbootstrap first though.
11:12 holysword :P
11:13 masak jnthn: aye!
11:13 masak let's land the crap our of qbootstrap! \o/
11:13 masak out*
11:13 * jnthn looks around for a pmichaud :)
11:13 moritz seen pmichaud
11:13 aloha pmichaud was last seen in #perl6 3 hours 8 mins ago saying "afk, sleep".
11:14 jnthn I wonder if he can implement mark_commit in his sleep... :)
11:15 jnthn Anyway, once we get mark_commit and the NFA builder can get transitivity right, we should be a lot further forward with qbootstrap.
11:15 masak ok.
11:15 gfldex r: https://gist.github.com/2518066
11:15 p6eval rakudo a25e7d: OUTPUT«Null PMC access in find_method('slots')␤  in sub handle_call at /tmp/1Sr1bcbqU5:21␤  in any enter at src/gen/Metamodel.pm:2685␤  in method postcircumfix:<( )> at src/gen/CORE.setting:1601␤  in <anon> at src/gen/BOOTSTRAP.pm:815␤  in any <anon> at src/gen/BOOTSTRAP.…
11:17 jnthn Eek. That looks bad.
11:17 * gfldex tries to find the line that triggers Null PMC
11:18 jnthn (&$signal).connect($sender, $rcpt, $slot);
11:18 gfldex it'
11:18 jnthn ...what's that & doing there? :)
11:18 gfldex it's line 21
11:19 masak r: sub foo {}; my $bar = &foo; say &$bar
11:19 p6eval rakudo a25e7d: OUTPUT«sub foo() { ... }␤»
11:19 moritz r: class A { our method x() { say "A::x" } };  &A::x(A)
11:19 p6eval rakudo a25e7d: OUTPUT«A::x␤»
11:19 masak r: my $bar = 42; say &$bar
11:19 p6eval rakudo a25e7d: OUTPUT«42␤»
11:19 masak seems it's a no-op.
11:19 masak IMHO, that last one should be illegal.
11:20 gfldex i have a trait on a method. In line 31 i want to call the method that is mixed in from role Signal.
11:20 masak gfldex: if I were you, I'd just write '$signal' 'stead of '(&$signal)'
11:20 * gfldex tries
11:21 jnthn Yeah. I doubt that's the actual bug here though.
11:21 moritz @.slots.push([$sender, $rcpt, $method]);
11:21 masak it isn't.
11:21 moritz that shouldn't ever work
11:21 moritz because @!slots is typed to contain Method objects
11:21 moritz and you try to push an array on it
11:21 jnthn Wow, yes.
11:21 gfldex i changed &$signal to $signal, still Null PMC
11:21 masak still, that's not the bug either.
11:22 moritz aye
11:22 masak gfldex: right, we haven't found the cause for the Null PMC access yet.
11:22 masak try golfing it :)
11:22 moritz r: class A { has Method @.slots; }; A.new.slots.push: [1, 2, 3]
11:22 p6eval rakudo a25e7d:  ( no output )
11:22 moritz masak: wanna submit?
11:22 gfldex changed Method @.slots to just @.slots, still Null PMC
11:23 * masak submits rakudobug
11:23 masak gfldex: right, that's not the cause of the Null PMC access. we know this.
11:23 masak ;)
11:23 masak just finding different, easier errors on the way.
11:23 gfldex https://gist.github.com/2518066 updated
11:24 sergot joined #perl6
11:24 sergot hi o/
11:24 masak sergocie! \o/
11:24 gfldex i don't think i can golf it much
11:24 * masak tries, then
11:25 moritz the weird thing is, it explodes while invoking method pressed
11:26 gfldex yes and it calls the wrong handle_call
11:26 moritz but nothing seems to override its invoke/postcircumfix:<( )>
11:26 jnthn That &wrap call means you are wrapping with the proto.
11:27 moritz oh, erm, does .wrap on a method work at all=
11:27 moritz s/=/?/
11:27 jnthn And that trait_mod along with the multi, proto etc. has to be compiled "just in time" since the trait_mod runs at BEGIN time.
11:27 jnthn Yes, .wrap is defined on Routine.
11:28 moritz r: class A { our method x { say 'A.x' }; }; BEGIN &A::x.wrap( sub(*@) { say 'OH WRAP' }); A.x
11:28 p6eval rakudo a25e7d: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 2␤»
11:28 gfldex my guess is that the dispatcher is calling the wrong handle_call with a capture that is empty but not
11:28 oiig_ joined #perl6
11:28 jnthn But a $m should be in scope and not null in either case.
11:29 moritz r: class A { our method x { say 'A.x' }; }; BEGIN &A::x.wrap( sub (*@a) { say 'OH WRAP' }); A.x
11:29 p6eval rakudo a25e7d: OUTPUT«OH WRAP␤»
11:29 moritz hm, doesn't seem to call the method
11:29 gfldex i don't think $m is null, let me check
11:29 moritz do I need to nextsame?
11:29 moritz r: class A { our method x { say 'A.x' }; }; BEGIN &A::x.wrap( sub (*@a) { say 'OH WRAP'; nextsame }); A.x
11:29 p6eval rakudo a25e7d: OUTPUT«OH WRAP␤A.x␤»
11:29 jnthn gfldex: multi handle_call {
11:29 jnthn In this case, that candidate can never match.
11:30 jnthn Because a method *always* has at least one argument.
11:30 gfldex well, $m seamt to be null
11:30 jnthn Yeah, it shouldn't be.
11:30 gfldex i added say $m.elems; and it explodes
11:30 jnthn I suspect it's some kind of lexical chaining issue.
11:31 masak $m.WHAT says Method+{Signal}()
11:31 gfldex s/i added say $m.elems; and it explodes/nvm/ gfldex--
11:32 gfldex actually say $m.slots.elems; explodes
11:32 jnthn masak: Not if you do it inside of the multi handle_call
11:33 masak oh!
11:33 jnthn OK, it's the multi that is somehow to blame
11:33 masak Can only use get_what on a SixModelObject
11:33 gfldex if i say multi handle_call in the trait_mod multi, does it create a clousure?
11:33 masak yeah, that feels like a lexpad outer chain corruption.
11:33 jnthn https://gist.github.com/2518209 gets much further
11:34 jnthn masak: Yeah, something along those lines.
11:34 * masak submits rakudobug
11:34 moritz adding a proto also gets much further
11:34 jnthn Now we know what it is, it's probably very golfable.
11:34 jnthn moritz: oh...
11:35 jnthn moritz++
11:35 mucker joined #perl6
11:35 masak r: { my $s = 42; multi foo { say $s }; foo }
11:35 p6eval rakudo a25e7d: OUTPUT«42␤»
11:35 gfldex moritz: at what point?
11:35 masak not as simple as that, it seems.
11:36 masak r: sub bar {}; { my $s = 42; multi foo { say $s }; &bar.wrap(&foo) }; bar
11:36 p6eval rakudo a25e7d: OUTPUT«42␤»
11:36 masak nor even as simple as that.
11:36 masak I'm approaching this from the wrong end :P
11:37 jnthn https://gist.github.com/2518235
11:37 jnthn gfldex: ^^
11:38 gfldex that makes sense
11:38 gfldex but the compiler should be a bit more concerned without the proto :)
11:38 gfldex but it still doesnt work how i would like it to
11:39 jnthn masak: https://gist.github.com/2518262 - this golfs it some way
11:40 gfldex because |$args should be empty
11:40 jnthn masak: Uncommenting the proto explodes
11:40 jnthn gfldex: It will never be empty because you're wrapping a *method*.
11:40 jnthn GlitchMr: You'll always have at least one argument.
11:40 jnthn er
11:40 jnthn sorry, that was for gfldex :)
11:40 gfldex so i have to strip the first argument?
11:40 jnthn Well, the first argument is the invocant.
11:40 sergot joined #perl6
11:41 gfldex i have the invocant anyways
11:41 jnthn multi handle_call($invocant, |$rest) { } # works
11:42 gfldex and i should not need a multi anymore
11:42 masak jnthn: we had an RT ticket about that the other day.
11:43 jnthn masak: ?
11:44 snearch joined #perl6
11:47 JimmyZ http://everythingsysadmin.com/2011/01/python-is-better-than-perl6.html
11:49 masak r: role R { has $.x }; multi trait_mod:<is>($m, :$a!) { $m does R; multi y(|$) { say $m }; $m.wrap(&y) }; (class { method z is a {} }).z;
11:49 p6eval rakudo a25e7d: OUTPUT«Null PMC access in find_method('gist')␤  in sub say at src/gen/CORE.setting:6555␤  in sub y at /tmp/Ipv8GSFBLg:1␤  in any enter at src/gen/Metamodel.pm:2685␤  in method postcircumfix:<( )> at src/gen/CORE.setting:1601␤  in <anon> at src/gen/BOOTSTRAP.pm:815␤  in an…
11:49 masak golf'd. :)
11:49 masak jnthn: I'll find it for you.
11:50 masak jnthn: https://rt.perl.org/rt3/Ticket/Display.html?id=112642
11:51 masak no, wait.
11:52 masak r: multi trait_mod:<is>($m, :$a!) { multi y(|$) { say $m }; $m.wrap(&y) }; (class { method z is a {} }).z;
11:52 p6eval rakudo a25e7d: OUTPUT«Null PMC access in find_method('gist')␤  in sub say at src/gen/CORE.setting:6555␤  in sub y at /tmp/LxB4luvHae:1␤  in any enter at src/gen/Metamodel.pm:2685␤  in method postcircumfix:<( )> at src/gen/CORE.setting:1601␤  in <anon> at src/gen/BOOTSTRAP.pm:815␤  in an…
11:52 masak roles don't enter into it.
11:52 masak it's *so* easy to become blind by positive confirmation bias.
11:52 masak that's why golfing is useful.
11:52 jnthn masak: And you can fix that one by adding an explicit proto, yes?
11:52 masak dunno.
11:53 jnthn r: multi trait_mod:<is>($m, :$a!) { proto y(|$) { * }; multi y(|$) { say $m }; $m.wrap(&y) }; (class { method z is a {} }).z;
11:53 p6eval rakudo a25e7d: OUTPUT«z␤»
11:53 jnthn Yes, you can
11:53 jnthn So it's everything to do with the auto-generated proto.
11:53 masak r: multi trait_mod:<is>($m, :$a!) { multi y(|$) { say $m }; $m.wrap(&y) }; sub foo is a {}; foo
11:53 p6eval rakudo a25e7d: OUTPUT«Null PMC access in find_method('gist')␤  in sub say at src/gen/CORE.setting:6555␤  in sub y at /tmp/brOPOBDGQV:1␤  in any enter at src/gen/Metamodel.pm:2685␤  in method postcircumfix:<( )> at src/gen/CORE.setting:1601␤  in <anon> at src/gen/BOOTSTRAP.pm:815␤  in an…
11:53 masak huh! classes don't enter into either.
11:53 masak yes. it's the auto-gen proto's the culprit.
11:54 * masak concentrates this down into a simple bug report
11:54 jnthn Derived dispatchers too if the patch I'm trying at the moment works.
11:54 jnthn Yeah, I think I have a patch locally.
11:55 jnthn r: multi trait_mod:<is>($m, :$a!) { multi y(|$) { say $m }; $m.wrap(&y) }; sub foo is a {}; foo
11:55 p6eval rakudo a25e7d: OUTPUT«Null PMC access in find_method('gist')␤  in sub say at src/gen/CORE.setting:6555␤  in sub y at /tmp/Sji3LNwiKd:1␤  in any enter at src/gen/Metamodel.pm:2685␤  in method postcircumfix:<( )> at src/gen/CORE.setting:1601␤  in <anon> at src/gen/BOOTSTRAP.pm:815␤  in an…
11:55 JimmyZ r: dir | say #bug too ?
11:55 p6eval rakudo a25e7d: OUTPUT«␤Method 'FLATTENABLE_LIST' not found for invocant of class 'Bool'␤  in block <anon> at /tmp/8boAQ0TDGi:1␤␤»
11:56 jnthn LTA error.
11:56 jnthn Can fix that one.
11:56 jnthn Should be more like "Cannot flatten a Bool into an argument list"
11:56 JimmyZ std: dir | say
11:56 p6eval std fab64fc: OUTPUT«[31m===[0mSORRY![31m===[0m�Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument at /tmp/BtEzDiPQWI line 1:�------> [32mdir | say[33m�[31m<EOL>[0m�Check failed�FAILED 00:00 40m�»
11:56 jnthn Well, also that.
11:56 jnthn But if you choose something other than say that returns a bool...
11:57 JimmyZ :)
11:57 jnthn Feel free to file as LTA error, anywya.
11:57 jnthn *anyway
11:58 holysword hi again! I would like to know how I can use the "do filename" thing in perl6, please!
11:59 JimmyZ what is 'do filename'?
12:00 jnthn In Perl 5, do 'filename' would read the file, eval the code and run it, iirc.
12:00 holysword yes, exactly jnthn
12:00 jnthn In Perl 6 we don't overload do to do that...
12:00 jnthn I guess you can: eval slurp 'filename';
12:00 holysword oh, so how can I do that? is there any other command?
12:00 holysword hum...
12:00 jnthn slurp reads the whole file in, eval runs that code.
12:01 jnthn Which I guess is what Perl 5 really does
12:01 jnthn Hmm...is there an evalfile too, I wonder...
12:01 eviltwin_b joined #perl6
12:04 holysword I am starting to learn Perl now for the first time, and I starting to seriously consider learning Perl5 rrrather than perl6 O.O
12:04 masak JimmyZ: did you RT-submit the LTA error?
12:04 dalek rakudo/nom: 6c9661f | jnthn++ | src/Perl6/Actions.pm:
12:04 dalek rakudo/nom: Fix a lexical handling bug in installation of auto-generated protos and derived dispatchers. gfldex++ for reporting, moritz++ for realizing it was about protos.
12:04 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/6c9661f5d0
12:05 jnthn masak: ^^ means the ticket can be tagged testneeded.
12:05 gfldex that was one fast bugfix :)
12:06 JimmyZ masak: RT #112662
12:06 masak JimmyZ++
12:06 masak jnthn: I'm on it.
12:07 gfldex what's the most basic type of a class?
12:08 jnthn gfldex: If you declare "class Foo { }" then it inherits from Any, if that's what you mean.
12:08 jnthn Mu is above Any, but you generally want to inherit from Any.
12:08 gfldex r: say Role ~~ Any;
12:08 p6eval rakudo a25e7d: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&Role' called (line 1)␤»
12:09 jnthn There's no "Role" type, just as there's no "Class" type
12:09 jnthn There are meta-objects, but those live off in the Metamodel:: namespace
12:09 masak there's just HOWs, which are metaobjects.
12:09 jnthn And there's four of them related to roles :)
12:10 * jnthn should give a talk on how that lot is factored some day, for people who are bonkers enough to come to such talks... :)
12:11 gfldex r: my class A {}; sub foo($some_class:D){}; foo(A.new); foo(A);
12:11 p6eval rakudo a25e7d: OUTPUT«===SORRY!===␤invoke() not implemented in class 'Capture'␤»
12:11 moritz jnthn: I'd live to hear that talk
12:11 moritz *love
12:11 moritz :-)
12:12 jnthn gfldex: Uh...other than get Rakudo to spit out weird errors, what were you trying to do? :)
12:12 masak jnthn: what moritz said.
12:12 gfldex i want to force a real object instead of a metaobject
12:12 masak gfldex: X/Y
12:12 jnthn s/metaobject/type object/
12:12 masak gfldex: what do you *really* want to do? :)
12:12 jnthn r: my class A {}; sub foo(Any:D){}; foo(A.new); foo(A);
12:12 masak take a step back. no, take two steps back.
12:12 p6eval rakudo 6c9661: OUTPUT«Parameter '' requires an instance, but a type object was passed␤  in sub foo at /tmp/CZ_1PUcPNj:1␤  in block <anon> at /tmp/CZ_1PUcPNj:1␤␤»
12:13 jnthn Like that.
12:13 gfldex that one :)
12:13 jnthn Mini-challenge for a C hacker: find a way to make that error include the paramter index instead of '' :)
12:14 araujo joined #perl6
12:14 gfldex what i really want to do is http://doc.qt.nokia.com/4.7/signalsandslots.html
12:14 gfldex and i'm getting closer :)
12:15 masak jnthn++ # understanding what gfldex wanted
12:15 masak gfldex++ # cool QT experimenting
12:15 dalek nqp: edd14da | jnthn++ | tools/build/PARROT_REVISION:
12:15 dalek nqp: Now the release is done, we can bump PARROT_REVISION to the one with pmichaud++'s fixes for Unicode handling.
12:15 dalek nqp: review: https://github.com/perl6/nqp/commit/edd14dadfd
12:16 gfldex qt's signal and slot stuff is real clever, they sneak late binding into c++
12:16 gfldex that might be the reason why signal/slots in perl6 are so much easier to implement :)
12:16 moritz but you can get late binding in p6 much easier :-)
12:17 moritz i mean, you can just call $obj."$methodname"(|$capture) to get late binding, no?
12:17 masak hehe. methods already give you late binding.
12:17 masak "no, no. later than that!" :P
12:17 gfldex you can but in contrast to qt's moc the compiler can be picky at compile time
12:17 gfldex at least that's what i hope
12:18 * masak wants to give a talk about late binding at some point
12:18 mdupont joined #perl6
12:18 dalek rakudo/nom: 2a962e3 | jnthn++ | tools/build/NQP_REVISION:
12:18 dalek rakudo/nom: Bump NQP_REVISION. Can haz somewhat cleaner spectest runs without ICU; pmichaud++.
12:18 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/2a962e3f98
12:19 moritz "Callbacks have two fundamental flaws: Firstly, they are not type-safe."
12:19 moritz erm, what?
12:19 jnthn huh? :)
12:19 masak sez who?
12:19 moritz http://doc.qt.nokia.com/4.7/signalsandslots.html
12:20 jnthn ooh, Swedish has one of its National Days Off To Hack on Tuesday :)
12:20 jnthn s/Swedish/Sweden/
12:20 masak yep.
12:20 masak not just Sweden.
12:20 jnthn Oh?
12:20 masak it's International Something Day.
12:20 jnthn Oh yeah
12:21 jnthn Isn't it a good day to have political protests too? :)
12:21 masak I seem to recall it's about women going into labor... or something.
12:21 * gfldex makes a sign that says: "Free Perl6 for everyone!!!"
12:22 Su-Shee 1st of may is worker's movements day.
12:22 Su-Shee masak: aua ;)
12:22 jnthn masak: Oh, so it happens 9 months after national get pregnant day? :)
12:22 masak my dad, when we was running his own company, was fond of saying "This year, just like every year, I will celebrate International Labor Day... by going to work." :P
12:22 jnthn :D
12:23 * jnthn wonders if Monday will be a half-day
12:23 masak yep.
12:23 jnthn wtf :)
12:23 jnthn That's pointless
12:23 jnthn Weekend
12:23 jnthn Then go into work for 3 hours
12:23 jnthn Then a day and a half off!
12:23 jnthn :)
12:23 gfldex my dad was ordered by the state to protest when i was a wee boy (nobody knew what for)
12:23 Su-Shee gfldex: let me guess.. socialist country? :)
12:24 gfldex eastern germany
12:24 Su-Shee ;)
12:24 masak jnthn: welcome to the land of "klämdag".
12:24 Su-Shee masak: "kläm"?
12:24 masak phenny: sv en "klämdag"?
12:24 phenny masak: "klämdag" (sv to en, translate.google.com)
12:24 masak phenny: sv en "klämma"?
12:24 phenny masak: "terminal" (sv to en, translate.google.com)
12:24 masak g'ah!
12:24 Su-Shee like klempner, plummer? :)
12:24 masak phenny: en sv "squeeze"?
12:24 phenny masak: "pressa" (en to sv, translate.google.com)
12:24 masak tut tut.
12:25 masak it literally translates as "squeeze day". as in, the day gets squeezed in between two periods of being off work.
12:25 jnthn .oO( klämrisk )
12:25 masak that's usually a Friday, but this time it's a Monday.
12:25 moritz phenny: "brückentag"?
12:25 phenny moritz: "Bridge Day" (de to en, translate.google.com)
12:26 masak our metaphor beats your metaphor. :)
12:27 masak or squeezes it, perhaps.
12:27 moritz your metaphor is violent, it seems :-)
12:27 masak it pinches rather than punches.
12:27 * moritz has already mostly updated from Squeeze to Wheezy
12:28 * jnthn afk for a little bit
12:32 laurus joined #perl6
12:32 * moritz wonders if that signalling thing could go into a role that is mixed into objects or classes, not into methods
12:34 gfldex moritz: that would not make sense because slots are just methods and signals are kind of not really methods or better they are all the same beside their @.slots;
12:36 sergot joined #perl6
12:37 moritz gfldex: you're probably right, and it's simply my infamiliarity with the whole system that makes me wonder
12:37 gfldex and it would be nice to have class Foo { signal pressed; }; class Bad { slot exit() { $*GLOBAL::exit }; my $a = Foo.new; my $b = Bar.new; connect($a.pressed, $b.exit);
12:37 gfldex so there would be at least some macroing needed if not some grammar-foo
12:38 gfldex and i'm eager to get there :)
12:38 gfldex because signal/slot is very very nice
12:38 gfldex it's so easy to reuse code that way
12:39 gfldex there will be blogging where i explain
12:46 geekosaur joined #perl6
12:48 JimmyZ method exit is slot?
12:48 moritz jnthn: do the Test::Util based tests now pass on your machine?
12:50 jnthn moritz: Seems so
12:50 jnthn I still have scattered failures
12:50 jnthn Many in pod.
12:51 jnthn Hmm...we could really do with -I
12:51 gfldex JimmyZ: slot exit() { ... } would translate to our method exit is slot() { ... }
12:52 gfldex it's mostly because of the our because that's easy to forget
12:53 jnthn Why do you need the "our"?
12:53 mucker o/ #perl6
12:53 gfldex because &Foo::bar would return Nil (or nil)
12:53 jnthn Why do you need to look it up that way?
12:53 jnthn Why not Foo.^find_method('bar') for example?
12:54 gfldex i could do that if i have unhygienic macros
12:54 gfldex or maybe not
12:55 laurus left #perl6
12:55 * jnthn will wait for the gfldex++ blog posts and then comment :)
12:55 jnthn (I'm not familiar with the signals/slots thing either.)
12:55 gfldex if i go connect($obj1, 'method1', $obj2, 'method2'); i get the error message for a typo at runtime
12:56 gfldex that's exactly the problem with qt's moc
12:56 gfldex the connect happens at runtime and you get the typecheck and lexical check late
12:56 gfldex the advantage is that it works inbetween different processes
12:56 masak "unhygienic" !=== "operates on text rather than ASTs"
12:57 gfldex masak: i am most sorry to have hurt your macro feelings :)
12:57 gfldex so you can call a slot in a c++ application from the bash
12:58 gfldex that includes all kde apps
12:58 gfldex all you have to do is to write: slot void my_method(){};
12:58 gfldex and that slot is even an empty macro :)
12:59 masak gfldex: no hurt feelings, just trying to improve the general public's understanding of macros ;)
12:59 masak ASTness and hygiene are two distinct levels of purity.
13:00 masak if it made sense to talk about pure textual macros -- maybe it does, though I doubt it -- you could combine textual/AST and impure/pure all four ways.
13:00 gfldex i would rather not, macros are confusing as they are :)
13:02 masak the point of textual macros is that they can ignore or span boundaries easier than AST macros. they're sloppier, and harder to analyze.
13:02 masak but they can certainly have a lexically scoped influence, and indeed I suspect they will in Perl 6.
13:04 mucker joined #perl6
13:06 masak but there's nothing that stops a textual macro from inserting the variable name '$' ~ whatever() at a point -- and getting hygiene from that, well, hm. could be it comes down to solving the halting problem, actually.
13:08 masak hm, no. it's simpler than that.
13:08 masak what we *want* from that text insertion is unhygiene.
13:08 masak so they're not compatible, and by design.
13:12 eviltwin_b joined #perl6
13:18 godfrey999 joined #perl6
13:22 geekosaur joined #perl6
13:23 masak hm, another way of looking at it is that AST macros come with their own block boundaries, and text macros don't. block boundaries of some sort are needed for hygiene.
13:27 gfldex Stage parse: 106.830
13:27 gfldex Stage syntaxcheck: 0.000
13:27 gfldex ...
13:27 gfldex would it be possible to have vmsize_peak too?
13:29 eviltwin_b joined #perl6
13:30 yeltzooo joined #perl6
13:30 masak gfldex: don't mind the figures in 'Stage parse' and 'Stage syntaxcheck'. they're meaningless.
13:31 gfldex r: https://gist.github.com/2519081
13:31 p6eval rakudo 2a962e: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤»
13:31 masak I guess it's entirely possible to have vmsize_peak too.
13:31 masak gfldex: missing a '
13:31 masak at line 21
13:31 gfldex copy paste fail
13:32 masak doesn't really matter, does it? :)
13:32 gfldex r: https://gist.github.com/2519081
13:32 p6eval rakudo 2a962e: OUTPUT«turn method into signal  in sub trait_mod:<is> at /tmp/X9OVJoWQxX:16␤␤turn non-method into signal  in sub trait_mod:<is> at /tmp/X9OVJoWQxX:30␤␤0␤Button()::pressed - App()::exit␤App::exit called␤Routine signal handler called␤1␤sub+{signal}+{wrapped} bare_signal_exi…
13:32 gfldex that's not to helpful, need to change a few bits
13:33 masak another good way to test your programs is to run them locally.
13:34 gfldex i may have found another bug and you wont like that one :)
13:34 gfldex r: https://gist.github.com/2519081
13:34 p6eval rakudo 2a962e: OUTPUT«turn method into signal  in sub trait_mod:<is> at /tmp/e5bpYL1Bk6:16␤␤turn non-method into signal  in sub trait_mod:<is> at /tmp/e5bpYL1Bk6:30␤␤0␤App::exit called␤App::exit called␤»
13:34 gfldex grrrr
13:36 gfldex r: https://gist.github.com/2519081
13:36 p6eval rakudo 2a962e: OUTPUT«0␤App::exit called␤App::exit called␤»
13:36 gfldex r: https://gist.github.com/2519083
13:36 p6eval rakudo 2a962e: OUTPUT«App::exit called␤»
13:36 gfldex the only difference of those two gists is in line 33
13:37 gfldex it should call App::exit twice for both
13:37 masak please golf this, and I'll submit it.
13:38 skids joined #perl6
13:41 dalek tablets: 039be2a | (Herbert Breunung)++ | docs/appendix- (3 files):
13:41 dalek tablets: more repaired links
13:41 dalek tablets: review: https://github.com/perl6/tablets/commit/039be2a7be
13:42 allbery_b joined #perl6
13:43 arnsholt o/
13:45 gfldex masak: that's as short as i can get it https://gist.github.com/2519182
13:51 gfldex masak: update: https://gist.github.com/2519182
13:53 jaldhar joined #perl6
13:58 * masak tries to golf it further
13:59 masak generally, if it contains 'use v6;', it's too long :P
13:59 gfldex masak: i got it a little shorter myself
13:59 jnthn .oO( and finally putts it in RT )
13:59 gfldex https://gist.github.com/2519279
14:00 masak still very long.
14:00 masak you can't see what's happening when it spans several lines like that.
14:00 gfldex i can put it all on one line if you like :)
14:00 masak and remove all the other cruft.
14:01 masak the 'say' is unnecessary.
14:01 masak I think the '.elems' is the key component there.
14:01 masak making the bug about lazy lists.
14:01 masak nope.
14:01 gfldex can't be
14:01 masak the '.elems' is unnecessary too.
14:02 masak but the '.slots' is necessary.
14:05 leprevost joined #perl6
14:08 gfldex masak: not even that, update: https://gist.github.com/2519279
14:09 gfldex where the heck does it take the @a from in the wrap({block}) ?
14:09 jnthn I'm not really surprised that doesn't work...
14:09 jnthn The @a would be the one in the static lexpad I guess...
14:10 jnthn Whereas when the mainline actually runs, it gets a fresh @a
14:10 eviltwin_b joined #perl6
14:10 gfldex so it should either work or complain that @a is not declared?
14:11 jnthn But it is declared
14:11 jnthn You're talking about two different @as
14:11 gfldex because of the -> ?
14:11 jnthn Because of BEGIN time
14:11 jnthn That trait_mod runs at BEGIN time.
14:12 masak yes, it is BEGIN time. why does that make it two different @a ?
14:12 jnthn sub foo() { my @a }; foo; foo; # how many @a ?
14:13 gfldex if you add @a.elems; right before $r.wrap it works
14:13 jnthn Hm
14:13 gfldex and @a.elems is called at BEGIN indeed
14:13 jnthn Yeah...
14:13 jnthn That may well be a case of "works by accident"
14:13 jnthn You actually vivify the @a then
14:14 jnthn I guess you vivify the one in the static lexpad.
14:14 jnthn And then it gets copied
14:14 jnthn nom: sub foo() { my @a; BEGIN { @a = 1,2,3 }; say @a; }; foo(); foo();
14:14 p6eval rakudo 2a962e: OUTPUT«elements() not implemented in class 'Mu'␤  in method REIFY at src/gen/CORE.setting:5280␤  in method REIFY at src/gen/CORE.setting:5527␤  in method reify at src/gen/CORE.setting:4691␤  in method reify at src/gen/CORE.setting:4678␤  in method gimme at src/gen/CORE.se…
14:14 gfldex but why does it get copied instead of forming a closure?
14:14 jnthn Wow.
14:14 masak here we go.
14:14 masak r: role R { has @.s is rw }; multi trait_mod:<is>($r, :$x!) { $r does R; sub h(|$){ for $r.s { &^m() } }; $r.wrap(&h) }; sub b is x {}; push &b.s, { say "OH HAI" }; b
14:14 p6eval rakudo 2a962e:  ( no output )
14:14 masak r: role R { has @.s is rw }; multi trait_mod:<is>($r, :$x!) { $r does R; $r.s; sub h(|$){ for $r.s { &^m() } }; $r.wrap(&h) }; sub b is x {}; push &b.s, { say "OH HAI" }; b
14:14 p6eval rakudo 6c9661: OUTPUT«OH HAI␤»
14:14 masak note.
14:14 masak only difference.
14:15 masak '$r.s'
14:15 * masak submits rakudobug
14:15 jnthn :/
14:15 masak whatever the cause or underlying subtleties with BEGIN time, that *shouldn't* happen.
14:15 jnthn OK, maybe I should find a way to make this not work at all.
14:16 gfldex but how do you carry state in a trait_mod:<is> then?
14:16 masak jnthn: that sounds like a good start.
14:16 * masak does another RT ticket of massive bookkeeping
14:16 masak gfldex++ # extending our limits :)
14:17 gfldex or to ask the question from a perl6user viewpoint: how do i do that correctly?
14:17 gfldex it's funny how one can find bugs in a language by actually using that language :)
14:18 masak how else would you find them?
14:19 gfldex well, you have design by committee and then some magic
14:19 gfldex that's at least what managers tend to believe
14:22 jnthn masak: The bug you filed isn't to do with BEGIN time.
14:23 jnthn It's to do with .clone not doing the right kinda thing with arrays.
14:23 jnthn Just worked out what's going on.
14:23 masak ok.
14:24 masak I'm still editing it, so I can still change the subject line. :)
14:25 jnthn I suspect all the odd behavior we have here may actually be down to that kind of thing.
14:25 masak https://rt.perl.org/rt3/Ticket/Display.html?id=112666
14:27 jnthn I won't fix it right now, but basically, the $r.s causes some interals of the Array to come to life earlier, and then the (already known) .clone issue with Array kicks in and over-shares stuff.
14:30 lichtkind joined #perl6
14:30 preflex_ joined #perl6
14:31 dalek Heuristic branch merge: pushed 28 commits to nqp/toqast by jnthn
14:31 lichtkind shouldnt be there also a meta category for regex and other slangs?
14:32 lichtkind jnthn++
14:36 Chillance joined #perl6
14:36 masak a meta-category in what?
14:36 jnthn What's a meta-category? :)
14:36 lichtkind grammatical metacat
14:36 lichtkind if you want to make your own class of regex thingies
14:39 masak lichtkind: to the extent that I understand what a metacategory is: no. there shouldn't.
14:40 masak I see 27 grammatical categories in S02.
14:40 masak the only one I'd call a "meta-category" is the first one, 'category:'
14:41 masak I don't think we need more than that.
14:45 masak STD.pm6 has 37 categories. <category sigil twigil special_variable comment version module_name value term numeric quote prefix infix postfix dotty circumfix postcircumfix quote_mod trait_mod initializer type_declarator scope_declarator package_declarator multi_declarator routine_declarator regex_declarator statement_prefix statement_control statement_mod_cond statement_mod_loop infix_prefix_meta_operator infix_postfix_meta_operator infix_circumfix_meta_operat
14:48 dalek nqp/toqast: 9dbb0ea | masak++ | t/qast/qast.t:
14:48 dalek nqp/toqast: [t/qast/qast.t] belatedly update test count
14:48 dalek nqp/toqast:
14:48 dalek nqp/toqast: jnthn++
14:48 dalek nqp/toqast: review: https://github.com/perl6/nqp/commit/9dbb0ea0c3
14:50 masak lichtkind: look at STD.pm6:4791, how Regex is defining its own categories in the 'category:' category.
14:51 masak and that's in the Regex grammar, so it definitely qualifies for your use case, "if you want to make your own class of regex thingies" :)
14:56 fhelmberger joined #perl6
15:03 dalek nqp/toqast: 6fe3c6c | jnthn++ | src/QAST/Operations.nqp:
15:03 dalek nqp/toqast: Add a way to register op compilation handlers at core and HLL level.
15:03 dalek nqp/toqast: review: https://github.com/perl6/nqp/commit/6fe3c6ce1c
15:03 dalek nqp/toqast: 29c96d3 | jnthn++ | t/qast/qast.t:
15:03 dalek nqp/toqast: Merge branch 'toqast' of github.com:/perl6/nqp into toqast
15:03 dalek nqp/toqast: review: https://github.com/perl6/nqp/commit/29c96d30c9
15:03 dalek nqp/toqast: a4bd66d | jnthn++ | t/qast/qast.t:
15:03 dalek nqp/toqast: Test WVal node.
15:03 dalek nqp/toqast: review: https://github.com/perl6/nqp/commit/a4bd66d8e4
15:03 dalek nqp/toqast: b54c728 | jnthn++ | / (2 files):
15:03 dalek nqp/toqast: Compile op 'list'; test.
15:03 dalek nqp/toqast: review: https://github.com/perl6/nqp/commit/b54c728e07
15:05 masak right, so a WVal is a value that's been registered in the World?
15:06 jnthn Some world, somewhere.
15:06 masak right.
15:06 jnthn May not be the world of the current compilation unit. May be a cross-ref.
15:06 * masak .oO( many-worlds interpretation )
15:08 jnthn Main thing is we have a node for it now. :)
15:09 masak \o/
15:09 jnthn The 6model <=> QAST integration conspiracy deepens!
15:09 masak the most beautiful thing about each refactor is how each layer becomes more accomodating and adapted to other layers.
15:10 jnthn masak: What QAST-y bits do you want to work on?
15:11 jnthn masak: Just the pirop mapping for now?
15:11 jnthn I'm pondering doing conditionals (ops if and unless) next...
15:13 masak I'll work on the pirop mapping unless there is some other place where I could be of significantly more use.
15:13 jnthn Go for it.
15:13 masak \o/
15:13 jnthn If you want some pain, you can take on the keyed bits too. :)
15:13 jnthn (That's the Qs that show up.)
15:14 masak sounds like masakistic fun! ;)
15:14 jnthn (I think POST can do a little to support too.)
15:14 jnthn Yeah. It's the only trick bit
15:14 jnthn *tricky
15:14 masak hm, I might do .STORE before digging in, though.
15:14 jnthn STORE?
15:14 jnthn *confused look*
15:14 masak as in groceries.
15:14 jnthn oh!
15:14 masak :P
15:14 jnthn Groceries are overrated.
15:14 jnthn :)
15:15 masak troo
15:15 jnthn ...I could do with some too though :)
15:15 masak there's beer in the fridge... :P
15:15 jnthn \o/
15:15 masak ...but I think I should buy something non-liquid too.
15:20 * masak ↝ @groceries
15:22 vlixes joined #perl6
15:25 geekosaur joined #perl6
15:33 gfldex r: https://gist.github.com/2519842
15:33 p6eval rakudo 2a962e: OUTPUT«(signal SEGV)App::exit called␤»
15:33 gfldex that's bad, right?
15:34 gfldex line 48 -> |$args # | is the offender
15:38 eviltwin_b joined #perl6
15:38 gfldex changing -> |$args to -> $args? does segfault too
15:43 gfldex and S06 states that -> |$args should work
15:48 arnsholt jnthn: BTW, are argument types checked by Rakudo somewhere, or should Zavolaj do it itself?
15:48 Psyche^ joined #perl6
15:49 TimToady if you're calling C, it should just coredump :P
15:49 arnsholt Dumping core makes everything better ^_^
15:50 jnthn arnsholt: The current arrangement winds up with them getting shuffled straight off to the mapper.
15:50 moritz arnsholt: I think checking the number of arguments shouldn't be too hard, and a good step to prevent the most commen segfaults
15:50 jnthn arnsholt: My plan is that Zavolaj will just do $cap ~~ $sig at some point.
15:50 jnthn Apart from I didn't implement Signature.ACCEPTS(Capture) again yet.
15:50 * jnthn should really get around to that.
15:51 jnthn Blocks on knowing a good way to do it :)
15:52 arnsholt Right. But that certainly sounds like a good approach =)
15:52 moritz fwiw the logic is there already, somewhere
15:52 jnthn moritz: Is it? :)
15:52 TimToady I dunno, it seems like the sig should be involved in marshalling the args
15:53 jnthn moritz: If you mean "do what ng did" then NO NO NO NO
15:53 jnthn TimToady: It's introspected and used to feed the marshaller.
15:53 moritz the MAIN helper checks if any MAIN can be called with a given capture
15:53 spaceships joined #perl6
15:53 TimToady introspection == design smell
15:53 jnthn TimToady: This is EXACTLY THE RIGHT USE FOR IT.
15:54 jnthn It basically does a .params.map to map them towards the thing the NQP NativeCall stuff in C land wants as in put.
15:54 jnthn *input
15:54 TimToady so why can't the marshaller check it then
15:54 jnthn It could, it's just duplicate work.
15:54 TimToady so's calling ACCEPT
15:55 jnthn As in, we shouldn't implement signature binding in the marshaller, it just call .ACCEPTS to do it.
15:55 TimToady maybe we're in violent agreement here
15:55 jnthn No, the design of what's there now assumes that "I have a Capture in the right shape"
15:55 jnthn What we're missing is asking the signature "do you accept this capture"
15:56 * jnthn did design these pieces to fit together :)
15:56 * TimToady tries to figure out some other way to torment jnthn++
15:57 jnthn TimToady: While we're on this though...guess I can ask something useful: would you expect a Signature to always be mapped back to a scope that it's a signature for?
15:57 jnthn At the moment, I have a Code Object -> Signature reference.
15:57 jnthn Should there be something back the other way?
15:57 TimToady depends on the declarator, I'd think
15:58 jnthn If yes, then the main implication is that a signature literal in code also implies generating a hidden-away Code object.
15:58 TimToady a bare :() doesn't map to anywhere
15:58 TimToady a my () does
15:58 jnthn If it does that, then we have a lexpad in the right shape to feed the signature binder to.
15:58 jnthn s/ to.//
15:59 * jnthn gets back to QAST, and will ponder that lot later...
16:01 lichtkind joined #perl6
16:06 leprevost joined #perl6
16:07 gfldex r: https://gist.github.com/2519842
16:07 p6eval rakudo 2a962e: OUTPUT«(signal SEGV)»
16:07 gfldex masak: could you add https://gist.github.com/2519842 to RT112666 please?
16:08 masak gfldex: will do.
16:08 masak "While eating food and having a good time is useful and commendable, it also shows something about what the current focus of the team is oO" -- http://www.reddit.com/r/perl/comments/sm7cf/and_in_other_perl_6_news_what_if_perl_6_was_a_cup/
16:08 masak this is probably the strangest criticism of the Perl 6 effort I've ever seen.
16:09 masak I can only presume it comes from someone who doesn't eat food and have a good time.
16:10 gfldex you may want to tell that gerdr person how much money you take the a man hour
16:11 masak the things I want to tell that gerdr person makes other parts of my brain override my reddit commenting privs ;)
16:12 jnthn masak: If I didn't ever eat food and have a good time, I guess I'd have some strange views on stuff too :)
16:12 masak but yeah, I can see the meta-message clearly: it's taking a long time. people are fidgety, especially outsiders who are looking in and seeing a partial view.
16:13 arnsholt I'm not sure I've made Zavolaj quite ready to talk to Mongrel2 yet, but oh well =)
16:13 masak in my humble opinion, a hackathon is *such* a morale-booster, that the net productivity easily offsets both time taken off for coding dojo and for eating Vietnamese and generally having a good time.
16:14 jnthn Not to mention that a bunch of useful discussions happened over food anyway.
16:14 masak perhaps if people were emotionless code-spewing robots, I might agree more.
16:15 arnsholt Having talked to people in meat-space is invaluable IMO
16:15 jnthn arnsholt: Very much so.
16:15 jnthn The bandwidth is vastly superior to what you get here.
16:16 TimToady people always falling into either/or thinking, except when they don't
16:16 TimToady *fall
16:16 allbery_b joined #perl6
16:17 TimToady Either people fall into either/or thinking, or they don't...
16:17 arnsholt Would replacing recursive descent parsing be such a huge memory win though, as chromatic seems to suggest?
16:19 jnthn I find recursive descent a misleading characterization.
16:19 flussence .oO( chromatic made a constructive suggestion? I thought he was just sandbagging the conversation to try and make people agree with him again. )
16:20 jnthn Recursive descent in the traditional sense doesn't do any of the declarative prefix / LTM stuff.
16:20 arnsholt There's that as well
16:21 TimToady I think the real underlying point is that you can parse a single language faster than many languages, but this is taking the lesson backwards.
16:21 TimToady lalr and such is a useful optimization for a given langauge
16:21 TimToady but our problem is that we're recalculating the set of languages over and over
16:22 TimToady as a degenerate case, if you know the language hasn't changed, and the program hasn't changed, you can compile instantly
16:22 arnsholt True, true. Also the horrid horrid error reporting characteristics of LALR, if you ask me
16:22 TimToady partial recompilation is another way to slice it
16:23 TimToady yes, error reporting was a big reason, but that doesn't prevent it from being a useful optimization
16:23 TimToady you just regress to recursive descent if the bottom up fails
16:24 arnsholt Oh, that's a nifty idea
16:24 arnsholt But I'm not sure I'd want to implement it =)
16:25 TimToady STD used to cache a set of common languages from run to run, but we dropped that somewhere along the way
16:28 geekosaur joined #perl6
16:31 eviltwin_b joined #perl6
16:34 huf joined #perl6
16:49 uvtc joined #perl6
16:50 allbery_b joined #perl6
16:51 uvtc Was happy to discover a link to Damian's "Perl 6 Update" talk. Added a link to it at <http://wiki.perl6.org/Categorized%20External%20Videos>. Can anyone point me to any other "must-watch" Perl 6 videos/recorded-talks that we could link to?
16:54 moritz uvtc: if you can find any recording of jnthn++'s talk on Signatures, that would be really worth it
16:55 moritz http://www.youtube.com/watch?v=dOsfmeWlw-U and http://www.jnthn.net/articles.shtml
16:56 uvtc moritz, I'd look for that at <http://www.jnthn.net/articles.shtml>, but the white-on-black colorscheme is burning my retinas.
16:56 uvtc :)
16:57 moritz uvtc: then turn down the brightness of your screen :-)
16:57 * masak .oO( we give the people awesome presentations. the people complain about the color scheme. )
16:58 uvtc Get off my lawn!
16:58 uvtc :)
16:58 masak what, you had horrible color schemes long before we did? :P
16:58 * jnthn reads console output and IRC with white on black all day...
16:59 masak white on black is the new black.
16:59 uvtc masak, Oooh, that hurts. :) I happen to like low-contrast...
16:59 masak uvtc: I've never understood a preference for low-contrast. ever since I realized that high contrast improves readability, I've preferred high contrast.
17:00 masak but it's a "de gustibus" thing, I know.
17:00 * jnthn has an eyesight condition that makes high-contrast desirable, which no doubt influences things he makes
17:00 * masak prefers black on #ffd
17:00 masak takes the edge off the white.
17:01 jnthn I tend to do something like that for presentations.
17:02 uvtc I've been using this #222 on #f8f8f8 for example: http://www.unexpected-vortices.com/doc-notes/common-unicode-characters.html and it feels just right. But everyone's {monitor,eyes,ambient lighting} is different.
17:04 preflex joined #perl6
17:05 masak I suspect even #222 would be too un-black for my tastes.
17:06 masak it's just at the limit, I think. #111 is fine, #333 is already too bright.
17:11 sporous joined #perl6
17:12 preflex_ joined #perl6
17:13 mucker joined #perl6
17:16 flussence all this talk of hex triplets just led to me finding a completely impractical feature in the webkit DOM inspector: you can press (↑|↓) to change numbers by 1 and shift+(↑|↓) to change them by :$base(10), which lets you play with the green/blue on colours in realtime. There doesn't seem to be a way to do :$base(100) though :(
17:20 masak heh, people keep expecting :$var(100) to mean "the digits '100' interpreted in base $base"... :)
17:21 au flussence: shift-fn- (↑|↓)  wfm here
17:21 phenny au: 18 Apr 14:53Z <[Coke]> tell au if you do add something for bless or anythign else, be sure to do a spectest first; I found some (to me) surprising) breakage, especially missing multi variants.
17:21 phenny au: 20 Apr 22:52Z <[Coke]> tell au I tried to add a ".Str" that could be invoked as a method on .Str, but my naive patch (now reverted) caused a conflict with the bare {{ Str }}; the table in Prim.hs doesn't seem to be able to handle aliases, so I can't say Str is the same as ~; so I tried to find where I could add a method to Any; couldn't see anything obvious (to a non haskell me) , but found Prelude.pm - figured that would be great, I can write it in
17:21 phenny au: 20 Apr 22:57Z <[Coke]> tell au at some point I realized if I did it for Str, I was just going to have to do it for all of the Cool types, so, lacking Cool, figured I'd just try to add it to Any.
17:22 au flussence++ # neat discovery
17:23 moritz masak: I think that was metasyntactic :-)
17:27 masak note to self: say that next time I write something that doesn't parse. :P
17:28 uvtc moritz, thanks for that link to jnthn's talk, btw. link added.
17:28 masak au! \o/
17:33 jnthn There was a video of a talk I did some time in Oslo too
17:33 jnthn At NUUG
17:33 jnthn Which I think was vaguely interesting.
17:34 flussence ooh, page up/down. figures I'd miss something obvious :) au++
17:34 au \o/
17:36 masak that has a certain strange consistency to it.
17:36 gfldex r: sub foo(Int $i, Str $s){}; sub bar(Int $i, Str $s){}; say &foo.signature ~~ &bar.signature;
17:36 p6eval rakudo 2a962e: OUTPUT«False␤»
17:37 gfldex NYI?
17:37 moritz correct
17:37 moritz it falls back to Any ~~ Any
17:37 moritz which in turn falls back to ===
17:37 * gfldex cant wait for Christmas
17:38 moritz me neither. Which is why I've stopped waiting :-)
17:38 birdwindupbird joined #perl6
17:38 moritz life is much more pleasant when you live in the present
17:39 arnsholt moritz: Where were we with sqlite again?
17:39 moritz arnsholt: Malformed UTF-8 string
17:39 flussence p6: sub foo(Int $i, Str $s){}; sub bar(Int $i, Str $s){}; say &foo.signature.perl ~~ &bar.signature.perl;
17:39 p6eval pugs: OUTPUT«1␤»
17:39 p6eval ..niecza v16-23-gaa61ed5: OUTPUT«Potential difficulties:�  $i is declared but not used at /tmp/dXBSdfR6U2 line 1:�------> [32msub foo(Int [33m�[31m$i, Str $s){}; sub bar(Int $i, Str $s){}[0m�  $s is declared but not used at /tmp/dXBSdfR6U2 line 1:�------> [32msub foo(Int $i, Str [33…
17:39 p6eval ..rakudo 2a962e: OUTPUT«True␤»
17:39 moritz arnsholt: but often works with valgrind
17:39 moritz arnsholt: valgrind reports invalid reads
17:39 flussence n: sub foo(Int $, Str $){}; sub bar(Int $, Str $){}; say &foo.signature.perl ~~ &bar.signature.perl;
17:39 p6eval niecza v16-23-gaa61ed5: OUTPUT«True␤»
17:40 flussence there you go, workaround :)
17:40 arnsholt Hmm. Right
17:43 * arnsholt valgrinds the test file
17:45 dalek nqp/toqast: 7da93fd | jnthn++ | src/QAST/Compiler.nqp:
17:45 dalek nqp/toqast: Correct misleading name.
17:45 dalek nqp/toqast: review: https://github.com/perl6/nqp/commit/7da93fd347
17:45 dalek nqp/toqast: 6980843 | jnthn++ | src/QAST/Operations.nqp:
17:45 dalek nqp/toqast: Implement operations if and unless; give them what should hopefully be decent native handling also. Can be optimized further for void context.
17:45 dalek nqp/toqast: review: https://github.com/perl6/nqp/commit/6980843692
17:45 dalek nqp/toqast: 115c75c | jnthn++ | t/qast/qast.t:
17:45 dalek nqp/toqast: Tests for if/unless on IVal.
17:45 dalek nqp/toqast: review: https://github.com/perl6/nqp/commit/115c75c555
17:53 arnsholt moritz: Something's fishy with CArray and CPointer, I think
17:54 moritz arnsholt: yes, probably
17:55 moritz arnsholt: btw do we support stuff like a pointer do a double?
17:55 arnsholt I get two reads of the same pointer, just off the end of a block of 16 bytes
17:55 arnsholt Hmm. I wonder how large a CPointer body is
17:56 * arnsholt goes to look
17:57 arnsholt Hmm. SixModelObjectCommonalities is 16 bytes
17:57 arnsholt Oh! Maybe I've got a non-concrete CPointer object in child_objs
17:58 moritz arnsholt: and if you look for some inspiration, that's what we need to model for mysql using prepared statements and bind params: https://gist.github.com/2520846
17:59 moritz I wonder if it might be easier to write C functions that fill (and possibly read) them
17:59 arnsholt Hmm. Sized ints, unsigned might not be too hard
18:00 arnsholt Callbacks are a bit off though I think
18:00 moritz I think we can use NULL Pointers there for now
18:00 arnsholt jnthn: What kind of object is passed around in the C code for a non-concrete object?
18:01 arnsholt (If that makes any kind of sense to you)
18:01 arnsholt If it didn't: What kind of structure is the C-side representation of a non-concrete object?
18:02 moritz you mean, a type object?
18:03 arnsholt Yeah
18:05 arnsholt Cuz if it's just the SixModelObjectCommonalities, that explains a lot =)
18:05 jnthn type objects map to NULL
18:05 jnthn Oh, wait, you mean...
18:05 jnthn What does a type object actually have?
18:05 jnthn In that case, yes, just the stuff in SixModelObjectCommonalities.
18:05 jnthn Which means, an st and and sc.
18:07 arnsholt Right. Now I know what to fix
18:07 jnthn OK :)
18:07 arnsholt Can't do it right now, but I'll get to it relatively soon
18:07 arnsholt Yay =)
18:08 jnthn class A { has $.x }
18:08 jnthn ^ the type object is allocated here
18:08 jnthn So there's no way it could be allocated with storage space too :)
18:09 uvtc I've always installed R* in the past into my ~/opt dir (into its own directory, in fact), because I didn't want to have lots of files spread out into the /usr/local subdirs. In fact, I just added a wiki article about it: http://wiki.perl6.org/Local%20and%20Isolated%20Install%20of%20Rakudo%20Star . But when I look now in the R* readme, there's no mention of /usr/local ... (instead, it now uses an install/ subdir?)
18:10 moritz uvtc: it uses install/ by default, but you can change that with perl Configure.pl --prefix=/usr/local/ or so
18:10 sorear goood * #perl6
18:10 moritz \o sorear
18:11 uvtc moritz, Oh, that's a really nice default.
18:11 moritz sorear: I just notice that I never welcomed you in #perl6. So, welcome :-)
18:12 arnsholt jnthn: Certainly an excellent point ^_^
18:12 uvtc moritz, that totally removes the motivation for wanting to install R* into its own separate dir. I'll delete that wiki article. Nice. Thanks.
18:14 sorear :p
18:22 dalek modules.perl6.org: 6f3320d | moritz++ | web/build-project-list.pl:
18:22 dalek modules.perl6.org: update Mojo::UserAgent usage, uvtc++
18:22 dalek modules.perl6.org: review: https://github.com/perl6/modules.perl6.org/commit/6f3320d12f
18:23 moritz uvtc: fwiw I chose a bit different approach here, which happens to be the one that the documentation uses :-)
18:23 sorear I would like to point out that #112634 would be trivial if we used LR(k) grammars like the rest of the world does
18:32 uvtc moritz, The issue that previously came up with regard to an automated way to generate html from module's Pod, was that it's a potential security problem. That is, if you have feather git clone modules and run `perl6 --doc=html ...` on them, arbitrary code in various phasers could be a problem. Would this problem be solved if the perl6 process to generate html were run in a ... not sure of the correct terminology here... chroot jail?
18:34 uvtc Is it difficult (or has anyone) set up Rakudo to run in a sandbox like that?
18:35 flussence I think feather3 serves that purpose atm - it runs try.rakudo.org occasionally
18:35 flussence that about as "arbitrary remote code execution" as you can get...
18:36 uvtc tadzik, ^^
18:37 uvtc I wrote a similar sort of script (in another language, for another language), but all it does is: grab code from github, generate the docs, copy them to a web dir, and update the main index pointing to what docs are in the web dir.
18:44 uvtc phenny, tell tadzik http://irclog.perlgeek.de/perl6/2012-04-28#i_5511648
18:44 phenny uvtc: I'll pass that on when tadzik is around.
18:44 uvtc phenny, tell moritz http://irclog.perlgeek.de/perl6/2012-04-28#i_5511648
18:44 phenny uvtc: I'll pass that on when moritz is around.
18:44 uvtc left #perl6
18:49 kaare__ joined #perl6
18:51 NamelessTee joined #perl6
19:01 gfldex r: class A { our method b (Int $i) {} }; &A::b.wrap(sub (*@args){ say @args.elems } ); A::b(1); my $a = A.new; $a.b(1);
19:01 p6eval rakudo 2a962e: OUTPUT«1␤2␤»
19:01 gfldex why is there a difference?
19:01 gfldex nvm
19:02 moritz the invocant :-)
19:02 phenny moritz: 18:44Z <uvtc> tell moritz http://irclog.perlgeek.de/perl6/2012-04-28#i_5511648
19:03 geekosaur joined #perl6
19:04 masak r: class A { our method b (Int $i) {} }; &A::b.wrap(sub (*@args){ say @args.elems; callsame } ); A::b(1)
19:04 p6eval rakudo 2a962e: OUTPUT«1␤Nominal type check failed for parameter ''; expected A but got Int instead␤  in method b at /tmp/HxslAuHhLO:1␤  in any call_with_capture at src/gen/Metamodel.pm:2614␤  in block <anon> at src/gen/CORE.setting:407␤  in sub <anon> at /tmp/HxslAuHhLO:1␤  in any enter…
19:29 cognominal joined #perl6
19:30 alvis joined #perl6
19:40 masak hey, can the well-known formula in http://en.wikipedia.org/wiki/Fibonacci_number#Closed-form_expression be done with just integers?
19:40 masak I mean, complex numbers are just numbers on the form a + b sqrt(-1), right?
19:41 masak could one create a custom class representing numbers on the form a + b sqrt(5), and define addition, multiplication, and division such that one never has to use floating-point numbers to calculate fibonacci numbers?
19:42 preflex_ joined #perl6
19:42 * moritz knows an integer-only representation that can calculate fibonacci numbers :-)
19:42 colomon you can certainly create a class representing numbers of the form a + b * sqrt(5)
19:42 eviltwin_b joined #perl6
19:43 moritz masak: the problem is just that raising a number to the power needs seem kind of iteration
19:43 masak that's fine.
19:43 moritz masak: so calculating that power boils down to the well-known iteration formula, if you are lucky. And to something more complex in the worse case
19:43 masak nod.
19:44 masak it's a mental exercise, not an optimal solution.
19:44 * colomon is very fuzzy on how a + b * sqrt(5) is useful in this context, though....
19:44 masak colomon: all terms in that formula are on that form.
19:45 moritz modulo the /2 at the end :-)
19:45 masak no, that's also on that form :)
19:45 masak oh wait.
19:45 masak yeah, I see what you mean.
19:45 masak so maybe the integers should represent halves... :)
19:46 masak (this is inspired by https://github.com/raganwald/homoiconic/blob/master/2008-12-12/fibonacci.md , by the way)
19:46 colomon it doesn't really help, does it?
19:47 colomon (I mean, adding halves)
19:47 moritz right, you need to store numbers of the form (a + sqrt(5) * b ) / 2**c
19:48 masak oh, indeed.
19:48 masak so its representation is a triple...
19:48 colomon but it's not closed or anything like that, is it?
19:49 masak yes, and that's my point.
19:49 masak (but I missed the /2)
19:49 colomon I mean, multiplying two Fib numbers doesn't necessary give you another Fib
19:49 masak no, but this field is bigger than just the fibs.
19:49 moritz but adding two gives you one :-)
19:49 moritz erm, not always
19:49 moritz never mind :-)
19:49 masak :P
19:50 masak (a + bq)(c + dq) = ac + adq + bcq + 5bd = (ac + 5bd) + (ad + bc)q, and the latter is also part of the set.
19:50 aindilis joined #perl6
19:50 xinming joined #perl6
19:51 masak so these Q numbers are closed under multiplication.
19:51 masak the above again ignores the /2**c, but you can add it in and it'd still be closed, since it's just a power of 1/2.
19:51 colomon sure, a + b sqrt 5 (with a, b integers) is a perfectly reasonable set of numbers.  (Is it a field?)
19:51 masak I wouldn't be surprised.
19:52 sorear yes, it is a field
19:52 masak yes.
19:52 colomon sorear!  \o/
19:52 masak sorear! \o/
19:52 sorear sqrt(5) is an algebraic number of degree 2
19:52 allbery_b joined #perl6
19:52 sorear if X is an algebraic number of degree N, you can get a field from the basis X^i for i \in [0,N)
19:53 masak "degree 2" because you can get a rational root with a degree-2 polynomial?
19:53 sorear yes
19:54 * masak can barely keep up with sorear if he's allowed to peek at Wikipedia ;)
19:54 masak s/barely/just barely/
19:54 sorear wikipedia's Galois theory materials suck
19:54 sorear I'd loan you my book if you were local
19:54 sorear it's suprisingly thin
19:54 masak I've always wanted to grok Galois theory.
19:54 * colomon is delighted that in this case he can follow sorear without externals aids.  :)
19:55 masak yeah, I follow too now. it looks like a pretty result.
19:56 masak look at that, that's beaooootiful: http://en.wikipedia.org/wiki/File:Algebraicszoom.png
19:56 sorear however, there is an IMO much nicer way to get fibonacci numbers, without fussing with Galois theory or square roots of 5
19:56 sorear first, consider pairs of numbers
19:56 moritz sorear: the matrixy stuff?
19:56 sorear yes, matrixes
19:57 masak right. that URL I posted did that.
19:57 sorear there's a nice optimization of the matrix approach - the calculation never leaves a 2-dimensional subalgebra spanned by the initial matrix and I
19:57 masak ooh
19:58 sorear so you only need to track two coefficients, not 4
19:58 masak right.
19:58 sorear I beleive this is closely related to the HAKMEM algorithm
19:59 sorear which also uses a 2-dimensional algebra, but with less details
20:00 masak HAKMEM++
20:01 moritz masak: https://gist.github.com/2521684
20:01 moritz masak: it cheats at the end
20:02 geekosaur joined #perl6
20:04 colomon class AN does Real  ....  ;)
20:04 moritz colomon: NOOO :-)
20:04 colomon moritz: you know you want to do it....
20:04 colomon .... before I can.  ;)
20:05 moritz the point is to never go through .Real or .Numeric or .Num
20:06 moritz https://gist.github.com/2521684 udpated
20:06 moritz now without the cheaty parts
20:06 ggoebel__ joined #perl6
20:06 colomon errr, confusion between a and b?
20:07 moritz where?
20:07 colomon Intize seems to assume b is the integer part, but your defining comment assumes it is a
20:07 moritz colomon: Intize is not Int
20:08 moritz colomon: it tries to extract an exact integer by dividing by sqrt(5)
20:08 masak moritz++
20:08 colomon oh.  okay, then, LTA method naming is my complaint.  ;)
20:08 moritz because fib(n) = (phi**n - psi**n) / sqrt(5)
20:08 moritz colomon: better method names welcome :-)
20:09 masak I think .Int would've been fine in the end, since it's custom for the class ;)
20:09 masak what does AN stand for?
20:09 moritz but it's not the int representation of that number
20:10 colomon AFK
20:10 moritz my previous method name was Int-by-div-sqrt5
20:11 sorear What if, instead of the ring Q[sqrt(5)], you used Q[phi]?
20:11 masak ok, I see.
20:13 tadzik 'evening
20:13 phenny tadzik: 18:44Z <uvtc> tell tadzik http://irclog.perlgeek.de/perl6/2012-04-28#i_5511648
20:13 masak tadzik! \o/
20:13 tadzik \o/
20:14 tadzik did I miss anything cool?
20:14 moritz r: https://gist.github.com/2521684
20:14 p6eval rakudo 2a962e: OUTPUT«21␤»
20:14 moritz tadzik: just a complicated way to calculate fibonacci numbers :-)
20:15 tadzik eek
20:15 tadzik well, 46 lines > 10 characters :)
20:15 * moritz blames masak
20:15 masak hee hee
20:15 tadzik :)
20:17 moritz masak: oh, and for calculating fibonacci numbers you can actually leave out c
20:17 masak oh! yes.
20:17 moritz in this calculation, b == 0 mod 2 ** (c -1)  always holds
20:18 masak nod.
20:18 masak hm, phi**2 = (1 + q)**2/4 = (1 + 2q + 5)/4 = (6 + 2q)/4 = (2 + 2q)/4 + 4/4 = phi/2 + 1
20:19 masak so (a + b phi)(c + d phi) = (ac + bd) + (bc + ad + bd/2)
20:19 masak interesting algebra :)
20:19 masak er, last paren times phi, 'course.
20:20 masak (a + b phi)(c + d phi) = (ac + bd) + (bc + ad + bd/2) phi
20:23 colomon tadzik: you need to regenerate the Emmentaler page -- I keep on fixing modules.  ;)
20:23 tadzik hehe, right
20:24 tadzik you can run it too :)
20:24 moritz how long does a run take?
20:24 tadzik <20 mins on my laptop
20:26 colomon tadzik: you shouldn't be tempting me to make it a local cron process.
20:27 tadzik I don't need to. You already want it :)
20:27 jnthn Where was the Emmentaler page again?
20:27 jnthn Is it somewhere pernament enough we can link to it from modules.perl6.org?
20:28 moritz or I can make cheese.perl6.org redirect to it
20:28 jnthn \o/
20:28 tadzik it's currently http://tjs.azalayah.net/new.html, but it's just a place where I scp an html file
20:29 tadzik I should move it to its repo
20:29 tadzik I should have a handful of tuits tomorrow
20:32 lichtkind_ joined #perl6
20:33 lichtkind_ what actually is the Iterator object type, in description stand just "Perl list"?
20:33 dalek nqp/toqast: c0b439f | jnthn++ | src/QAST/Compiler.nqp:
20:33 dalek nqp/toqast: Sketch in a BlockInfo to track per-block compilation state; tracker outer chain.
20:33 dalek nqp/toqast: review: https://github.com/perl6/nqp/commit/c0b439f349
20:33 dalek nqp/toqast: 16319cd | jnthn++ | src/QAST/Compiler.nqp:
20:33 dalek nqp/toqast: Start sketching out QAST::Var; not enough to do anything useful yet.
20:33 dalek nqp/toqast: review: https://github.com/perl6/nqp/commit/16319cd74e
20:35 masak sorear: phi is a degree-2 algebraic number too, right?
20:37 masak sorear: that bd/2 term causes me trouble. set b=d=1, and it comes out 1/2, which means I can't just use integers and get closure under multiplication.
20:40 dalek DBIish/mysql-prepared: 29717ac | moritz++ | CREDITS:
20:40 dalek DBIish/mysql-prepared: typo
20:40 dalek DBIish/mysql-prepared: review: https://github.com/perl6/DBIish/commit/29717acb7d
20:40 dalek DBIish/mysql-prepared: 385fb81 | moritz++ | lib/DBDish/mysql.pm6:
20:40 dalek DBIish/mysql-prepared: [mysql] some preparations for prepared statements
20:40 dalek DBIish/mysql-prepared: review: https://github.com/perl6/DBIish/commit/385fb81cb1
20:40 dalek DBIish/mysql-prepared: 1cba5bf | moritz++ | lib/DBDish/TestMock.pm6:
20:41 dalek DBIish/mysql-prepared: add missing TestMock.pm6 file, torehaug++
20:41 dalek DBIish/mysql-prepared: review: https://github.com/perl6/DBIish/commit/1cba5bfaeb
20:41 uvtc joined #perl6
20:41 uvtc tadzik, hi
20:41 geekosaur joined #perl6
20:43 tadzik hi uvtc
20:43 uvtc Earlier I was asking about running `perl6 --doc=html ...` in a sandbox to generate docs for modules.perl6.org. I've been learning Clojure, and wrote a little script to do something for clojure libs (but in Python). It's at <https://github.com/uvtc/petit-lorange>.
20:43 tadzik yeah, seen that
20:43 tadzik sandboxing is probably the way to go, yes
20:43 dalek DBIish/mysql-prepared: a138cc5 | (Tore Haugland)++ | t/10-mysql.t:
20:43 dalek DBIish/mysql-prepared: Fixed missing $database parameter to connect calls for two tests. Changed values of raiseerror from int to bool
20:43 dalek DBIish/mysql-prepared: review: https://github.com/perl6/DBIish/commit/a138cc57c4
20:43 masak who's Tore Haugland?
20:44 tadzik after integrating Emmentaler with modules.perl6.org somehow the next plan is to add some documentation to it as well
20:44 masak yay
20:44 uvtc regardin Emmentaler, I think the table would look nicer (it would be wider) if the camelia logo had a <br/> after it.
20:45 uvtc s/regardin/regarding/
20:45 uvtc tadzik, what does "Emmentaler" mean?
20:45 tadzik uvtc: it's a kind of cheese
20:45 tadzik also, ask masak, it's his idea :)
20:45 uvtc mmmm.... cheeese....
20:46 tadzik uvtc: re layout, I'm no HTML wizard, I first stole the HTML from perl6.org, then from perl6.org/compilers/features
20:46 dalek DBIish: 29717ac | moritz++ | CREDITS:
20:46 dalek DBIish: typo
20:46 dalek DBIish: review: https://github.com/perl6/DBIish/commit/29717acb7d
20:46 dalek DBIish: 385fb81 | moritz++ | lib/DBDish/mysql.pm6:
20:46 dalek DBIish: [mysql] some preparations for prepared statements
20:46 dalek DBIish: review: https://github.com/perl6/DBIish/commit/385fb81cb1
20:46 dalek DBIish: 1cba5bf | moritz++ | lib/DBDish/TestMock.pm6:
20:46 dalek DBIish: add missing TestMock.pm6 file, torehaug++
20:46 dalek DBIish: review: https://github.com/perl6/DBIish/commit/1cba5bfaeb
20:46 dalek DBIish: a138cc5 | (Tore Haugland)++ | t/10-mysql.t:
20:46 dalek DBIish: Fixed missing $database parameter to connect calls for two tests. Changed values of raiseerror from int to bool
20:46 dalek DBIish: review: https://github.com/perl6/DBIish/commit/a138cc57c4
20:46 uvtc I only mention that little petit-lorange script because I think something like that would work for modules.perl6.org.
20:47 uvtc tadzik, I'm no html wizard either. (In fact, I'm actually the one who added the logo to the features page :) )
20:47 uvtc Ooops. Gotta go. Glad to hear about docs for modules.perl6.org being on the todo list. Bye. o/
20:47 uvtc left #perl6
20:48 sorear masak: yes, phi^2 - phi - 1 = 0
20:49 masak right.
20:50 masak phenny: tell uvtc that in my second talk ever, http://masak.org/carl/npw2009-november/talk.pdf -- I used a metaphor with Rakudo being a cheese with holes that we find by running the spectests, or by writing applications. this led to "Rakudo cheese" and "app cheese" being synonymous with testing Rakudo and the app space, respectively. hence, Emmentaler.
20:50 phenny masak: I'll pass that on when uvtc is around.
20:51 masak that talk is probably still my most appreciated talk, ever. I don't know how that happened.
20:52 masak I think it's because the audience was sitting really close, and it became cozy-like.
20:54 * jnthn remembers that workshop :)
20:54 jnthn It was on the top story of a fairly tall building.
20:54 jnthn So there was a nice view.
20:56 jferrero joined #perl6
20:59 eviltwin_b joined #perl6
21:03 masak there was indeed.
21:04 masak I met a wild-eyed guy with messy hair at that workshop. I asked him "who did you say you were, again?" he said "I'm mst!"
21:04 jnthn :)
21:05 jnthn And then there was the rooftop beer party...
21:06 masak hm, I musta been not drinking beer back then.
21:06 masak but I remember Gloria. :)
21:06 masak she had TimToady whistle. :)
21:06 lichtkind_ mst rocks
21:06 lichtkind_ i like him
21:07 masak deep inside mst, there's a very nice person... because mst ate that person. :P
21:08 masak no, he's a hoopy frood, srsly. I just don't think he'll ever be a Perl 6er.
21:08 masak I'm willing to be proven wrong, though.
21:10 jnthn masak: No, you didn't start on beer until you came to work at the same $dayjob place as me :P
21:11 dalek nqp/toqast: 7179ed3 | masak++ | src/QAST/Operations.nqp:
21:11 dalek nqp/toqast: added the neg_i operation
21:11 dalek nqp/toqast:
21:11 dalek nqp/toqast: All tests in t/qast/qast.t now pass.
21:11 dalek nqp/toqast: review: https://github.com/perl6/nqp/commit/7179ed3545
21:11 jnthn .oO( now the test file ain't qass )
21:11 masak jnthn: right, and this was 2009.
21:17 [Coke] joined #perl6
21:17 dalek tablets: 33a5516 | (Herbert Breunung)++ | docs/appendix- (2 files):
21:17 dalek tablets: add backlinks for grammatical categories and added these of the regex slang into Index A
21:17 dalek tablets: review: https://github.com/perl6/tablets/commit/33a5516de7
21:27 allbery_b joined #perl6
21:29 dalek tablets: b6abc8f | (Herbert Breunung)++ | docs/appendix- (2 files):
21:29 dalek tablets: backlink introspection methods
21:29 dalek tablets: review: https://github.com/perl6/tablets/commit/b6abc8f07f
21:39 gfldex i iz propaganda cat i tellz troof: http://gfldex.wordpress.com/2012/04/28/signals-and-slots-like-the-pros/
21:41 masak gfldex++
21:44 masak gfldex: that last bit of wish-code 'connect(&$input.sig_changed, &$data.set_age);' makes no sense whatsoever.
21:44 masak if I were you, I'd remove it from an otherwise excellent post. :)
21:45 jnthn masak: gfldex++ is hungering for a nice way to do a method dispatch but not actually dispatch, just get what we would dispatch to, I guess.
21:45 masak yep, I get that.
21:45 gfldex i will leave it or i will forget about it
21:45 masak but the syntax he proposes is insane :)
21:45 masak it... I...
21:45 jnthn masak: :)
21:45 jnthn masak: Relax. :)
21:45 gfldex i'm not going to force you to use that syntax
21:45 jnthn masak: We don't actually *have* a good syntax for it at the moment though.
21:46 masak right, I know.
21:46 masak but that's not gonna be it, I can tell you that.
21:46 jnthn The right way involves a .^find_method
21:46 jnthn No, there's a lot of reasons why it can't be the one in the post.
21:47 gfldex connect($sender, 'signal', $receiver, 'slot'); # is ugly
21:48 masak I hear ya.
21:48 diakopter I'll send your slot
21:49 masak gfldex: as an interim, you could define a class which holds an object and a method name.
21:49 masak and then an operator which creates that pair.
21:49 gfldex one thing I found strange (beside the segfault) is that when I do connect($obj, &Obj::wrong_method_name, $obj2, &Obj2::wrong_too);# rakudo complained fairly late
21:50 masak connect($sender :. 'signal', $receiver :. 'slot')
21:51 jnthn masak: Weren't we meant to be making it less ugly? :P
21:51 masak or, hm, you could mix in a role to all classes that overrides postcircumfix:<( )>
21:51 masak connect($sender<signal>, $receiver<slot>)
21:51 masak I don't think it gets much prettier than that ;)
21:51 jnthn omg...
21:52 gfldex connect($sender, signal, $receiver, slot); # is something i would be happy with and what works with Qt thanks to the formidable c preprocessor
21:52 jnthn You can do that with a textual macro I guess.
21:52 gfldex that's how they do it
21:52 masak yeah. I'll have no part in it.
21:52 jnthn masak: Oh come on, you know you want to... :P
21:52 Psyche^ joined #perl6
21:52 masak I'm not insane enough yet to want it.
21:53 masak but I meant, I don't think it's a good solution API-wise in this case.
21:53 masak or most of the time, really.
21:53 gfldex $receiver<slot> would either involve macros too or require changes to the slot
21:53 masak it breaks Least Surprise in a big way.
21:53 gfldex and i actually like it that you don't have to do anything at the slot side
21:53 jnthn Yeah, I like the loose coupling in this.
21:54 masak I didn't follow the bit that says it involves macros or requires changes to the slot. but never mind.
21:55 gfldex you either untangle $receiver and <slot> with a macro or you mixin postcircumfix:< < > > (or however that is spelled) into the slot
21:56 gfldex what would be easy ofc
21:57 dalek tablets: 36e9c52 | (Herbert Breunung)++ | docs/appendix- (2 files):
21:57 dalek tablets: backlink metaops
21:57 dalek tablets: review: https://github.com/perl6/tablets/commit/36e9c52ad7
21:58 masak r: class ObjSlot { has $.obj; has $.slot }; class Obj { method postcircumfix:<( )>($slot) { ObjSlot.new(:obj(self), :$slot) }; my Obj $o .= new; say $o<slot>
21:58 p6eval rakudo 2a962e: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 2␤»
21:58 masak r: class ObjSlot { has $.obj; has $.slot }; class Obj { method postcircumfix:<( )>($slot) { ObjSlot.new(:obj(self), :$slot) } }; my Obj $o .= new; say $o<slot>
21:58 p6eval rakudo 2a962e: OUTPUT«postcircumfix:<{ }> not defined for type Obj␤  in method gist at src/gen/CORE.setting:8667␤  in sub say at src/gen/CORE.setting:6555␤  in block <anon> at /tmp/unmjfs8D3g:1␤␤»
21:58 masak r: class ObjSlot { has $.obj; has $.slot }; class Obj { method postcircumfix:<{ }>($slot) { ObjSlot.new(:obj(self), :$slot) } }; my Obj $o .= new; say $o<slot>
21:58 p6eval rakudo 2a962e: OUTPUT«ObjSlot.new(obj => Obj.new(), slot => "slot")␤»
21:58 masak that's how I meant.
22:07 ponbiki joined #perl6
22:10 ponbiki joined #perl6
22:19 geekosaur joined #perl6
22:27 Psyche^ joined #perl6
22:33 masak 'noight, #perl6
22:36 eviltwin_b joined #perl6
22:43 FACEFOX-DOT-COM joined #perl6
22:51 FACEFOX-DOT-COM joined #perl6
22:52 uvtc joined #perl6
22:54 uvtc What exactly does "hai" mean? translate.google.com tells me it's "shark" in german.
22:54 phenny uvtc: 20:50Z <masak> tell uvtc that in my second talk ever, http://masak.org/carl/npw2009-november/talk.pdf -- I used a metaphor with Rakudo being a cheese with holes that we find by running the spectests, or by writing applications. this led to "Rakudo cheese" and "app cheese" being synonymous with testing Rakudo and the app space, respectively. hence, Emmentaler.
22:55 jnthn uvtc: as in, "oh hai"?
22:55 FACEFOX-DOT-COM joined #perl6
22:55 uvtc Yes. "oh shark!"
22:55 jnthn uvtc: No, it's just a deliberate misspelling of "hi", as in "hello" :)
22:55 uvtc Ah. thanks, jnthn
22:56 uvtc tadzik, please forget what I said about "just adding a <br/> to Emmentaler to get the table to display right". I'm not an html designer, but I sometimes and caught playing one on TV.
22:58 uvtc tadzik, though, it might all work out right if you added a legend, like the feature comparison matrix has.
22:59 geekosaur joined #perl6
23:03 uvtc phenny, please tell masak Thanks for the link to the slides to your November talk.
23:03 uvtc phenny, tell masak Thanks for the link to the slides to your November talk.
23:03 phenny uvtc: I'll pass that on when masak is around.
23:03 uvtc phenny dispenses with the pleasantries.
23:09 eviltwin_b joined #perl6
23:14 * jnthn -> sleep o/
23:15 uvtc phenny, tell tadzik http://irclog.perlgeek.de/perl6/2012-04-28#i_5512561
23:15 phenny uvtc: I'll pass that on when tadzik is around.
23:15 uvtc left #perl6
23:53 allbery_b joined #perl6

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

Perl 6 | Reference Documentation | Rakudo