Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2012-10-12

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:23 MikeFair_ joined #perl6
00:27 diakopter n: 'alive'
00:27 p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)[auto-compiling setting]␤»
00:27 diakopter sorear: niecza rebuild seems stuck
00:40 benabik joined #perl6
00:45 cognominal joined #perl6
00:47 Psyche^ joined #perl6
00:54 kevouze joined #perl6
00:56 anuby joined #perl6
01:02 cognominal joined #perl6
01:07 kevouze_ joined #perl6
01:13 fgomez joined #perl6
01:21 tokuhiro_ joined #perl6
01:25 att joined #perl6
01:30 cognominal joined #perl6
01:48 cognominal joined #perl6
01:51 dalek perl6-bench: c11b540 | (Geoffrey Broadwell)++ | / (2 files):
01:51 dalek perl6-bench: Split bench into timeall and analyze
01:51 dalek perl6-bench: review: https://github.com/japhb/perl6-bench/commit/c11b540ffc
01:51 dalek perl6-bench: 1ee014f | (Geoffrey Broadwell)++ | / (2 files):
01:51 dalek perl6-bench: Update EXPECTED and README to refer to split timeall and analyze scripts; minor additional fixes in each
01:51 dalek perl6-bench: review: https://github.com/japhb/perl6-bench/commit/1ee014f953
01:51 dalek perl6-bench: 3b96734 | (Geoffrey Broadwell)++ | bench:
01:51 dalek perl6-bench: Remove no-longer-needed bench script
01:51 dalek perl6-bench: review: https://github.com/japhb/perl6-bench/commit/3b96734f73
01:51 dalek perl6-bench: 511186f | (Geoffrey Broadwell)++ | .gitignore:
01:51 dalek perl6-bench: Add bench-*.json to .gitignore
01:51 dalek perl6-bench: review: https://github.com/japhb/perl6-bench/commit/511186f4e9
01:52 japhb Well, that at least splits the original monolithic Perl 5 script into two somewhat more focused Perl 5 scripts.  Conversion of `analyze` to Perl 6 may have to wait for another day.  :-)
02:36 orafu joined #perl6
02:37 wamba joined #perl6
02:46 Circlepuller joined #perl6
03:12 xinming_ joined #perl6
04:05 cognominal joined #perl6
04:17 raiph joined #perl6
04:26 telex joined #perl6
04:29 kst joined #perl6
04:30 masak r: my $m = method ($a) { say $a }; class A {}; A.new.$m(42)
04:30 p6eval rakudo 547fcb: OUTPUT«42␤»
04:31 thou joined #perl6
04:32 masak r: my $m = method ($a) { say $a }; class A {}; sub bind($obj, $method) { -> *@args { $obj.$method(|@args) } }; my $bound = bind(A.new, $m); $bound(42)
04:32 p6eval rakudo 547fcb: OUTPUT«42␤»
04:32 masak \o/
04:34 aharoni joined #perl6
04:35 telex joined #perl6
04:45 flightrecorder joined #perl6
04:53 hash_table joined #perl6
05:12 Psyche^ joined #perl6
05:13 Woodi morning today :)
05:13 Woodi masak: how that last example work ? looks like one-line MOP for me...
05:14 Woodi err, def&implementation of MOP...
05:16 Woodi especially: how this: $obj.$method(... can happen ?
05:21 birdwindupbird joined #perl6
05:22 raiph Woodi: i think jnthn just changed rakudo to make the my $m = method bit work. i think $o.$m() has long worked.
05:23 Woodi but some random sub shouldn't be allowed to add method to class...
05:23 Woodi or it's kind of wrapper ?
05:24 Woodi *add meth to obj egzaktly
05:38 raiph Woodi: poked around logs. "recent change" might be my imagination. note: http://irclog.perlgeek.de/perl6/2012-10-08#i_6044469
05:41 raiph ah. and http://irclog.perlgeek.de/perl6/2012-10-11#i_6051934
05:46 raiph Woodi: this is what i was thinking was the relevant commit: https://github.com/rakudo/rakudo/commit/5a92ef1c0e
05:50 Woodi raiph: np. I was probably wrong too, with masak intentions. looks now like find of security breach :)
05:51 GlitchMr joined #perl6
05:55 gootle joined #perl6
06:13 masak raiph: everything I used above has worked for a long time.
06:14 masak Woodi: in no way am I adding a method to a class. you may want to look again.
06:14 cognominal joined #perl6
06:14 raiph masak: thanks.
06:15 masak it would only be a "security breach" (though you probably mean "breach of encapsulation/information hiding") if the anon method could access private state. which it can't. only methods in the class block can do that.
06:15 raiph masak: at first i thought you were adding a method to an object. but it's not even that is it?
06:15 masak correct. it's not.
06:15 masak the name of the sub -- "bind" -- is a clue.
06:16 raiph so exactly what is it? :)
06:16 masak I'm binding an object (to be the invocant) to an anonymous method.
06:16 masak JavaScript has a method .bind on functions which does this. essentially pre-setting 'this' on the invocation.
06:16 sorear raiph: $obj.$method(42) is almost synonymous with $method($obj, 42)
06:17 sorear perl 6 does not have a magical this value, it's just the first argument
06:17 masak what sorear said. in Perl 5 thre is an *equivalence* between method calls and sub calls with an extra first parameter. in Perl 6 they are different but still very similar.
06:18 masak another way to say that is that there aren't "sub lambdas" and "method lambdas". there's only lambdas. methods just happen to have an extra (often hidden) first parameter.
06:19 masak there *is* a way to add methods to objects, using anonymous subclassing.
06:20 masak rn: my $o = 42 but role { method greet { say "OH HAI" } }; say $o; $o.greet()
06:20 sorear n: class A { method foo(:$foo:) {} }; A.foo
06:20 p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)[auto-compiling setting]␤»
06:20 p6eval ..rakudo 547fcb: OUTPUT«42␤OH HAI␤»
06:20 p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)[auto-compiling setting]␤»
06:20 sorear r: class A { method foo(:$foo:) {} }; A.foo
06:20 p6eval rakudo 547fcb: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤  in method foo at /tmp/sDHRdlw4hS:1␤  in block  at /tmp/sDHRdlw4hS:1␤␤»
06:21 masak hm, that signature sholdn't parse, methinks.
06:21 masak nameds must come after positionals, so the colon after ':$foo' can't appear there.
06:22 Woodi hmm, why add $obj as "invocant" for subs/methods with syntax exactly like method on object call ?
06:33 raiph r: my \m = method () { say 1 }; sub bind (\o, \m) { -> { $o.$m }; my $b = bind (1, m); $b();
06:33 p6eval rakudo 547fcb: OUTPUT«===SORRY!===␤Variable $o is not declared␤at /tmp/cRNu4bJ4jc:1␤»
06:37 TimToady r: my $m = method ($self: $a) { say $a }; class A {}; my $bound = $m.assuming(A.new); $bound(42);
06:37 p6eval rakudo 547fcb: OUTPUT«42␤»
06:37 TimToady r: my $m = method ($a) { say $a }; class A {}; my $bound = $m.assuming(A.new:); $bound(42);
06:37 p6eval rakudo 547fcb: OUTPUT«===SORRY!===␤Unable to parse expression in argument list; couldn't find final ')' at line 2, near ":); $bound"␤»
06:37 TimToady n: my $m = method ($a) { say $a }; class A {}; my $bound = $m.assuming(A.new:); $bound(42);
06:37 p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)[auto-compiling setting]␤»
06:37 TimToady heh
06:38 TimToady n: my $m = method ($a) { say $a }; class A {}; my $bound = $m.assuming(A.new:); $bound(42);
06:38 p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)[auto-compiling setting]␤»
06:38 TimToady um...
06:38 TimToady n: say 42
06:39 p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)[auto-compiling setting]␤»
06:39 TimToady this is...suboptimal...
06:40 raiph nr: sub s (\a, \b) { }; s (1, 2);
06:40 p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)[auto-compiling setting]␤»
06:40 p6eval ..rakudo 547fcb: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤  in sub s at /tmp/iPzMmiWHGe:1␤  in block  at /tmp/iPzMmiWHGe:1␤␤»
06:42 raiph r: sub s (\a, \b) { }; s (1, 2); # what am i doing wrong?
06:42 p6eval rakudo 547fcb: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤  in sub s at /tmp/n2XtQv4sC8:1␤  in block  at /tmp/n2XtQv4sC8:1␤␤»
06:45 TimToady sorear: see timeouts above
06:54 kaleem joined #perl6
06:54 Chillance joined #perl6
06:54 sorear yeah I'm aware
07:04 TimToady r: my $m = method ($a) { say $a }; class A {}; my $bound = $m.assuming(A.new); $bound(42);
07:04 p6eval rakudo 547fcb: OUTPUT«42␤»
07:04 TimToady I guess that works too
07:05 TimToady r: my $m = method ($a) { say self.WHAT, ' ', $a }; class A {}; my $bound = $m.assuming(A.new); $bound(42);
07:05 p6eval rakudo 547fcb: OUTPUT«A() 42␤»
07:05 TimToady even works right :)
07:07 TimToady masak: so I think your bind() is a bit of overkill
07:08 TimToady zzz &
07:12 sjohnson bed!
07:12 brrt joined #perl6
07:16 masak TimToady: heh, I had .assuming on my list of alternative ways to do .bind, and then promptly forgot about it ;)
07:18 flightrecorder joined #perl6
07:18 jnthn morning o/
07:18 brrt hi \o
07:19 jnthn raiph: (doing wrong) passing a single parcel argument
07:20 jnthn r: sub s (\a, \b) { }; s(1, 2);
07:20 p6eval rakudo 547fcb:  ( no output )
07:20 FROGGS joined #perl6
07:23 raiph jnthn: ah. simple enough. thanks. and good morning. :)
07:24 masak jnthn! \o/
07:30 wamba joined #perl6
07:32 sorear don't count on a prompt resolution of the p6evalissue.
07:32 raiph jnthn: does the Rakudo source tree contain any lines of pure PIR, or is all PIR code embedded in NQP? How many lines of NQP contain PIR?
07:33 jnthn raiph: iirc, there's two (non-generated) .pir files in NQP, in src/cheats/
07:33 jnthn And I think we've none at all for Rakudo
07:34 moritz nr: say 42
07:34 p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)[auto-compiling setting]␤»
07:34 p6eval ..rakudo 547fcb: OUTPUT«42␤»
07:37 woosley left #perl6
07:37 masak n: say '(timeout)[auto-compiling setting]'
07:37 integral joined #perl6
07:37 integral joined #perl6
07:37 p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)[auto-compiling setting]␤»
07:38 tadzik yeah, it finally compiled the setting and now reacts correctly :)
07:43 masak that's the only reasonable explanation I can see, anyway.
07:45 moritz n: say 1
07:45 p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)[auto-compiling setting]␤»
07:47 masak dang, hypothesis falsified. :P
07:47 tadzik quick, do something before it kills feather again :)
07:52 moritz huh, on feather3, the process 'perl poll' takes 100% CPU
07:56 pippo_ joined #perl6
07:59 daxim joined #perl6
08:01 GlitchMr n: say [*] 1.. 6 #`??
08:01 p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)[auto-compiling setting]␤»
08:02 wamba joined #perl6
08:04 fhelmberger joined #perl6
08:09 cognominal joined #perl6
08:31 dju joined #perl6
08:35 dakkar joined #perl6
08:48 dju joined #perl6
08:48 dju joined #perl6
09:01 masak if a routine defines itself as returning a Str, what does a no-argument 'return' return?
09:02 jnthn r: sub foo() returns Str { return }
09:02 p6eval rakudo 547fcb:  ( no output )
09:03 * hoelzro guesses Str
09:03 jnthn ...apparently, not an exception...
09:03 * jnthn kinda expected that to complain
09:03 jnthn Oh, I wonder if it returns Nil, and Nil is accepted in any context?
09:04 tgt joined #perl6
09:04 jnthn r: sub foo() returns Str { return }; say foo.WHAT
09:04 p6eval rakudo 547fcb: OUTPUT«Type check failed for return value; expected 'Str' but got 'Nil'␤  in sub foo at /tmp/3JL_UDkW2p:1␤  in block  at /tmp/3JL_UDkW2p:1␤␤»
09:04 jnthn Oh!
09:04 jnthn I didn't call it above
09:04 jnthn duh.
09:04 jnthn OK, then it is doing what I expect
09:05 masak ah.
09:05 jnthn I think that's sane
09:05 masak yes, that was one of two possibilities that I expected.
09:06 jnthn If you said you're gonna return a Str and then you don't...
09:06 masak the other one being that 'return' is context-sensitive enough to know that it should return Str.
09:19 moritz that'd sound like a piece of context flowing in the wrong direction
09:20 moritz though maybe necessary for returns of native type
09:20 moritz (or maybe not)
09:21 Tene joined #perl6
09:22 Caldrin joined #perl6
09:24 Caldrin Hi! Is there a new POD for perl6 or do I use the old POD for documenting my modules?
09:24 tadzik there's new Pod, yes
09:25 Caldrin Can you link me to documentation, please?
09:28 Caldrin Ah, I found this: http://zag.ru/perl6-pod/S26.html
09:28 Caldrin tadzik: Thanks for your answer.
09:30 masak Caldrin: welcome! there's indeed a new Pod, but I should warn you that rendering support is not yet up to the standard of the old POD.
09:31 masak oh and by the way, tadzik++ is the guy who implemented almost all of the Pod parsing in Rakudo :)
09:33 Caldrin masak: Well, as far as I see there are other places too, where Perl6 is not yet up to the standard of Perl5. Thats fine for me. I want to be an early adopter of "The Next Big Thing".
09:33 masak then double welcome.
09:33 masak doubly*
09:36 SamuraiJack joined #perl6
09:36 dju joined #perl6
09:37 Caldrin Thank you
09:54 kaleem joined #perl6
10:14 rindolf joined #perl6
10:21 wamba joined #perl6
10:34 zby_home_ joined #perl6
10:38 GlitchMr joined #perl6
10:41 Bucciarati joined #perl6
10:44 Yappocall_ joined #perl6
10:44 rindolf joined #perl6
10:44 kaleem joined #perl6
10:44 Tene joined #perl6
10:44 tgt joined #perl6
10:44 dakkar joined #perl6
10:44 FROGGS joined #perl6
10:44 Patterner joined #perl6
10:44 raiph joined #perl6
10:44 rhr joined #perl6
10:44 sisar joined #perl6
10:44 sivoais joined #perl6
10:44 tadzik joined #perl6
10:44 preflex joined #perl6
10:44 ruz joined #perl6
10:44 rurban joined #perl6
10:44 dalek joined #perl6
10:44 cibs joined #perl6
10:44 _jaldhar joined #perl6
10:44 ServerSage joined #perl6
10:44 jerome joined #perl6
10:44 bbkr_ joined #perl6
10:44 mtk joined #perl6
10:44 bruges joined #perl6
10:44 crazedpsyc joined #perl6
10:44 estrai_ joined #perl6
10:44 rjbs- joined #perl6
10:44 killbot joined #perl6
10:44 odoacre joined #perl6
10:44 simcop2387 joined #perl6
10:44 Woodi joined #perl6
10:44 colomon joined #perl6
10:44 buubot_backup joined #perl6
10:44 mst joined #perl6
10:44 s1n joined #perl6
10:44 wooden joined #perl6
10:44 mhasch joined #perl6
10:44 felipe joined #perl6
10:44 infosophy joined #perl6
10:44 patspam_ joined #perl6
10:44 Vlavv_ joined #perl6
10:44 baest joined #perl6
10:44 japhb joined #perl6
10:44 BooK joined #perl6
10:44 apejens joined #perl6
10:44 smash joined #perl6
10:44 shachaf joined #perl6
10:44 szbalint joined #perl6
10:44 quietfanatic joined #perl6
10:44 sevvie joined #perl6
10:44 mikec_ joined #perl6
10:44 sizz joined #perl6
10:44 lorn joined #perl6
10:44 ashleydev joined #perl6
10:44 fuleo joined #perl6
10:44 aloha joined #perl6
10:44 bbkr joined #perl6
10:44 ChoHag joined #perl6
10:44 ggoebel joined #perl6
10:44 Ulti joined #perl6
10:44 felher joined #perl6
10:44 groky joined #perl6
10:44 c1sung joined #perl6
10:44 kcwu joined #perl6
10:44 lestrrat joined #perl6
10:44 larks joined #perl6
10:44 `patch` joined #perl6
10:44 charsbar_____ joined #perl6
10:44 frettled joined #perl6
10:45 flightrecorder joined #perl6
10:45 d4l3k_ joined #perl6
10:46 flightrecorder joined #perl6
11:01 daniel-s joined #perl6
11:03 dju joined #perl6
11:05 Su-Shee_ joined #perl6
11:07 felipe joined #perl6
11:07 dju joined #perl6
11:07 dju joined #perl6
11:08 * jnthn heads to Stockholm for NPW &
11:10 brrt joined #perl6
11:12 kaleem joined #perl6
11:13 cognominal joined #perl6
11:15 cognominal_ joined #perl6
11:15 SamuraiJack joined #perl6
11:41 cognominal joined #perl6
11:41 PacoAir joined #perl6
11:47 dalek Perlito: b50d8dc | (Flavio S. Glock)++ | / (3 files):
11:47 dalek Perlito: Perlito5 - js - new structure p5ArrayOfAlias
11:47 dalek Perlito: review: https://github.com/fglock/Perlito/commit/b50d8dc700
11:48 cognominal joined #perl6
11:48 cognominal_ joined #perl6
12:09 SamuraiJack_ joined #perl6
12:14 masak jnthn: good luck in Stockholm! say hello from me! :)
12:21 sjohnson joined #perl6
12:27 cognominal_ joined #perl6
12:37 * [Coke] realizes he did not re-check the daily run builds to make sure today's daily run was ok. whoops.
12:37 [Coke] "wait and see", I guess.
12:38 hash_table joined #perl6
12:40 * [Coke] drinks a coffee and hopes for the best.
12:51 rindolf [Coke]: shouldn't you drink coke? ;-)
12:56 mucker joined #perl6
12:57 grondilu joined #perl6
12:58 grondilu What's the equivalent of perl5's "SUPER" pseudo-class?
12:59 masak closest equivalent is nextsame, callwith, et al.
13:00 masak but "SUPER" doesn't make much sense in a MI language.
13:00 masak it's all about method resolution orders instead. hence nextsame and gang.
13:01 grondilu ok
13:05 moritz the question about SUPER is a FAQ now
13:05 moritz somebody[tm] should really add it (and the answer) to the perl6/faq repo
13:05 grondilu nr: class Foo { method talk { say "foo" } }; class Bar is Foo { nextsame; say "bar" }; .talk given my Bar $x .= new;
13:05 p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)[auto-compiling setting]␤»
13:05 p6eval ..rakudo 547fcb: OUTPUT«nextsame is not in the dynamic scope of a dispatcher␤  in block  at src/gen/CORE.setting:485␤  in block  at /tmp/EkcVMqf5Sv:1␤␤»
13:05 Psyche^ joined #perl6
13:07 grondilu callsame and co seem to deal with multi dispatch, not inheritance :/
13:08 moritz so does SUPER
13:08 moritz what else do you need it for, except calling methods from superclasses?
13:08 grondilu r:  class Foo { method talk { say "foo" } }; class Bar is Foo { callwith; say "bar" }; Bar.new.talk;
13:08 p6eval rakudo 547fcb: OUTPUT«callwith is not in the dynamic scope of a dispatcher␤  in block  at src/gen/CORE.setting:463␤  in block  at /tmp/uqHSYuAAcL:1␤␤»
13:09 moritz well, you need to call it inside a method
13:09 huf where's method talk in Bar?
13:09 moritz as a first step at least :-)
13:09 grondilu oops
13:09 moritz r:  class Foo { method talk { say "foo" } }; class Bar is Foo { method talk { callsame; say 'bar' } }; Bar.new.talk
13:09 p6eval rakudo 547fcb: OUTPUT«foo␤bar␤»
13:09 grondilu my bad
13:09 grondilu indeed.
13:10 grondilu Thanks :-)
13:11 moritz np & yw :-)
13:12 kaleem joined #perl6
13:13 kaleem joined #perl6
13:14 [Coke] rindolf: it's a little early for the cold stuff. I switch to Coke Zero about 10am local time. :)
13:15 integral joined #perl6
13:15 integral joined #perl6
13:16 benabik joined #perl6
13:16 rindolf [Coke]: ah.
13:22 grondilu rn: say 3.infix:[my $ = "*"](4);
13:22 p6eval rakudo 547fcb: OUTPUT«No such method 'infix:<*>' for invocant of type 'Int'␤  in block  at /tmp/SlLgrXlTKT:1␤␤»
13:22 p6eval ..niecza v22-7-g7df6137: OUTPUT«(timeout)[auto-compiling setting]␤»
13:23 grondilu Is this kind of indirection NYI?
13:24 fhelmberger joined #perl6
13:24 moritz r: say 3.&infix:[my $ = "*"](4);
13:24 p6eval rakudo 547fcb: OUTPUT«12␤»
13:25 moritz grondilu: if you want to use a subroutine as a method, you must include the & in the name
13:26 grondilu ok, but I guess S12 needs to be corrected then.
13:26 grondilu around line 379
13:29 moritz I don't see why
13:29 moritz in that case $methodobj contains a callable
13:29 kaleem joined #perl6
13:30 moritz but you were using a method *name*
13:40 sftp joined #perl6
13:42 grondilu it took some time but yeah I think I get it.
13:42 grondilu r: class Foo is Str { method infix:<++>($s) { self ~ $s } }; say Foo.new.infix:<++>("bar");
13:42 p6eval rakudo 547fcb: OUTPUT«bar␤»
13:42 grondilu here we don't need '&' indeed.
13:43 moritz right, because infix:<++> already is a method, not a sub
13:46 dalek Perlito: 1a8d3e4 | (Flavio S. Glock)++ | / (3 files):
13:46 dalek Perlito: Perlito5 - js - p5ArrayOfAlias - shift, pop
13:46 dalek Perlito: review: https://github.com/fglock/Perlito/commit/1a8d3e4e8f
13:50 moritz http://css.dzone.com/articles/anti-javascript-perl-6
13:50 moritz (sorry if that's already been posted, I haven't backlogged thorougly for a time)
13:52 moritz http://www.johndcook.com/blog/2012/10/09/the-anti-javascript/ is the original URL
13:55 bluescreen10 joined #perl6
13:55 [Coke] wow, that's a surprisingly postive take on the situation. :)
13:59 stopbit joined #perl6
13:59 moritz aye :-)
14:01 moritz r: class A { method !foo($x) { say "private $x" }; method public { $!foo("stuff") } }; A.new.public
14:01 p6eval rakudo 547fcb: OUTPUT«===SORRY!===␤Attribute $!foo not declared in class A␤at /tmp/FnPF5WO3bX:1␤»
14:02 moritz according to S12:471, that should work
14:02 moritz as a short way to say $( self!foo('stuff') )
14:02 moritz though personally I'm not sure the conflict with attribute names is worth it
14:09 flightrecorder joined #perl6
14:18 FROGGS joined #perl6
14:20 cognominal joined #perl6
14:21 hash_table joined #perl6
14:26 skids joined #perl6
14:26 atrodo joined #perl6
14:44 fhelmberger joined #perl6
15:26 flightrecorder joined #perl6
15:28 FROGGS joined #perl6
15:39 att joined #perl6
16:00 kaare_ joined #perl6
16:02 wamba joined #perl6
16:05 supernovus joined #perl6
16:15 supernovus r: my $m = method ($a) { say "$.name says $a"; }; class A { has $.name; }; my $foo = A.new(:name<Bob>); $foo.$m("hello");
16:15 phenny supernovus: 10 Oct 02:01Z <[Coke]> tell supernovus I tried to write a test that this passed and rakudo failed, and failed. Can you add a test to the ticket or to roast?
16:15 p6eval rakudo 547fcb: OUTPUT«Bob says hello␤»
16:22 Ulti r: my @list = <hello>; @list.unshift(1..Inf); say @list[*-1];
16:22 p6eval rakudo 547fcb: OUTPUT«(timeout)»
16:22 Ulti I think it starts to reify Inf
16:23 Ulti yeah it does looking at my RAM usage :D
16:24 Ulti if you go the other way around you can't push on the end of an Inf list it raises an exception
16:24 Ulti n: my @list = <hello>; @list.unshift(1..Inf); say @list[*-1];
16:24 p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)[auto-compiling setting]␤»
16:25 colomon n: my @list = <hello>; @list.unshift(1..Inf); say @list[*-1];
16:25 p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)[auto-compiling setting]␤»
16:26 colomon huh.  why still compiling the setting?
16:26 Ulti would be kind of neat if it just noticed the end was already reified and /after/ the inf list.... like recursive laziness
16:26 colomon n: say "Hello"
16:26 p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)[auto-compiling setting]␤»
16:27 Ulti but yeah thats a nasty edge case for the spec I guess
16:27 colomon seems like something is wrong with p6eval here....
16:27 supernovus [Coke]: Okay. I'll check out roast and look at adding a test.
16:27 Ulti well this fails on my local install of Rakudo too
16:28 Ulti though not sure if its this months Rakudo*
16:28 MayDaniel joined #perl6
16:28 Vlavv` joined #perl6
16:28 colomon Ulti: I would never expect unshift an infinite list to work.  :)
16:29 colomon but say "Hello" ought to work.
16:29 Ulti heh yeah
16:29 Ulti the real problem is unshift of an infinite /does/ work
16:30 vlixes joined #perl6
16:32 Ulti hmm weird
16:33 thou joined #perl6
16:33 Ulti the latest Rakudo* flips out on the act of unshifting the infinite range, Rakudo* from August flips out when you ask for the last element
16:35 Ulti ^ scratch that they both dont like the initial unshift
16:39 GlitchMr perl6: @(1, 2, 3).perl.say
16:39 p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)[auto-compiling setting]␤»
16:39 p6eval ..rakudo 547fcb: OUTPUT«(1, 2, 3).list␤»
16:39 GlitchMr r: @(1, 2, 3).unshift.perl.say
16:39 p6eval rakudo 547fcb: OUTPUT«(1, 2, 3).list␤»
16:40 supernovus Hmm, if I commit this change to roast, adding the test for my patch, then anyone running rakudo without the patch will now get failures in S32-str/pack.t until the patch is applied.
16:41 att joined #perl6
16:43 tadzik joined #perl6
16:45 grondilu rn: role Foo { method postfix:<!>() { "Foo!" } }; my $x; say ($x but Foo)!;
16:45 p6eval niecza v22-7-g7df6137: OUTPUT«(timeout)[auto-compiling setting]␤»
16:45 p6eval ..rakudo 547fcb: OUTPUT«===SORRY!===␤Confused␤at /tmp/1cC6VROLGs:1␤»
16:49 MayDaniel joined #perl6
16:52 diakopter std: say "h"~~/<<<<<<:m/>>>>>>/>>>>>>/a/ # TimToady what does this mean
16:52 p6eval std 77327a4: OUTPUT«ok 00:00 44m␤»
16:52 dalek roast: f244f31 | (Timothy Totten)++ | S32-str/pack.t:
16:52 dalek roast: Added test for 'x' in pack()
16:52 dalek roast:
16:52 dalek roast: rakudo patch: https://rt.perl.org/rt3/Public/Bug/Display.html?id=115120
16:52 dalek roast: review: https://github.com/perl6/roast/commit/f244f315cb
16:54 diakopter TimToady: I can't tell what's terminating what
16:54 TimToady that's what viv is for
16:55 supernovus [Coke]: Tests for the 'x' flags added to S32-str/pack.t
16:56 Ulti I think I just discovered my favorite bit of perl six "my @list = (); say if @list eq Nil;" rather than in perl5 where you do a check for undef and then scalar @list == 0
16:57 TimToady why do you use eq?
16:58 TimToady and @list == 0 is already in scalar context
16:58 diakopter r: my @list = [Nil, Nil]; say 1 if @list eq Nil;
16:58 p6eval rakudo 547fcb: OUTPUT«1␤»
16:59 diakopter too bad niecza p6eval is broken
17:00 TimToady Ulti: I guess I don't know what you're really trying to accomplish there
17:01 PerlJam Is feather really really slow ior is it just me?
17:02 jnthn o/ from Stockholm
17:03 PerlJam jnthn: o/
17:03 Ulti TimToady: in perl5 you can't do something like   if @list eq []
17:04 Ulti or ()
17:04 Ulti at least if you can I am doing it wrong
17:04 TimToady why do you want to use 'eq' for that?  that's a string coercion
17:04 Ulti I don't its just in rakudo I got a load of errors about Nil and numerical comparisson
17:05 Ulti "use of uninitialized value of type Nil in numeric context"
17:05 fgomez joined #perl6
17:05 PerlJam Ulti: Are you just trying to see if the array is emtpy?
17:05 TimToady Nil is not really a value, it's the absence of a value
17:05 Ulti PerlJam: yeah
17:05 TimToady 'unless @list'
17:05 TimToady of 'if @list'
17:06 TimToady just use it in Boolean context
17:06 TimToady r: my @list = (); say so @list;
17:06 p6eval rakudo 547fcb: OUTPUT«False␤»
17:06 Ulti specifically arrayrefs though in perl5, basically every line of selectall_arrayref in DBI has a messed up if afterwards
17:07 TimToady well, you just have to deref it in P5 to get array behavior
17:07 Ulti yeah, but you first check for undef too otherwise you are deref'ing undef
17:08 TimToady okay, I see what you're saing now
17:08 TimToady *y
17:08 Ulti sorry I was really not clear
17:09 Ulti but yeah just double checked, perl6 just magics the arrayrefness for you
17:09 Ulti so the logic of testing an array or arrayref is identical
17:09 Ulti which is really nice
17:10 * TimToady bows, then remembers who wrote Perl 5...  :)
17:11 raiph joined #perl6
17:12 Ulti heh
17:13 Ulti meh perl5 just /always/ use refs then you dont get into any trouble
17:14 PerlJam TimToady:  You can strut for Perl 6 without being humble about Perl 5.  It's okay.   :-)
17:16 Ulti :)
17:18 Ulti whenever I get frustrated over anything datastructure related in perl5 I flick back to some of my past Java code with huge nested generic declarations for stuff like HashTable<String,HashTable<String,ArrayList<String>>>
17:18 Ulti its all good
17:19 Ulti hashes and lists should just work and they should be primitives of all languages
17:19 jnthn The thing is that Java also doesn't have type inference. So you often have to write those things *twice*, once on the thing that'll hold it and once in the new statement.
17:19 Ulti yup
17:20 Ulti I have lots of declarations for class variables that cover like 6 wrapped lines in my Java.... when I complaing to other people who love Java they just ask why I would want a data structure like that... and not a nest of 10 classes
17:21 Ulti HashStringListHashOfString datastructure = new HashStringListHashOfString  <--- so much better!
17:21 jnthn :/
17:21 * jnthn is glad he doesn't have to deal with Java
17:22 Ulti I had to deal with it to complete my degree which kind of sucks
17:22 GlitchMr HashStringListHashOfString? This is too descriptive name...
17:23 Ulti not for Java, the more verbose you are the better the code
17:24 Ulti the best is the javadoc comments that just repeat the class names with spaces added :D
17:24 Ulti but hey Java vs Perl isn't a fair race
17:24 GlitchMr What sort of data structure is that anyways?
17:24 GlitchMr HashString?
17:24 GlitchMr OfString?
17:24 Ulti a great one for holding a graph of word use in a passage of text
17:25 Ulti in perl you would just use a hash of hashes or something
17:25 GlitchMr Is structure like this: {a: [{b: 'abc'}]}
17:25 GlitchMr (this is JavaScript, by the way)
17:25 * Ulti checks his specific example
17:26 GlitchMr I've no idea what this class name actually means
17:26 tadzik joined #perl6
17:26 GlitchMr Probably because I haven't programmed in Java, but not sure
17:26 Ulti HashTable<String,HashTable<String,ArrayList<String>>>  === {'a'=>{'b'=>['c','d','e']}}
17:26 GlitchMr uhmmm... fun
17:26 Ulti I use that quite often
17:26 Ulti weirdly
17:27 GlitchMr What is === anyways?
17:27 Ulti where b is a word following a and then you just have a list of stuff associated with that connection
17:27 GlitchMr The part on the left is type, the part on the right is instanceof that type
17:27 Ulti GlitchMr just pseudo english/code for are equivalent
17:27 Ulti GlitchMr: thats me saying the Java declaration of a type is equivalent to the perl literal form
17:28 [Coke] I think I (nigh) killed feather again. looks like it's actually one of the pugs tests chewing all memory.
17:28 * Ulti vanishes into the ether bbl
17:29 GlitchMr So HashTable<> is two arguments type - the first one is type used for keys, the second is type used for values. Am I right?
17:29 [Coke] PerlJam: it wasn't just you
17:29 GlitchMr That makes sense
17:29 [Coke] all ok now. Disabling cron job until that test gets fudged for pugs.
17:30 GlitchMr As for Java, I don't like it because it's language intended to be used with IDE
17:30 GlitchMr Try using it without IDE
17:31 [Coke] tempting to add the "perl6-limited.pl" trick so that any one test that may or not be fudged doesn't take down the host system.
17:32 GlitchMr Probably type declaration would be smaller if HashTable would be Hash and ArrayList would be Array, but it's Java...
17:32 jnthn .Net called it Dictionary, which is terribly huffmanized.
17:33 jnthn At least List is reasonably short
17:33 GlitchMr Isn't .Net Microsoft's response for Java?
17:34 sisar joined #perl6
17:34 GlitchMr So, identifiers length is comparable with Java
17:34 jnthn GlitchMr: Yeah, but C# is a rather better language than Java. By quite some way.
17:35 leont joined #perl6
17:36 [Coke] supernovus++
17:41 PerlJam jnthn: that's okay, Java is way better than C++  ;)
17:42 jnthn It's almost as if languages get better with time by learning form the mistakes of others!
17:43 PerlJam jnthn: then how do you explain PHP?  They learned the wrong things?
17:44 [Coke] php has been out there for a while.
17:44 jnthn PerlJam: "mistake" is subjective? ;-)
17:44 flussence PHP got the ordering of "make it {work,correct,fast}" wrong
17:45 PerlJam Coke: php is contemporaneous with Perl 5.  I think they missed a few lessons.
17:45 flussence they went for working then fast, and then people started using it and they realised "fast" for plain CGI isn't neccessarily fast for other uses
17:47 flussence (in particular, adding new language features is an utter nightmare because their parser does a direct translation between source tokens and VM opcodes instead of building a tree)
17:48 doy that sounds remarkably like perl 5
17:48 PerlJam I had a conversation with a CS prof earlier today whose wife is teaching an "internet programming" course (basically writing web apps).   She started teaching theml HTML, then CSS, then PHP ... soon she's going to flip them to RoR.  I wonder how many will conclude  that PHP is a good thing?
17:48 flussence no, p5 builds a parse tree first and then does stuff to that... (IIRC from the camel book)
17:49 doy well, it builds opcodes directly via a bison parser
17:49 flussence (although I've heard the p5 parser isn't fun to hack on either)
17:49 doy so the parse tree is still just implicit
17:49 flussence php's is more like trying to compile assembly code by using sed
17:50 doy i have no doubt
17:50 doy (:
17:51 [Coke] I am biased, of course, but I'd go for CF before php.
17:51 jnthn Time for a break from talk prep..
17:51 jnthn (yes, I didn't finish preparing for my NPW talk for tomorrow yet...)
17:51 SamuraiJack joined #perl6
18:04 flussence r: my \a = set <1 2 3>; say 1 ~~ a
18:04 p6eval rakudo 547fcb: OUTPUT«False␤»
18:06 flussence for some reason I get a segfault on the repl if I do "my \a = set <1 2 3>" and then "1 ~~ a" on another line, but not on the same line
18:08 GlitchMr Unlike Perl 5, ~~ is not "contains" operator. But still, it shouldn't crash
18:09 flussence also does it with "= any set" there (which is what I was going for)
18:09 PerlJam I don't think Perl 5 knows what operator ~~ is yet ;)
18:09 PerlJam (unless p5p came to some concensus while I wasn't looking)
18:10 sisar r: my @a; say @a[1]; say @a[*-1];
18:10 p6eval rakudo 547fcb: OUTPUT«Any()␤Cannot use negative index -1 on Array␤  in method gist at src/gen/CORE.setting:9934␤  in sub say at src/gen/CORE.setting:7250␤  in block  at /tmp/xqsiYi23M9:1␤␤»
18:10 GlitchMr In Perl 5, you can say 1 ~~ [1, 2, 3] and it works
18:10 leont p5p and concensus on smartmatch? Who are you kidding!
18:11 GlitchMr I don't know why Perl 5 needs smartmatch
18:11 sisar what's with the "Cannot use negative index -1 on Array" error? What am i doing wrong ?
18:11 PerlJam GlitchMr: for the "switch" statement of course!   :)
18:11 GlitchMr Smartmatching is too smart for Perl 5
18:12 sisar r: my Int @a; say @a[*-1];
18:12 p6eval rakudo 547fcb: OUTPUT«Cannot use negative index -1 on Array+{TypedArray}␤  in method gist at src/gen/CORE.setting:9934␤  in sub say at src/gen/CORE.setting:7250␤  in block  at /tmp/wuBlgCX9mc:1␤␤»
18:12 flussence sisar: @a[*] in that context is 0, because it's empty.
18:12 flussence r: my @a; say @a[@a.elems - 1];
18:12 p6eval rakudo 547fcb: OUTPUT«Cannot use negative index -1 on Array␤  in method gist at src/gen/CORE.setting:9934␤  in sub say at src/gen/CORE.setting:7250␤  in block  at /tmp/wzGMEkgVnn:1␤␤»
18:13 GlitchMr In most cases, smartmatching is just any() function, just like in List::MoreUtils
18:13 PerlJam sisar: did you think that "say @a[1]" would auto-vivify ?
18:13 TimToady In Perl 6 you can say [1, 2, 3] ~~ [1, 2, 3] and it works :)
18:13 GlitchMr $ [1, 2, 3] ~~ [1, 2, 3]
18:13 GlitchMr 1
18:14 TimToady but it does something completely different
18:14 GlitchMr But well, ~~ in Perl 5 appears to be similar to Perl 6 operator. Except of those any() sort of operations aren't in Perl 6.
18:14 TimToady there are no implicit anys in p6
18:14 sisar PerlJam: yeah, say @[a1] should auto-vivify, shouldn't it ? I was thinking @a[*-1] would auto-vivify too, but now i see that is not possible.
18:14 TimToady and we actually have a type system
18:14 sisar *@a[1]
18:15 flussence the p6 ~~ is a lot nicer, since it just boils down to multi ACCEPTS methods underneath
18:15 GlitchMr Smartmatching in Perl 5 simply doesn't work well without typing
18:15 GlitchMr Of course it can get type of reference, but that's all
18:16 GlitchMr Also: $ 'red' ~~ ['blue', [['green', ['red']], 'purple']]
18:16 GlitchMr 1
18:16 GlitchMr ~~ is recursive?
18:17 GlitchMr That's too clever to be useful...
18:17 leont GlitchMr: In perl5? Sometimes…
18:17 sisar flussence: Confirmed. I get the seg falut too on the REPL.
18:18 GlitchMr For me, ~~ in Perl 5 sounds like a mistake
18:18 diakopter r: my @a; my $c=now; @a[@a]=$_ for 1..5000; say now - $c;
18:18 GlitchMr And for me, given when in Perl 5 is mistake too
18:18 p6eval rakudo 547fcb: OUTPUT«6.4875409␤»
18:18 diakopter r: my @a; my $c=now; @a.push($_) for 1..5000; say now - $c;
18:18 leont I like when, actually
18:18 p6eval rakudo 547fcb: OUTPUT«(timeout)»
18:18 diakopter rakudo like @a[@a]= much better than push
18:19 leont And given an appropriate matcher library, smartmatch can be pretty cool
18:19 diakopter *likes
18:19 GlitchMr .push() should be better than
18:19 TimToady given/when is fine if you limit yourself to strings and numbers
18:19 leont It's the part that makes guesses that is awful
18:19 GlitchMr TimToady: isn't hash of subroutines for that?
18:19 diakopter GlitchMr: ?
18:19 dduncan joined #perl6
18:20 PerlJam sisar: autovivification of array elements in rvalue context seems weird and slightly dangerous to me.
18:20 TimToady GlitchMr: sometimes a switch is more readable
18:20 fglock joined #perl6
18:20 dduncan left #perl6
18:20 diakopter GlitchMr: what do you mean by ".push() should be better than"
18:21 GlitchMr then*
18:21 diakopter what do you mean by "should"
18:21 diakopter @a[@a]= is far faster
18:24 diakopter r: my @a; my $c=now; @a[$_]=$_ for 0..4999; say now - $c;
18:24 p6eval rakudo 547fcb: OUTPUT«0.4320339␤»
18:24 diakopter but 5000 length queries are hella slow
18:25 diakopter (6 seconds)
18:26 diakopter where did all those crickets come fromt?
18:27 diakopter GlitchMr: why/how should push method be better?
18:32 GlitchMr It should be faster
18:32 diakopter do you mean "someone ought to make it faster?" or "I'm surprised it's not faster"
18:32 TimToady the two are not mutually exclusive :)
18:33 diakopter right, but it could be only one or the other
18:33 TimToady well, it *should* be only one or the other :)
18:34 diakopter I'm not surprised it's faster; method lookups/execution are slow
18:35 flussence they're both slow, but it's only 3x slower than the assignment method
18:35 sjohnson joined #perl6
18:38 diakopter r: my @a; my $c=now; unshift(@a,$_) for 1..3000; say now - $c;
18:38 p6eval rakudo 547fcb: OUTPUT«7.1017452␤»
18:38 diakopter r: my @a; my $c=now; splice(@a,0,0,$_) for 1..3000; say now - $c;
18:38 p6eval rakudo 547fcb: OUTPUT«7.945410␤»
18:38 _edwin joined #perl6
18:42 GlitchMr So, multidispatch is slow?
18:46 flussence if you want to see *slow*, try `time perl6 -e "say +open('/usr/share/dict/words').lines"`
18:46 flussence I ran the profiler and it seems like 30% of the time is just from .chomp
18:48 diakopter it's 15,000x slower than wc -l
18:51 diakopter r: my $a=sub {}; $a.$a
18:51 p6eval rakudo 547fcb: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤  in sub  at /tmp/BTUvRAiy46:1␤  in block  at /tmp/BTUvRAiy46:1␤␤»
18:53 diakopter r: my $a=sub ($b) { say $b }; 15.$a
18:53 p6eval rakudo 547fcb: OUTPUT«15␤»
18:53 diakopter is that supposed to do that?
18:54 flussence r: my $c = method () { say self }; 15.$c;
18:54 p6eval rakudo 547fcb: OUTPUT«15␤»
18:54 leont left #perl6
18:54 flussence I think it's equivalent to that
18:56 flussence hm, .lines seems a lot faster than .slurp.comb(/^^.*$$/) at any rate, and .slurp.split(/\n/) is even worse for memory usage
18:59 flussence just poking around... is that commented out code in core/IO.pm:124 still relevant?
19:02 _edwin http://rosettacode.org/wiki/CRC-32#Perl_6
19:03 _edwin for some reason i seem to be drawn to write such absurdly slow code :}
19:03 integral joined #perl6
19:03 integral joined #perl6
19:04 _edwin maybe because in my dayjob I'm counting processor cycles all the time :/
19:10 GlitchMr http://us2.php.net/manual/en/function.crc32.php
19:10 GlitchMr So... in PHP, crc32() can give negative numbers on 32-bit systems...
19:11 GlitchMr That doesn't makes sense.
19:11 brrt joined #perl6
19:11 supernovus gah, apparently DateTime.now still believes my local timezone to be +0700 instead of -0700. :(
19:11 GlitchMr But it's PHP
19:12 sorear when you get right down to it the return value of crc32 should be an element of GF(2^32), not int or unsigned it
19:12 sorear returning negative numbers doesn't make less sense than returing positive numbers greater than 1
19:14 sorear or ℤ/2ℤ[x]
19:15 diakopter r: (method { self.(self) }).(method { self.(self) }) # hee hee
19:15 p6eval rakudo 547fcb: OUTPUT«maximum recursion depth exceeded␤current instr.: 'print_exception' pc 88369 (src/gen/CORE.setting.pir:42327) (src/gen/CORE.setting:9039)␤called from Sub '<anon>' pc 174 ((file unknown):118) (/tmp/9w7_9BuMOm:1)␤called from Sub '<anon>' pc 196 ((file unknown):134) (/…
19:16 diakopter sorear: niecza p6eval is dieded
19:16 sorear diakopter: I know
19:17 diakopter r: $_=method {self.(self)};$_.$_
19:17 p6eval rakudo 547fcb: OUTPUT«maximum recursion depth exceeded␤current instr.: 'print_exception' pc 88369 (src/gen/CORE.setting.pir:42327) (src/gen/CORE.setting:9039)␤called from Sub '<anon>' pc 116 ((file unknown):83) (/tmp/e3WOOmTLLj:1)␤called from Sub '<anon>' pc 138 ((file unknown):99) (/tm…
19:17 [Coke] r: my $ℤ= 3; say $;
19:17 p6eval rakudo 547fcb: OUTPUT«===SORRY!===␤Non-declarative sigil is missing its name␤at /tmp/vaPJsqD5uA:1␤»
19:17 [Coke] r: my $ℤ= 3; say $ℤ;
19:17 p6eval rakudo 547fcb: OUTPUT«3␤»
19:17 [Coke] huh. spif.
19:17 [Coke] .u ℤ
19:17 phenny U+2124 DOUBLE-STRUCK CAPITAL Z (ℤ)
19:20 brrt would cqrs be a good fit for a shop inventory system?
19:23 TimToady r: my \ℤ = 3; say ℤ;
19:23 p6eval rakudo 547fcb: OUTPUT«3␤»
19:23 jnthn .u ℤ
19:23 phenny U+2124 DOUBLE-STRUCK CAPITAL Z (ℤ)
19:23 brrt what does the \ sigil do?
19:23 jnthn (gives me a box here...)
19:24 jnthn brrt: Introduces a name you can from then on refer to without the sigil
19:24 jnthn Also as a result of having no sigil it imposes no context
19:26 * brrt can barely wrap his had arround that
19:26 brrt oh
19:26 brrt i see
19:28 hash_table joined #perl6
19:29 [Coke] r: my \say = 3; say say;
19:29 p6eval rakudo 547fcb: OUTPUT«===SORRY!===␤Confused␤at /tmp/wR6Au7GVKw:1␤»
19:29 [Coke] r: my \if = 3; say if;
19:29 p6eval rakudo 547fcb: OUTPUT«␤»
19:29 [Coke] std: my \if = 3; say if;
19:29 p6eval std 77327a4: 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/SzPydU71Ox line 1:�------> [32mmy \if = 3; say[33m�[31m if;[0m�Confused at /tmp/SzPydU71Ox line 1:�------> [3…
19:30 [Coke] I suspect that my \<keyword> should be disallowed.
19:30 [Coke] "this ain't tcl"
19:30 TimToady this is why you should use Unicode symbols
19:30 brrt r: my \whatever = 42; say whatever;
19:30 p6eval rakudo 547fcb: OUTPUT«42␤»
19:31 brrt r: my \whatever = 1,2,3; say whatever
19:31 p6eval rakudo 547fcb: OUTPUT«1 2 3␤»
19:31 brrt nice
19:31 jnthn TimToady: "i" and "f" are both in Unicode :P
19:31 brrt r: my \whatever = Foo => 'bar'; say whatever
19:31 p6eval rakudo 547fcb: OUTPUT«"Foo" => "bar"␤»
19:32 brrt yay, i like perl6 again
19:33 TimToady so fickle...
19:34 japhb_ joined #perl6
19:34 japhb_ TimToady, I was thinking the exact same thing.  ;-)
19:37 japhb_ sorear, I know you know about the niecza being unavailable on p6eval.  If you haven't had a chance to look at it personally, I can add that it won't compile locally for me right now either; seems to be related to the gamma function commit yesterday:
19:37 japhb_ lib/Builtins.cs(11,7): error CS0246: The type or namespace name `SpecialMathFunctions' could not be found. Are you missing a using directive or an assembly reference?
19:37 birdwindupbird joined #perl6
19:37 japhb_ That's the error after 'git pull; make clean; make'
19:38 TimToady [Coke]: note that most keywords in p6 will win under LTM because they tend to include a trailing whitespace.
19:38 TimToady r: my \do = 42; say do do;
19:38 p6eval rakudo 547fcb: OUTPUT«42␤»
19:39 japhb_ my \do = 42; say do do ;
19:39 japhb_ r: my \do = 42; say do do ;
19:39 p6eval rakudo 547fcb: OUTPUT«===SORRY!===␤Error while compiling block : Error while compiling op call: Error while compiling block : Error while compiling block : Can only use get_how on a SixModelObject␤»
19:39 supernovus r: my \foo = 1,2,3,4; say foo.WHAT;
19:39 p6eval rakudo 547fcb: OUTPUT«Parcel()␤»
19:39 jnthn whoa...
19:39 jnthn japhb_: That one'd want reporting.
19:39 supernovus hmm, better than what I get locally, which is "Segmentation fault (core dumped)"
19:39 jnthn r: do
19:39 japhb_ jnthn, OK, will do
19:39 p6eval rakudo 547fcb: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&do' called (line 1)␤»
19:40 sorear japhb_: poke colomon, looks like colomon forgot to commit makefile changes
19:40 colomon doh!
19:41 colomon there you go, sorry about that.
19:41 dalek niecza: 7ae412a | (Solomon Foster)++ | Makefile:
19:41 dalek niecza: Add SpecialMathFunctions.cs to the build.
19:41 dalek niecza: review: https://github.com/sorear/niecza/commit/7ae412add3
19:42 TimToady std: my \do = 42; say do do ;
19:42 p6eval std 77327a4: OUTPUT«ok 00:00 42m␤»
19:43 TimToady std: say do do ;
19:43 p6eval std 77327a4: OUTPUT«ok 00:00 42m␤»
19:43 TimToady r: say do do ;
19:43 p6eval rakudo 547fcb: OUTPUT«===SORRY!===␤Error while compiling block : Error while compiling op call: Error while compiling block : Error while compiling block : Can only use get_how on a SixModelObject␤»
19:43 moritz r: say BEGIN BEGIN 3
19:43 p6eval rakudo 547fcb: OUTPUT«3␤»
19:44 diakopter r: my \if = (my \say = 1 ); say if if if if {} if
19:44 p6eval rakudo 547fcb:  ( no output )
19:44 diakopter no clue there
19:45 TimToady std: my \if = (my \say = 1 ); say if if if if {} if
19:45 p6eval std 77327a4: OUTPUT«[31m===[0mSORRY![31m===[0m�Missing semicolon at /tmp/vdW6AgbtuV line 1:�------> [32mmy \if = (my \say = 1 ); say if if[33m�[31m if if {} if[0m�Parse failed�FAILED 00:00 44m�»
19:47 diakopter I cannot fathom how rakudo's parsing that
19:47 diakopter I've tried all kinds of replacing if with 1
19:48 japhb_ colomon, Working like a charm now, thank you!
19:48 colomon thank you for bringing it to my attention
19:48 japhb_ jnthn, bug sent
19:48 japhb_ np
19:49 japhb_ Does someone need to kick the rebuild for p6eval, or will it try automatically?
19:50 moritz it's done by cron
19:50 cognominal_ joined #perl6
19:50 japhb_ moritz, even when a previous build is stuck?
19:50 moritz define "stuck"
19:51 moritz if it fails, no problem
19:51 moritz if it hangs... no idea, never had that problem
19:51 sorear I don't think it's hanging
19:51 japhb_ fair enough
19:52 japhb_ Before colomon's fix, the build died quickly here, I was just wondering about the message that p6eval was giving (that sounded like it was trying to compile the setting and just never completing)
19:53 sorear japhb_: since the build failed, each time you ran p6eval it tried to compile the setting
19:53 sorear and then failed a few seconds in, killed with signal SIGXCPU
19:53 japhb_ nodnod
19:55 diakopter r: if 1 { say 4 } if 1 { say 5 }
19:55 p6eval rakudo 547fcb: OUTPUT«4␤5␤»
19:55 diakopter jnthn: why does the above work?
19:55 sorear std: if 1 { say 4 } if 1 { say 5 }
19:55 p6eval std 77327a4: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Strange text after block (missing comma, semicolon, comment marker?) at /tmp/t4yEuVbNZ5 line 1:â�¤------> [32mif 1 { say 4 }[33mâ��[31m if 1 { say 5 }[0mâ�¤    expecting any of:â�¤     horizontal whitespaceâ�¤  statement_controlâ�¤Parse failedâ�¤FAILE…
19:58 hoelzro hey Perl6 folk
19:58 hoelzro I finally managed to build Rakudo * 2012.09 on my laptop!
19:58 hoelzro \o/
19:59 [Coke] yay!
19:59 hoelzro now I'm back with questions ;)
20:00 hoelzro $*EXECUTABLE_NAME is supposed to be the name of the script I'm running, right?
20:00 hoelzro like $0 from Perl 5?
20:01 sorear I think that it's actually $^X
20:01 sorear $0 is $*PROGRAM_NAME or something
20:01 hoelzro ah, that's what I'm looking for =)
20:01 hoelzro because it was returning $^X and I was thinking "wtf"
20:01 hoelzro sorear: thanks!
20:02 flussence all the systemish vars are listed at the top of S28
20:03 moritz http://doc.perl6.org/language/variables#Special+Variables
20:03 jnthn diakopter: I think that one's RT'd already...some oddity with end of statement.
20:03 diakopter oh
20:04 jnthn Though I thought I sync'd some of that stuff with STD when doing the LTM work...
20:04 jnthn Must be some difference somewhere.
20:06 cognominal_ joined #perl6
20:18 VXZ joined #perl6
20:26 sirrobert joined #perl6
20:26 sirrobert hallo
20:26 sorear hi
20:26 birdwindupbird joined #perl6
20:26 jnthn o/ sirrobert
20:27 sirrobert how do I write an lvalue method?
20:27 sirrobert there's something I saw once, but I can't find it... rw-return or return-rw maybe
20:27 jnthn return-rw,
20:27 sirrobert trying to write a customer setter/getter
20:27 sirrobert hmm
20:29 sirrobert r: class A { method v (Str $v) { return-rw $v } }; A.new.v = 4;
20:29 p6eval rakudo 547fcb: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤  in method v at /tmp/I0JuUdkuTr:1␤  in block  at /tmp/I0JuUdkuTr:1␤␤»
20:29 sirrobert r: class A { method v (Str $v?) { return-rw $v } }; A.new.v = 4;
20:29 p6eval rakudo 547fcb: OUTPUT«Cannot assign to a readonly variable or a value␤  in block  at /tmp/q2QRroqHSj:1␤␤»
20:30 sirrobert keep getting that
20:30 sirrobert (ignore that the type was wrong in that example.. the error is that it can't assign.
20:30 sirrobert r: class A { method v (Str $v?) { return-rw $v } }; A.new.v = 'foo;;
20:30 p6eval rakudo 547fcb: OUTPUT«===SORRY!===␤Confused␤at /tmp/YXhUR1B0qz:1␤»
20:31 colomon sirrobert: what do you think you're assigning there?
20:31 colomon n: class A { method v (Str $v?) { return-rw $v } }; A.new.v = 4;
20:31 p6eval niecza v22-9-g7ae412a: OUTPUT«Unhandled exception: Writing to readonly scalar␤  at /tmp/AV7BC97rWo line 1 (mainline @ 6) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4205 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4206 (module-CORE @ 576) ␤  at /home/p6eval/niecza/lib…
20:31 colomon n: class A { method v (Str $v?) { return-rw $v } }; my $a; A.new.v($a) = 4; say $a;
20:31 p6eval niecza v22-9-g7ae412a: OUTPUT«Unhandled exception: Nominal type check failed in binding '$v' in 'A.v'; got Any, needed Str␤  at /tmp/DWz1Sv6kkO line 0 (A.v @ 1) ␤  at /tmp/DWz1Sv6kkO line 1 (mainline @ 7) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4205 (ANON @ 3) ␤  at /home/p6eval…
20:31 sirrobert in that example, just some var.  but this doesn't work either:
20:31 jnthn Yeah, doing it to a (readonly) parameter won't cut it
20:32 jnthn sirrobert: What're you actually trying to do, by the way? :)
20:32 colomon n: class A { method v (Str $v is rw) { return-rw $v } }; my $a; A.new.v($a) = 4; say $a;
20:32 p6eval niecza v22-9-g7ae412a: OUTPUT«[31m===[0mSORRY![31m===[0m��Strange text after block (missing comma, semicolon, comment marker?) at /tmp/zTBkTLy1QT line 1:�------> [32mthod v (Str $v is rw) { return-rw $v } }[33m�[31m; my $a; A.new.v($a) = 4; say $a;[0m��Parse failed��»…
20:32 sirrobert r: class A { has $.v; method v ($v) { return-rw $.v } }; A.new.v = 'foo;
20:32 p6eval rakudo 547fcb: OUTPUT«===SORRY!===␤Confused␤at /tmp/6wxkeBIzbG:1␤»
20:32 sirrobert that's closer to what I want to do.
20:32 sirrobert r: class A { has $.v; method v ($v) { return-rw $.v } }; A.new.v = 'foo';
20:32 p6eval rakudo 547fcb: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤  in method v at /tmp/Bk6BQzD21a:1␤  in block  at /tmp/Bk6BQzD21a:1␤␤»
20:33 sirrobert dang it
20:33 sirrobert heh
20:33 sirrobert r: class A { has $.v; method v ($v?) { return-rw $.v } }; A.new.v = 'foo';
20:33 p6eval rakudo 547fcb: OUTPUT«maximum recursion depth exceeded␤current instr.: 'print_exception' pc 88369 (src/gen/CORE.setting.pir:42327) (src/gen/CORE.setting:9039)␤called from Sub 'v' pc 151 ((file unknown):178492324) (/tmp/RoXftqPBKG:1)␤called from Sub 'v' pc 174 ((file unknown):178492341) …
20:33 sirrobert look, so here's the problem I want to solve =)
20:33 jnthn sirrobert: Yes, but why do you want to write the custom accessor in the first place? That kinda changes the answer :)
20:33 sirrobert I am handling semantic versioning as a set of properties:   major, minor, patch (1.25.2)
20:34 sorear sirrobert: $.v means self.v, the infinite recusion is thus obvious
20:34 sirrobert I want to be able to set with $foo.version = '1.2.3'
20:34 sorear sirrobert: You meant $!v
20:34 colomon r: class A { has $.a; method v() { return-rw $!a; }; }; A.new.v = 'foo';
20:34 p6eval rakudo 547fcb:  ( no output )
20:34 colomon r: class A { has $.a; method v() { return-rw $!a; }; }; my $a = A.new; $a.v = 'foo'; say $a.a
20:34 p6eval rakudo 547fcb: OUTPUT«foo␤»
20:34 colomon sirrobert: there you go
20:34 sirrobert sorear:  ohhhhh... I keep forgetting that $.v is a virtual method call
20:34 sirrobert thanks all
20:35 skids should there be an "is rw" on the method now that there is return-rw?
20:35 sirrobert How do I do some processing on the value that's getting assigned?
20:36 sorear use a Proxy
20:36 skids sirrobert: use a proxy.
20:36 colomon sirrobert: I think you might... yeah proxy
20:36 sirrobert docs url?
20:36 sirrobert (haven't heard of a proxy in perl6)
20:37 sirrobert or you just mean a private attr with a different name?
20:37 sorear n: Proxy.new(FETCH => -> $ { }, STORE => -> $, $new { say $new }) = 5
20:37 p6eval niecza v22-9-g7ae412a: OUTPUT«5␤»
20:37 sorear n: Proxy.new(FETCH => -> $ { 7 }, STORE => -> $, $new { say $new })++
20:37 p6eval niecza v22-9-g7ae412a: OUTPUT«8␤»
20:37 sirrobert hmm
20:37 skids docs are a bit sparse.  Working example (you don't need the Zavolaj stuff in there): https://gist.github.com/2771728
20:38 sirrobert skids: thanks, reading
20:38 sorear r: Proxy.new(FETCH => -> $ { 7 }, STORE => -> $, $new { say $new })++
20:38 p6eval rakudo 547fcb: OUTPUT«8␤»
20:38 colomon sirrobert: http://perlcabal.org/syn/S06.html#Lvalue_subroutines
20:38 sirrobert colomon: thanks
20:38 sirrobert (didn't realize you could do method !foo () {...} for private methods...?)
20:39 sirrobert ok, makes more sense now.  Thanks all
20:41 dalek ecosystem: 1e70a74 | (Timothy Totten)++ | META.list:
20:41 dalek ecosystem: Added Netstring library.
20:41 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/1e70a74b7b
20:42 dalek rakudo-debugger: c1d805d | jonathan++ | lib/Debugger/UI/CommandLine.pm:
20:42 dalek rakudo-debugger: fail shouldn't count as a throw.
20:42 dalek rakudo-debugger: review: https://github.com/jnthn/rakudo-debugger/commit/c1d805d111
20:42 sirrobert proxy is kinda like p5 tie
20:43 skids Pretty much.
20:44 jnthn sirrobert: If you haven't heard the news already: latest debugger in git repo has step out and step over. It also allows looking at self and attributes. :)
20:44 jnthn sirrobert: Thanks for the feature requests :)
20:45 sirrobert jnthn++: woot!  no more work today, gonna play with it =)
20:45 sirrobert thanks
20:45 cognominal__ joined #perl6
20:46 sirrobert jnthn: that's going to be GREAT for skipping those loooong regex parsings heh
20:46 grondilu is thi debugger panda-compliant?  I don't see it on modules.perl.org.
20:46 * grondilu meant modules.perl6.org
20:47 jnthn grondilu: It's build is, afaik, just a little too demanding for Panda at the moment.
20:48 grondilu ok, I'll wait
20:48 cognominal joined #perl6
20:49 jnthn grondilu: It's bundled in with the Rakudo Star monthlies.
20:49 jnthn I think tadzik++ mumbled something about custom build steps at some point, so at some point I hope it'll be Pandable
20:50 sjn \o
20:50 jnthn hi sjn
20:51 jnthn sjn: In Stockholm?
20:51 * sjn is at claes++'s apartment, laxing to music, preparing some trouble for tomorrow's NPW talk :)
20:51 sjn jnthn: yep, you?
20:52 jnthn laxing to music? sounds a bit fishy...
20:52 jnthn sjn: Yes, I'm here
20:52 jnthn In a hotel that should be 10ish minutes walk to the venue in the morning :)
20:52 * sjn is done laxing, and proceeds with his re-laxing.
20:52 jnthn .oO( hmm, that pun probably only works in Swedish... )
20:53 sjn jnthn: yes, it does. :)
20:53 diakopter haha
20:53 sjn you could say that was a red herring of a pun :)
20:53 felher joined #perl6
20:53 jnthn :D
20:53 sorear jnthn: lax=salmon in swedish?
20:54 sorear phenny: sv en "lax"?
20:54 phenny sorear: "salmon" (sv to en, translate.google.com)
20:54 jnthn sorear: yeah
20:54 * skids wonders how many words for salmon there are in finnish
20:54 sorear I saw Lachs on a menu in .de, so I was kinda prepared for that
20:55 colomon hmmm, origin of lox?
20:55 sorear two years or so ago I was in a USian restraunt and I saw a menu item, "FRIED LOX"
20:56 sorear to which I say to the group "Fried LOX?  I've heard of fried Kool-Aid, but this is just ridiculous"
20:56 felher joined #perl6
20:57 skids Sorry I didn't understand that.  I have a herring problem.
20:57 sorear LOX also means liquid oxygen...
20:58 jnthn Oh...
20:58 * jnthn didn't know that.
20:58 jnthn .oO( In California, would FRIED LAX mean the airport burnt down? )
20:58 dalek rakudo-debugger: 2a155b7 | jonathan++ | bin/perl6-debug.nqp:
20:58 dalek rakudo-debugger: Don't single-step sigspace.
20:58 dalek rakudo-debugger:
20:58 dalek rakudo-debugger: It feels like it adds negative value to the debugging experience.
20:58 dalek rakudo-debugger: review: https://github.com/jnthn/rakudo-debugger/commit/2a155b713b
20:59 _edwin http://rosettacode.org/wiki/CRC-32#Perl_6
20:59 _edwin NativeCall crc32 \o/
20:59 _edwin NativeCall crc32 \o/
20:59 cognominal joined #perl6
21:00 _edwin somewhat makes up for my superslow CRC-32 (sorry for double line)
21:00 cognominal joined #perl6
21:00 * flussence wonders if it's possible to access the linux kernel hash/crypto functions using NativeCall...
21:01 skids _edwin: You should admire how slow the native CRC implementations are in the Sum package :-)
21:01 skids I will be getting around to NCI interfaces soon I hope.
21:03 skids flussence: that I doubt, but openssl has quite a few hash functions and it is everywhere unix flavored these days.
21:04 erkan joined #perl6
21:04 erkan joined #perl6
21:04 _edwin skids, hm...just wanted to install Sum and got this: https://gist.github.com/3881510
21:05 skids Hrm... I'll have to try a panda install.  star09 is working for me.  What rakudo version?
21:07 flussence skids: right, I guess openssl knows how to pass through to the kernel stuff for hardware accel too...
21:07 _edwin This is perl6 version 2012.09.1-7-gfb11f13 built on parrot 4.4.0 revision RELEASE_4_4_0
21:08 skids flussence: if any library does, it would be openssl, I guess.  I'll probably and up writing ties to rhash and mhash as well.  Windows will require a different developer as I'm allergic to it.
21:08 skids Well, I'll try a panda install when I get home and see if I can figure out what's broken.
21:09 spider-mario joined #perl6
21:13 skids Hrm it is probably tripping up on the POD hooks for validating the manpage synopsis -- maybe it is stripping pod first.
21:13 * skids decommutes.
21:16 bbkr_ how can I bump module version in Star ?
21:21 cognominal joined #perl6
21:21 _edwin I really wonder how the J solution for CRC-32 works
21:22 sudokode joined #perl6
21:23 sorear _edwin: http://www.jsoftware.com/help/dictionary/dx128.htm#3
21:23 sorear 128!:3 is the standard library routine for CRCs
21:26 _edwin 128!:3 is a standard library call??? these guys are crazy :)
21:27 _edwin but thanks for explaining. i thought it was a combination of primitives and wondered how it could be so short
21:30 hoelzro hey guys, I wrote a blog post about building Rakudo * on Arch Linux: http://hoelz.ro/blog/building-rakudo-perl-6-for-arch-linux
21:30 hoelzro please let me know if I wrote anything incorrect!
21:31 sorear _edwin: a programming system with good native support for polynomials over GF(2) can do a CRC with some padding, a cast, a remainder, and a cast
21:31 sorear I thought J had native polynomails but looks like I'm wrong
21:31 sorear something like SAGE could probably do it
21:32 cognominal_ joined #perl6
21:32 _edwin true, but it still would need a bit of program text to turn a string into a polynomial
21:35 sorear , #: a. i. 'Hello World'
21:35 Rai_ joined #perl6
21:36 erkan joined #perl6
21:36 erkan joined #perl6
21:38 __sri i suppose everyone here has already read this awesome book, but just in case, the architecture of PyPy http://www.aosabook.org/en/pypy.html
21:40 dalek rakudo-debugger: 1462774 | jonathan++ | bin/perl6-debug.nqp:
21:40 dalek rakudo-debugger: Make m:P5/.../ regexes debuggable too.
21:40 dalek rakudo-debugger: review: https://github.com/jnthn/rakudo-debugger/commit/1462774ab1
21:41 PerlJam sri: I haven't read it (yet :-).  Thanks.
21:42 _edwin the paragraph about RPython makes it sound somewhat similar to NQP
21:43 __sri the chapters about GHC and LLVM are also pretty cool
21:44 __sri oh and the CLR chapter... actually... it's all great :)
21:46 wamba joined #perl6
21:54 rurban joined #perl6
22:08 rurban joined #perl6
22:08 jnthn sleep &
22:38 skids joined #perl6
22:42 fgomez joined #perl6
22:49 skids Hrm.  Are POD contents supposed to be in precompiled modules or not -- it seems there is the remnant of the pos structure, but contents are empty.
22:49 skids s/pos/pod/
22:54 zpmorgan left #perl6
23:09 Circlepuller_ joined #perl6
23:10 flussence skids: Pod blocks add a lot to parsing time, keeping them around would probably defeat the purpose of precompiling
23:10 tokuhiro_ joined #perl6
23:11 sorear ...huh?
23:11 sorear if you precompile, there is no parsing time.
23:22 flussence I see a giant base64'd binary thing in pir output and some chopped up pod strings in an array, maybe the binary holds all the info needed to reassemble the text on demand, I dunno.
23:33 Khisanth joined #perl6
23:48 MikeFair joined #perl6
23:53 armitage_ joined #perl6
23:54 armitage_ joined #perl6
23:54 armitage_ joined #perl6
23:56 armitage_ joined #perl6
23:58 armitage81 joined #perl6

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

Perl 6 | Reference Documentation | Rakudo