Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2013-03-23

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:02 timotimo n: say "perl".succ;
00:02 p6eval niecza v24-35-g5c06e28: OUTPUT«perm␤»
00:02 timotimo m)
00:06 colomon joined #perl6
00:08 fgomez joined #perl6
00:09 cognominal joined #perl6
00:12 fgomez joined #perl6
00:13 cognominal__ joined #perl6
00:26 timotimo r: say { foo => (1, 2, 3)>>.Str }
00:26 p6eval rakudo 221a95: OUTPUT«("foo" => $("1", "2", "3")).hash␤»
00:26 timotimo r: say { foo => @((1, 2, 3)>>.Str) }
00:26 p6eval rakudo 221a95: OUTPUT«("foo" => ("1", "2", "3").list.item).hash␤»
00:26 timotimo why does it turn it into an item always? is that right?
00:28 cognominal__ joined #perl6
00:30 timotimo r: say { foo => [1, 2, 3] }
00:30 p6eval rakudo 221a95: OUTPUT«("foo" => [1, 2, 3]).hash␤»
00:30 timotimo that's an Array, right?
00:31 timotimo r: say [1, 2, 3].WHAT
00:31 p6eval rakudo 221a95: OUTPUT«(Array)␤»
00:31 timotimo mhm.
00:33 orafu joined #perl6
00:41 timotimo r: my $name = "foo_a"; my %h = gather for ^5 { take $name => $_; $name .= succ; }; say %h.perl;
00:41 p6eval rakudo 221a95: OUTPUT«("foo_a" => 0, "foo_b" => 1, "foo_c" => 2, "foo_d" => 3, "foo_e" => 4).hash␤»
00:50 cognominal joined #perl6
00:54 timotimo how do i add a "handles" thing from source?
00:55 jnthn Calling trait_mod:<handles> is probably the easiest way
00:57 timotimo oh, so just $my_attribute handles <a b c> in the code?
00:57 timotimo why does it surprise me, that i can just write that outside a class, too?
00:59 jnthn No
00:59 timotimo hm, so do i set :has_accessor to 0?
00:59 jnthn You need to call it
00:59 timotimo ah, i'll actually call it. yeah, all right
00:59 jnthn triat_mod:<handles>($attr, <a b c>) or so
01:00 timotimo yup
01:02 timotimo hm, i still lack a way to name the sub-attributes
01:03 timotimo as in Tree = Branch Tree, Tree | Str  -  the names for both trees and the string
01:03 timotimo maybe it should become something like this
01:03 timotimo as in Tree = Branch Tree left, Tree right | Str cargo  -  the names for both trees and the string
01:06 dalek perl6-examples: 36c240e | (David Warring)++ | parsers/CSSGrammar.pm:
01:06 dalek perl6-examples: CSSGrammar tweak
01:06 dalek perl6-examples: review: https://github.com/perl6/perl​6-examples/commit/36c240e03f
01:06 cognominal joined #perl6
01:08 timotimo jnthn: interestingly the second argument of handles has to be a thunk that returns a list. curious.
01:21 timotimo now i have running code. only need to test if it actually does what i hope it does
01:25 timotimo jnthn: do i create Tree::Branch by assigning "Tree::Branch" to the name attribute of the new class or only by supplying Tree as the package?
01:25 cognominal joined #perl6
01:28 jnthn timotimo: The name you pass and where you install it are orthogonal.
01:28 jnthn timotimo: The package of Tree is accessible with Tree.WHO
01:28 timotimo oh, maybe that was my mistake
01:29 timotimo so even if i created $supertype with Metamodel::ClassHOW.new_type, i'll still have to give .WHO, yes?
01:29 jnthn Well, if you want something to appear as Tree::Branch you need Tree.WHO to have an entry Branch pointing to the right thing
01:30 jnthn It's nothing to do with inheritance.
01:30 timotimo yes, indeed
01:30 timotimo supertype is a misnomer, kind of
01:30 timotimo i should change that
01:32 timotimo i still get "symbol not found: Branch". i passed the Tree thing like my \Tree := create-thingy();
01:43 timotimo hm. now i have to figure out how to create a method.
01:44 timotimo oh, just create a sub and add_method it
01:44 cognominal joined #perl6
01:51 timotimo r: sub yoink($a, :$b) { say "$a $b"; }; sub pass-through(|$c) { yoink(|$c); }; pass-through(100, :b<foo>);
01:51 p6eval rakudo 221a95: OUTPUT«Obsolete use of | or \ with sigil on param $c␤100 foo␤»
01:51 timotimo r: sub yoink($a, :$b) { say "$a $b"; }; sub pass-through(|$c) { yoink(\$c); }; pass-through(100, :b<foo>);
01:51 p6eval rakudo 221a95: OUTPUT«Obsolete use of | or \ with sigil on param $c␤use of uninitialized value of type Any in string context  in sub yoink at /tmp/Wynulp1b1M:1␤␤100 b  foo ␤»
01:51 timotimo r: sub yoink($a, :$b) { say "$a $b"; }; sub pass-through(|$c) { yoink.invoke($c); }; pass-through(100, :b<foo>);
01:51 p6eval rakudo 221a95: OUTPUT«Obsolete use of | or \ with sigil on param $c␤===SORRY!===␤CHECK FAILED:␤Calling 'yoink' will never work with no arguments (lines 1, 1)␤    Expected: :($a, :b(:$b))␤»
01:52 timotimo r: sub yoink($a, :$b) { say "$a $b"; }; sub pass-through(\$c) { yoink.invoke($c); }; pass-through(100, :b<foo>);
01:52 p6eval rakudo 221a95: OUTPUT«Obsolete use of | or \ with sigil on param $c␤===SORRY!===␤CHECK FAILED:␤Calling 'yoink' will never work with no arguments (lines 1, 1)␤    Expected: :($a, :b(:$b))␤»
01:52 timotimo how do i capture? :|
01:52 jaldhar joined #perl6
01:53 timotimo r: sub yoink($a, :$b) { say "$a $b"; }; sub pass-through(\$c) { yoink(|$c); }; pass-through(100, :b<foo>);
01:54 p6eval rakudo 221a95: OUTPUT«Obsolete use of | or \ with sigil on param $c␤Unexpected named parameter 'b' passed␤  in sub pass-through at /tmp/hug0Fc6VP2:1␤  in block  at /tmp/hug0Fc6VP2:1␤␤»
01:55 timotimo r: sub yoink($a, :$b) { say "$a $b"; }; sub pass-through(|c) { yoink(|$c); }; pass-through(100, :b<foo>);
01:55 p6eval rakudo 221a95: OUTPUT«[31m===[0mSORRY!​[31m===[0m�Variable '$c' is not declared�at /tmp/o7cttsuY1M:1�------> [32m$b"; }; sub pass-through(|c) { yoink(|$c[33m�[31m); }; pass-through(100, :b<foo>);[0m�    expecting any of:�        postfix�»
01:55 timotimo r: sub yoink($a, :$b) { say "$a $b"; }; sub pass-through(|c) { yoink(|c); }; pass-through(100, :b<foo>);
01:55 p6eval rakudo 221a95: OUTPUT«100 foo␤»
01:55 timotimo aha!
01:57 timotimo Type check failed in assignment to '$.attr_c'; expected 'Str' but got 'Str'      >_>
02:07 timotimo hum. somehow the method doesn't get added for my handles
02:08 xinming joined #perl6
02:10 timotimo actually ... something else is wrong
02:10 timotimo jnthn: any intuitions what i might be doing wrong if i get Can not get attribute '$.leaf' declared in class 'Stash' with this object ?
02:11 timotimo r: https://gist.github.com/timo/838088f579a36520bc1f
02:11 p6eval rakudo 221a95: OUTPUT«[31m===[0mSORRY![31m===[0m�Two terms in a row�at /tmp/vW7fMtz5GM:1�------> [32mhttps[33m�[31m://gist.githu​b.com/timo/838088f579a36520[0m�    expecting any of:�        argument list�        postfix�        infix stopper�        infix or meta-infix�        st…
02:11 timotimo didn't that once work?
02:11 timotimo r: http://gist.github.com/timo/838088f579a36520bc1f
02:11 p6eval rakudo 221a95: OUTPUT«[31m===[0mSORRY![31m===[0m�Two terms in a row�at /tmp/NlCUvGxgh2:1�------> [32mhttp[33m�[31m://gist.githu​b.com/timo/838088f579a36520[0m�    expecting any of:�        argument list�        postfix�        infix stopper�        infix or meta-infix�        sta…
02:11 timotimo r: gist.github.com/timo/838088f579a36520bc1f
02:11 p6eval rakudo 221a95: OUTPUT«[31m===[0mSORRY![31m​===[0m�Confused�at /tmp/RmXAWRxo6g:1�------> [32mgist.github.com/timo/838088[33mÃ​¢ï¿½ï¿½[31mf579a36520bc1f[0m�    expecting any of:�        whitespace�»
02:11 timotimo i'm pretty sure the evalbot did that some time ago :(
02:12 cognominal joined #perl6
02:12 telex joined #perl6
02:14 timotimo oh, it may not work because it's a secret gist?
02:15 timotimo r: https://gist.github.com/timo/5226114
02:15 p6eval rakudo 221a95:  ( no output )
02:15 timotimo uh, that's not much better
02:17 FROGGS_ joined #perl6
02:27 timotimo i don't know why the attribute doesn't get added :(
02:29 jnthn "declared in class 'Stash'" sounds very weird
02:29 jnthn Are you passing a .WHO in place of a type object somewhere?
02:30 jnthn Like, in the constructor to Attribute perhaps
02:32 timotimo would you look at my newest code?
02:33 timotimo https://gist.github.com/timo/5226114 - just updated this with the newest thing
02:33 timotimo you'll notice that there's an uninitialized leaf where i print "the leaf is: $t.leaf()"
02:34 timotimo but i've already checked that in the generated constructor new-leaf in line 101 the bless is called with leaf => Leaf.new(...) properly and the Leaf.new also succeeds
02:34 timotimo so i'm guessing one of the accessors is wrong?
02:35 jnthn :package($type.HOW)
02:35 jnthn Don't think that wants to be .HOW
02:35 jnthn Just the type object, $type
02:35 timotimo oh?
02:35 jnthn :package($container-type.WHO)
02:35 jnthn And that one is wron gin the way I mentioned above ;)
02:36 jnthn Get rid of the .WHO
02:36 timotimo Cannot look up attributes in a type object now happens when i call $t.storage() after getting rid of the WHOs
02:37 timotimo also, .leaf is still undefined
02:38 jnthn You've probably got further
02:38 jnthn I don't see you ever doing .new on the types you create
02:39 jnthn .handles won't work out well if there's no instance to look up attributes in
02:39 timotimo oh, i thought i did
02:39 timotimo look at the generated new-$type.lc
02:39 timotimo in line 101 i do the .new
02:39 timotimo er, 103
02:39 timotimo it's well hidden :)
02:40 timotimo https://gist.github.com/masak/5213563 - i was trying to stick as close to this as possible
02:40 jnthn self.bless(*, $name.lc => $type.new(|c))
02:40 jnthn That will pass a single positional argument
02:41 jnthn Which is a Pair
02:41 timotimo so, why doesn't the new method explode horribly?
02:41 jnthn Try self.bless(*, |($name.lc => $type.new(|c)))
02:41 timotimo Type check failed in assignment to '$.leaf'; expected 'Leaf' but got 'Leaf'
02:41 timotimo that's excellent!
02:41 jnthn Because it's not an error to pass positionals to bless, they just don't do what you're after
02:41 timotimo it means that I got further!
02:42 timotimo fwiw, i get the same error when i remove the comment in line 68 so that the type of the attributes is correct, too.
02:43 timotimo the same kind of error
02:43 timotimo "expected A but got A"
02:44 timotimo i wonder if i can change rakudo so that expected A but got A would become more helpful
02:44 am0c joined #perl6
02:45 timotimo oh god i made it work!
02:45 timotimo i had to .WHAT for :type(...)
02:46 timotimo celebratory arm flailing ensues:
02:46 timotimo \o/
02:46 timotimo thanks for staying up late, jnthn :)
02:46 jnthn \o/
02:46 timotimo you are my hero
02:46 jnthn np :)
02:46 FROGGS__ joined #perl6
02:46 jnthn Well, this is nothing compared to what I gotta do tomorrow so... :)
02:46 timotimo heh, ok
02:47 timotimo care to give me any tips on how to create the subsets? i have already found out there's a SubsetHOW in the Metamodel. any caveats i'll have to look out for?
02:47 jnthn (Heading for some vacation, and managed to have a flight that departs at 23:40, then have a 5 hour layover along the way...)
02:48 jnthn SubsetHOW isn't terribly unusual, I don't think.
02:48 timotimo very cool.
02:48 timotimo and i'll make some proper test code.
02:48 jnthn method new_type(:$name = '<anon>', :$refinee!, :$refinement!) {
02:48 jnthn That pretty much tells it all.
02:49 jnthn refinee is the type you're refining, refinement is anything you can smartmatch against
02:50 jnthn The entire SubsetHOW is like 75 lines of code. :)
02:50 timotimo :)
02:51 timotimo oh, haha
02:51 timotimo i'm smart
02:51 timotimo of course i set :type("Int")
02:51 timotimo that doesn't make too much sense
02:52 jnthn No, types are most certainly not strings in Perl 6 ;)
02:52 lue r: my $z = "FOO"; my $PKG::($z)::BAR = 24; say $PKG::($z)::BAR; # should this work? (the top of S02/Names implies this, at least to me)
02:52 p6eval rakudo 221a95: OUTPUT«[31m===[0mSORRY![31m===[0m�Cannot declare a variable by indirect name (use a hash instead?)�at /tmp/LKl__YOCAW:1�------> [32mmy $z = "FOO"; my $PKG::($z)::BAR[33m�[31m = 24; say $PKG::($z)::BAR; # should thi[0m�»
02:54 jnthn OK, sleep time &
02:54 timotimo good night jnthn
02:54 timotimo and have a nice vacation :)
02:58 timotimo so, where do i post this example and get mad karma for it?
03:03 lue what example?
03:05 timotimo algebraic data types in perl6
03:08 timotimo oh, wha?
03:08 lue sounds interesting
03:09 timotimo r: say method { return 1 };
03:09 p6eval rakudo 221a95: OUTPUT«<anon>␤»
03:09 timotimo r: say(method { return 1 });
03:09 OuLouFu joined #perl6
03:09 p6eval rakudo 221a95: OUTPUT«<anon>␤»
03:10 timotimo r: Str.HOW.add_method(Str, 'foobar', method { for ^10 { when *>5 { return $_ } } });
03:10 p6eval rakudo 221a95:  ( no output )
03:10 timotimo i get "Attempt to return outside of any Routine" locally with my much more complicated code :(
03:10 lue r: say method foo { return 1 };
03:10 p6eval rakudo 221a95: OUTPUT«Useless declaration of a has-scoped method in mainline␤foo␤»
03:13 drbean joined #perl6
03:17 FROGGS joined #perl6
03:18 timotimo r: "foobar(".find("(")
03:18 p6eval rakudo 221a95: OUTPUT«No such method 'find' for invocant of type 'Str'␤  in block  at /tmp/5IG_uCsYDm:1␤␤»
03:18 timotimo r: "foobar(".index("(")
03:18 p6eval rakudo 221a95:  ( no output )
03:18 timotimo r: say "foobar(".index("(")
03:18 p6eval rakudo 221a95: OUTPUT«6␤»
03:19 timotimo r: say "foobar(123)"[^*.index("(")]
03:19 p6eval rakudo 221a95: OUTPUT«use of uninitialized variable $max of type Int in numeric context  in block  at /tmp/kGfFXkNgjO:1␤␤␤»
03:19 timotimo r: say "foobar(123)"[^"foobar(".index("(")]
03:19 p6eval rakudo 221a95: OUTPUT«Index out of range. Is: 1, should be in 0..0␤  in method gist at src/gen/CORE.setting:10610␤  in method gist at src/gen/CORE.setting:902␤  in method gist at src/gen/CORE.setting:5165␤  in method gist at src/gen/CORE.setting:902␤  in sub say at src/gen/CORE.setting:…
03:19 timotimo r: say "foobar(123)"[^("foobar(".index("("))]
03:19 p6eval rakudo 221a95: OUTPUT«Index out of range. Is: 1, should be in 0..0␤  in method gist at src/gen/CORE.setting:10610␤  in method gist at src/gen/CORE.setting:902␤  in method gist at src/gen/CORE.setting:5165␤  in method gist at src/gen/CORE.setting:902␤  in sub say at src/gen/CORE.setting:…
03:21 timotimo need to decommute now
03:40 preflex_ joined #perl6
04:07 drbean joined #perl6
04:07 wk_ joined #perl6
04:07 timotimo i need to create a better signature i see :|
04:08 timotimo r: sub yoink(|c) { say |c.^methods }; yoink(1, 2, 3); yoink(:foo, :bar);
04:08 p6eval rakudo 221a95: OUTPUT«BUILDat_keyat_poshashlistelemsCapture​FLATTENABLE_LISTFLATTENABLE_HASHpairsvalueske​yskvgistStrNumericperl␤BUILDat_keyat_poshas​hlistelemsCaptureFLATTENABLE_LISTFLATTENABLE_​HASHpairsvalueskeyskvgistStrNumericperl␤»
04:08 timotimo whoa
04:08 timotimo r: sub yoink(|c) { say |c.^methods.perl }; yoink(1, 2, 3);
04:08 p6eval rakudo 221a95: OUTPUT«(submethod BUILD(Capture : :list(:@list), :hash(:%hash), Mu *%_) { ... }, method at_key(Capture:D : $key is copy, Mu *%_) { ... }, method at_pos(Capture:D : $pos is copy, Mu *%_) { ... }, method hash(Capture:D : Mu *%_) { ... }, method list(Capture:D : Mu *%_) { ..…
04:09 timotimo oh, that's cute
04:13 timotimo i got positionals to work for the new-foo methods as well
04:14 timotimo now it'll be okay to construct a little example
04:14 timotimo i'll build the subtypes first,i think
04:25 thou_ joined #perl6
04:26 timotimo huh. i'm having trouble creating a subset...
04:27 timotimo r: Metamodel::SubsetHOW.new_type(:refinee(Str), :refinement({$^a.lc eq $^a}))
04:27 p6eval rakudo 221a95:  ( no output )
04:29 timotimo the error was in a place where i totally didn't expect it to be, interesting.
04:29 timotimo the error was in a place where i totally didn't expect it to be, interesting.
04:29 timotimo i think i'm getting too tired to properly operate this heavy machinery
04:35 dwoldrich joined #perl6
04:37 timotimo i guess i just need a bit of sleep.
04:43 timotimo turns out i just needed to move the subset creation after the composition of the refinee
06:34 SamuraiJack joined #perl6
06:43 SamuraiJack_ joined #perl6
06:49 drbean joined #perl6
06:53 FROGGS joined #perl6
06:55 cibs joined #perl6
06:57 drbean joined #perl6
07:06 Targen joined #perl6
07:13 raiph joined #perl6
07:33 rindolf joined #perl6
07:46 FROGGS joined #perl6
07:48 spider-mario joined #perl6
08:05 chinaXing joined #perl6
08:09 drbean joined #perl6
08:26 cognominal joined #perl6
08:29 rindolf joined #perl6
08:35 moritz good morning to everybody in the UGT :-)
08:42 labster good morning!
08:43 zby_home_ joined #perl6
08:51 sorear o/
08:56 Gothmog_ joined #perl6
08:56 Bucciarati joined #perl6
08:57 jfried joined #perl6
08:57 ilogger2 joined #perl6
09:03 thou joined #perl6
09:06 FROGGS joined #perl6
09:14 wk joined #perl6
09:29 domidumont joined #perl6
09:32 FROGGS joined #perl6
09:59 domidumont joined #perl6
10:17 masak good forenoon, #perl6
10:17 moritz \o masak
10:18 * moritz nags masak about t2 reviews
10:26 Chillance joined #perl6
10:33 masak today's plan: t2 reviews.
10:37 woosley joined #perl6
10:37 moritz \o/
10:53 spider-mario joined #perl6
11:09 snearch joined #perl6
11:10 cognominal joined #perl6
11:17 Rix joined #perl6
11:33 proller joined #perl6
11:38 FROGGS joined #perl6
11:43 pmurias joined #perl6
12:20 colomon joined #perl6
12:21 drbean joined #perl6
12:26 proller joined #perl6
12:33 SamuraiJack__ joined #perl6
12:57 PacoAir joined #perl6
13:02 cognominal \o *
13:02 cognominal looks like a pompom girl
13:04 cognominal rn: class A is Hash is Array {}; A.new.push: '\o *'
13:04 p6eval niecza v24-35-g5c06e28:  ( no output )
13:04 p6eval ..rakudo 221a95: OUTPUT«Trailing item in Hash.push  in block  at /tmp/eG9vGsAYo5:1␤␤»
13:06 cognominal Hash and Array both have a push method, should not the compiler complain when inheriting from both?
13:06 jnthn cognominal: No, it's roles that complain about conflicts, not multiple inheritance.
13:07 cognominal rn: class A is Array is Hash {}; A.new.push: '\o *'
13:07 p6eval rakudo 221a95, niecza v24-35-g5c06e28:  ( no output )
13:08 cognominal Ok it gets it from the first class inherited that has the method. Now if I want to call the method of the second class. How do I do?
13:09 cognominal rn: class A is Hash is Array {}; A.new.Arry.push: '\o *'
13:09 p6eval rakudo 221a95: OUTPUT«No such method 'Arry' for invocant of type 'Hash'␤  in block  at /tmp/CMJMeMtOCr:1␤␤»
13:09 p6eval ..niecza v24-35-g5c06e28: OUTPUT«Unhandled exception: Unable to resolve method Arry in type Hash␤  at /tmp/kAz81PC1V3 line 1 (mainline @ 6) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4299 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4300 (module-CORE @ 583) ␤  at /home/…
13:09 cognominal oops
13:09 cognominal rn: class A is Hash is Array {}; A.new.Array.push: '\o *'
13:09 p6eval rakudo 221a95:  ( no output )
13:09 p6eval ..niecza v24-35-g5c06e28: OUTPUT«Unhandled exception: Unable to resolve method Array in type Hash␤  at /tmp/2s_SeihQil line 1 (mainline @ 6) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4299 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4300 (module-CORE @ 583) ␤  at /home…
13:13 cognominal acking the tests with 'class.*is \w+ is \w+' to search hapinness
13:15 cognominal jnthn, any idea?
13:16 chinaXing joined #perl6
13:16 rindolf joined #perl6
13:16 moritz the problem is that in Rakudo, class Hash has a method 'push' directly
13:16 moritz but Array has the one inherited from List
13:17 moritz r: class A is Hash is Array { }; say A.^mro;
13:17 p6eval rakudo 221a95: OUTPUT«(A) (Hash) (EnumMap) (Array) (List) (Iterable) (Cool) (Any) (Mu)␤»
13:18 cognominal but is there a way to call the right method from a derived class?
13:19 SamuraiJack joined #perl6
13:19 jnthn sure, just qualify it
13:20 jnthn self.Hash::push
13:23 cognominal so I need to redefine all the derived methods with call to the right parent class to be safe.
13:23 moritz well, there is no unsafety
13:23 cognominal Should have a way, to say that en masse.
13:23 moritz the method resolution order is known at compile time
13:24 moritz cognominal: there might be better ways, for example with delegation
13:26 cognominal I think you gave me every bit of information to make it work. But that will be either brittle or ugly.
13:26 jnthn Welcome to inheritance ;)
13:27 cognominal ...very  un-perl 6
13:28 cognominal I know that multiple inheritance has always been a mess. I hoped Perl 6 had way to clean it. :(
13:28 jnthn cognominal: Yes, it's called roles... :)
13:28 jnthn cognominal: Or delegation. Which Perl 6 makes much easier by providing the "handles" trait
13:28 cognominal well, Hash and Array are classes
13:29 pmurias jnthn: QAST::Blocks in nqp are declared when they appear without being wrapped in a special opcode. They only have static lexical before they point where they are declared is reached. Right?
13:29 jnthn Sure, then you probably want to consider delegation.
13:29 pmurias jnthn: and static lexicals are set with setstaticlex?
13:30 cognominal …but C<handles> works on attributes
13:30 jnthn pmurias: The second bit is correct, I'm still trying to understand what you mean by the first.
13:30 rindolf joined #perl6
13:31 cognominal ...so instead of inheriting I will use explicit attributes
13:31 jnthn cognominal: That's how delegation works (as a general concept, not just in Perl 6), yes.
13:31 pmurias jnthn: sometimes QAST::Block nodes are part of the ast while being declared somewhere else?
13:31 masak wrapping+delegation > inheritance
13:31 jnthn pmurias: Their placement in the AST is what determines outer relationships.
13:32 jnthn masak: s/wrapping/composition/ ;)
13:32 jnthn pmurias: However that doesn't imply any kind of named installation
13:32 cognominal agreeing with mask and jnthn
13:33 pmurias jnthn: and is there a clear rule when the outer relationship is established?
13:33 cognominal now let's see if there is not any snag when dealing with postcircumfix operators
13:35 jnthn pmurias: There's both a static and dynamic angle to it. Whatever a QAST::Block turns into (some kinda coderef thing) has a link to the coderef statically outside of it.
13:36 jnthn pmurias: But closure handling means that each invocation produces some kinda call frame that has an outer pointing to an outer call frame. That is set at the point of invocation.
13:36 jnthn pmurias: In the case of a closure being invokved, that outer comes straight from the closure object itself.
13:40 arnsholt jnthn: Can you live with sixmodelobject.pmc's VTABLE_does looking like this: https://gist.github.com/arnsholt/5227768 ?
13:41 masak jnthn: yes, composition was what I was after.
13:42 masak jnthn: thought wrapping is a kind of composition, no? :)
13:44 proller_ joined #perl6
13:45 pmurias joined #perl6
13:45 dalek rakudo/tmp_highfive: 0206db8 | (Tobias Leich)++ | src/Perl6/P5 (2 files):
13:45 dalek rakudo/tmp_highfive: strip all occourances of colonpair
13:45 dalek rakudo/tmp_highfive: review: https://github.com/rakudo/rakudo/commit/0206db878b
13:47 jnthn arnsholt: Looks workable
13:47 * jnthn afk for a bit
13:50 lee_ joined #perl6
13:50 arnsholt Excellent!
13:52 cognominal jnthn++, masak++
13:53 arnsholt jnthn: Right, next problem. nqp::join (which delegates to Parrot's join, obv), expects VTABLE_get_string_keyed_int to work. Which we sort of decided we don't want to work :/
14:00 woosley left #perl6
14:00 woosley joined #perl6
14:00 census joined #perl6
14:07 am0c joined #perl6
14:15 cognominal joined #perl6
14:21 pmurias joined #perl6
14:23 proller_ joined #perl6
14:23 Psyche^ joined #perl6
14:25 bruges joined #perl6
14:33 timotimo masak: i made a lot of progress on the ADT module
14:39 masak ooh
14:40 * masak really hopes that means instrumenting the MOP to reduce boilerplate from the class-based gist he wrote
14:40 timotimo yes.
14:40 masak \o/
14:40 timotimo that's exactly what it means
14:40 masak that's... ossum.
14:40 timotimo opossum?
14:40 masak maybe even that.
14:40 masak do you have anything I could look at?
14:41 timotimo boy, do i ever! ;)
14:41 masak is it time to think of a follow-up email to Philippe?
14:41 masak \o/
14:41 timotimo when the EXPORT sub support is there, you will even be able to use the created classes and subtypes in definitions of multi methods
14:41 timotimo rather than being forced to make them using a given statement.
14:41 timotimo i think the current code is look-at-able
14:42 timotimo https://gist.github.com/timo/5226114 - look at the example at the bottom. this code works :)
14:42 * masak looks
14:44 masak nice.
14:44 masak timotimo++
14:44 timotimo :)
14:44 timotimo jnthn did all the hard bug-hunting for me
14:48 timotimo oh
14:48 timotimo why did i re-create the subsets down there? that doesn't make sense
14:49 timotimo oh, silly me, i was looking at *your* gist
14:50 timotimo masak: did you notice how .gist and .perl show Tree.new-foo for each of the parts? :D
14:51 masak no, I didn't run the thing.
14:51 masak is that good or bad?
14:51 eiro joined #perl6
14:52 timotimo i think it's good
14:52 timotimo Tree.new-branch(left => Tree.new-branch(left => Tree.new-leaf(storage => 1), [...]))
14:52 masak timotimo: # XXX remove this and we'll get an "attempt to return outside of any Routine" ... ?!
14:52 timotimo that's what it looks like when .gisted
14:52 masak timotimo: yes, you can't put a for loop last in a sub or method, unless you know what you're doing.
14:53 masak timotimo: it's one of our future FAQs :)
14:53 timotimo oh ... yeah, that's right m)
14:53 masak timotimo: anyway, good work.
14:53 * masak takes a walk in the nice weather
14:53 timotimo thanks :)
14:54 timotimo feel free to write that followup email some time soon
14:54 timotimo unless of course you notice something very bad that needs fixing first
14:55 masak oh, I meant that you could write it ;)
14:58 timotimo me? oh my.
14:58 timotimo i suppose i could do that.
14:59 kivutar joined #perl6
15:12 mls joined #perl6
15:22 moukeddar joined #perl6
15:23 dalek rakudo/tmp_highfive: 80e4d98 | (Tobias Leich)++ | src/Perl6/P5 (2 files):
15:23 dalek rakudo/tmp_highfive: make subroutines work
15:23 dalek rakudo/tmp_highfive: review: https://github.com/rakudo/rakudo/commit/80e4d98d76
15:23 moukeddar o/ #perl6
15:24 moukeddar anybody here?
15:25 moritz no, we're all bots
15:26 jnthn arnsholt: get_string_keyed_int can work, it's just that it expects to work on a list_s. That's fine; I added a sub join in NQP that does the cercive stuff so that nqp::join can expect this, and given stuff works on nqp-jvm I suspect most places are consistent with that now.
15:26 timotimo moukeddar: you came at a good time. we just made subroutines work in perl6!
15:27 timotimo maybe we'll get methods for classes working in the next week!
15:27 timotimo but rakudo is totally production ready! almost!
15:27 moukeddar i'm here for something other than perl6 if you allow
15:28 moritz if you're mostly talking about Perl 6, then sometimes being off-topic is OK
15:28 moritz only coming here for off-topic talk is not OK
15:29 timotimo in the #lojban channel it's "talk about lojban in any language or talk about anything in lojban", so if you talk about the other thing in syntactically valid and semantically sound perl6, i won't complain :P
15:29 moritz same here :-)
15:29 moukeddar it's more about architecure concerns
15:30 moritz that's probably ok
15:30 timotimo doesn't seem very far off-topic at first glance. i say go ahead
15:30 moukeddar architecture*
15:30 moukeddar it's from here that  i learned about DDD and CQRS
15:31 mtk joined #perl6
15:31 mls joined #perl6
15:31 chinaXing left #perl6
15:34 timotimo hm. how do i properly reply to a mail that is in the mailing list archives but not delivered to my mail client yet? :|
15:34 moukeddar i'm preparing my final year's project, and CQRS is just a tempting topic, but i need some ideas about problems or applications where CQRS is applicable ?
15:34 timotimo "get a proper mail client"? hehehe.
15:35 pmurias joined #perl6
15:35 pmurias FROGGS: ping
15:36 pmurias FROGGS: what do you think abouting moving the rakudo perl5 frontend into a module?
15:36 timotimo hm. if i understand CQRS correctly - and i haven't looked at it in detail yet - it'd be interesting if you have multiple user-groups that look at your data in different ways. one example may be a platform where students can sumbit solutions to assignments, tutors can grade them and professors can see stats for each student or something?
15:37 moukeddar timotimo: what a coincidence, i'm an intern at the ITS department of a university , sounds like a good idea
15:38 timotimo i don't know what the ITS department would be :|
15:38 timotimo internal teaching systems?
15:38 moritz timotimo: iirc the mailing list software from perl.org has a feature where you can request that it sends you an old email, so that you can reply to it
15:38 moukeddar so, it's all about data being queried by large groups of users
15:38 timotimo moritz: wow, that's clever. i'll go hunt for it
15:38 moukeddar Information technology services
15:38 timotimo now i'll just have to mention p6l and look at the irc log
15:38 timotimo ah, right.
15:38 arnsholt jnthn: True about list_s, but this is a slurpy arglist, with will be a list anyways I think. Do I have to care about bootstrappy stuff to use the join sub, or can I get away with just finding the lexical?
15:43 timotimo my system is not properly set up to launch my mail client from my web browser when a mailto: link or something similar is encountered >_<
15:44 timotimo i'll try to set up my mail client with the nntp instead
15:45 timotimo oh, whoops, "download all headers" didn't go over very well
15:46 timotimo now i crashed my mail client, too
15:50 masak moukeddar! \o/
15:51 moukeddar hey masak \m/
15:51 masak moukeddar: if you ask me, any topic looking at merging would be interesting. there is some prior art, but I bet it's easy to make headway too.
15:52 masak "given command B that is about to be rejected because command A already occurred, is there a way to 'merge' the intent of B into the effects of A such that the client doesn't have to merge manually and re-issue B'?"
15:53 arnsholt jnthn: Never mind that last comment. I can of course just nqp::list_s(|$other_list)
15:54 moukeddar masak: sounds like event sourcing would make it easier to do, no ?
15:56 masak yes, in the sense that the intent is preserved through the stored events.
15:56 masak there's bound to be an even (or a set of events) corresponding to command A.
15:56 masak we generally don't store commands for business logic.
15:57 moukeddar and that's what the event store is for, preserve the intents, so, events go in the log, the commands no ?
16:00 masak well, you're free to store your commands if you want. they're bound to contain vital business info.
16:01 FROGGS pmurias: well, it is a good idea but a lot of work too
16:01 masak but it's the events that determine the state the system is in.
16:02 dalek rakudo/tmp_highfive: 2d1a2cf | (Tobias Leich)++ | src/Perl6/World.pm:
16:02 dalek rakudo/tmp_highfive: v5 doesnt have colonpair
16:02 dalek rakudo/tmp_highfive: review: https://github.com/rakudo/rakudo/commit/2d1a2cfc9a
16:02 timotimo it seems i can just use the nntp functionality of my mail client to post to the newsgroup and it seems much more comfortable
16:02 FROGGS pmurias: because it uses much from Perl6::World, and and maybe much other stuff that would need duplication then
16:03 timotimo it must feel like magic to write a mail "will X be available in Y soon?" and get an implementation as the answer :3
16:03 moukeddar i understand now,but logging the commands could be useful to something
16:03 timotimo FROGGS: not sure if this is helpful, but have you seen how jnthn implemented Rakudo::Debugger?
16:03 FROGGS pmurias: and currently I want to see progress, and dont wanna wasting days by moving around code
16:04 FROGGS timotimo: I've seen his code months ago, yes
16:04 timotimo i was refering especially to how he derives from rakudo's internal data structures in a nqp part. maybe you can do it similarly once you decide to move around some code
16:05 FROGGS timotimo: well, I dunno if I can use it as a template, since I rely on some rakudo stuff, not only nqp...
16:06 FROGGS but ya, having an v5 module would be sweet (some day)
16:08 FROGGS I dont know why, but I must always think of a PHP module... :/
16:08 FROGGS must be pretty easy to do that
16:08 timotimo run PHP in perl6?
16:09 FROGGS ya
16:10 timotimo it's probably not easy to get the semantics to match bug-per-bug, though
16:20 crab2313 joined #perl6
16:25 pmurias FROGGS: we can import things from rakudo internals when running as a module.
16:26 pmurias FROGGS: the main reason I want to do that is to avoid recompiling the setting on every change to the Perl 5 grammar.
16:27 pmurias FROGGS: I'll take care of the move then
16:30 pmurias FROGGS: one problem is that rakudo ignores all version numbers so we either have to use 'use v5suffix' or patch rakudo
16:33 moritz it really shouldn't ignore all version numbers
16:34 moritz another hack would to upper-case it
16:34 moritz use V5; # :-)
16:39 spider-mario :D
16:39 spider-mario or make use <number> special
16:39 spider-mario use 5;
16:39 mangala joined #perl6
16:39 spider-mario but that’s ugly and does not allow for minor version numbers
16:42 TimToady or if it does, you re-introduce p5's use 5.016 confusion
16:43 TimToady we want to make different mistakes with p6
16:45 anocelot "use 5.016" was confusing?
16:46 TimToady what does 'use 5.16' mean then?
16:46 TimToady turns out to be the same as 'use 5.160'
16:46 TimToady and there ain't a v5.160 yet...
16:47 TimToady also, it limits to 1000 subversions arbitrarily, and we don't like arbitrary limits, supposedly...
16:47 timotimo will v5.160 be out before rakudo is production-ready? :P
16:47 TimToady so p6 requires the v on v5.16
16:48 TimToady so that it accidentally is not interpreted as a different kind of object
16:48 TimToady or however you say that in English...
16:48 anocelot use v5-0-16?
16:48 TimToady people like dots in versions
16:49 anocelot ...but it would be properly dash-ambiguated.
16:49 TimToady <whimper/>
16:49 anocelot Gomen nasai.
16:50 pmurias spider-mario: we could just make 'use v5' special
16:50 anocelot Or substitute something special for "use" for several years.  "abuse v5"
16:51 masak Perl -- the first language with the "abuse" keyword!
16:51 TimToady anocelot: I can tell you're gonna fit right in here...
16:51 masak people would nod and say "sounds about right" :P
16:52 timotimo "'abuse': the first abuse keyword in perl6 that's actually called 'abuse'"
16:52 timotimo "in perl history*"
17:00 anocelot Is it possible to just keep "use v5" and tell people "we mean version x of v5; don't expect perl6 to implement things broken in perl5 < y?"
17:01 timotimo i don't think we can point out an exact version of perl5 that's compatible
17:01 moritz I think we can point out exacty versions of Perl 5 we're incompatible with (all of them) :-)
17:01 moritz *exact
17:02 anocelot Hmm...  "abuse" could take other parmeters and act accordingly.  "abuse php" - warn "with pleasure\n";
17:02 diakopter p5eval: `php --version`
17:02 p5eval diakopter: ERROR: Insecure $ENV{PATH} while running with -T switch at (eval 7) line 1.
17:03 SamuraiJack_ joined #perl6
17:03 arnsholt Yay. Now I need to figure out the HLL config stuff =)
17:03 anocelot There are evalbots...  I mean, I expected Evilbots, but Evalbots.  Wow.
17:04 diakopter p5eval: $ENV{PATH} = '/bin:/usr/bin'; `php --version`
17:05 p5eval diakopter: interrupting, taking more than 5 second(s)
17:05 p5eval diakopter: No output
17:05 TimToady p5eval: use 5.16;
17:05 p5eval TimToady: ERROR: Perl v5.160.0 required (did you mean v5.16.0?)--this is only v5.16.3, stopped at (eval 7) line 1.BEGIN failed--compilation aborted at (eval 7) line 1.
17:05 diakopter p5eval: use 5.016; $ENV{PATH} = '/bin:/usr/bin'; say `php --version`
17:05 p5eval diakopter: interrupting, taking more than 5 second(s)
17:05 p5eval diakopter: No output
17:05 anocelot Enlightening.  (Which is far superior to being in lightning.)
17:06 diakopter p5eval: print 'alive'; use 5.016; $ENV{PATH} = '/bin:/usr/bin'; say `php --version`
17:06 p5eval diakopter: interrupting, taking more than 5 second(s)
17:06 p5eval diakopter: alive
17:07 diakopter p5eval: use 5.016; $ENV{PATH} = '/bin:/usr/bin'; print 'alive'; say `php --version`
17:07 p5eval diakopter: interrupting, taking more than 5 second(s)
17:07 p5eval diakopter: alive
17:07 arnsholt Oh, I'd already started that stuff ^_^
17:07 diakopter p5eval: use 5.016; $ENV{PATH} = '/bin:/usr/bin'; say `ls`
17:07 p5eval diakopter: interrupting, taking more than 5 second(s)
17:07 p5eval diakopter: No output
17:07 diakopter eh.
17:07 spider-mario p5eval: $ENV{PATH}='/bin:/usr/bin'; system 'php', '--version';
17:07 p5eval spider-mario: interrupting, taking more than 5 second(s)
17:07 p5eval spider-mario: No output
17:08 timotimo why can you even try to 'system' from p5eval?
17:08 spider-mario I don’t what is and what is not allowed by p5eval
17:08 diakopter p5eval: use 5.016; $ENV{PATH} = '/bin:/usr/bin'; fork or print 'alive'
17:08 p5eval diakopter: alive
17:08 diakopter p5eval: use 5.016; $ENV{PATH} = '/bin:/usr/bin'; fork and print 'alive'; #lolz
17:09 p5eval diakopter: No output
17:09 diakopter anocelot: p6eval is the super-fun one
17:10 anocelot p6eval: say it isn't so;
17:10 moritz p5eval: system "echo foo"
17:10 p5eval moritz: ERROR: Insecure $ENV{PATH} while running with -T switch at (eval 7) line 1.
17:10 moritz p5eval: $ENV{PATH} = '/bin:/usr/bin'; system "echo foo"
17:10 p5eval moritz: interrupting, taking more than 5 second(s)
17:10 p5eval moritz: No output
17:10 diakopter oh.. maybe $|++
17:10 TimToady p5eval: use 5.016; $ENV{PATH} = '/bin:/usr/bin'; fork and (fork or print "alive\n")
17:10 p5eval TimToady: No output
17:11 moritz p5eval: $ENV{PATH} = '/bin:/usr/bin'; system 'echo "foo\n"'
17:11 spider-mario p5eval: sub blah {my ($n) = @_; return unless $n > 0; print "hello\n"; fork or blah($n - 1);} blah(5)
17:11 p5eval moritz: interrupting, taking more than 5 second(s)
17:11 p5eval moritz: No output
17:11 p5eval spider-mario: hellohellohellohellohello
17:11 spider-mario yay, fork works
17:11 spider-mario or maybe not
17:11 timotimo p5eval system 'killall' 'p5eval irc bot binary'
17:11 diakopter ergh
17:11 spider-mario hm, I’m stupid
17:11 * anocelot is tempted to issue a fork while fork and test the proclimit...
17:12 spider-mario it doesn’t prove anything, why did I even think it would?
17:12 diakopter anocelot: you have to do   r:  n:  or p:  rakudo/niecza/pugs or most combinations of those work
17:12 spider-mario p5eval: sub blah {my ($n) = @_; return unless $n > 0; print "hello\n"; fork and blah($n - 1);} blah(5)
17:12 p5eval spider-mario: hello
17:12 spider-mario ok.
17:12 diakopter rnp: die die die
17:12 p6eval rakudo 221a95: OUTPUT«␤  in block  at /tmp/VWZ7U_67pq:1␤␤»
17:12 p6eval ..pugs: OUTPUT«*** Died␤    at /tmp/WlOJzOy74v line 1, column 1 - line 2, column 1␤»
17:12 p6eval ..niecza v24-35-g5c06e28: OUTPUT«Unhandled exception: Died␤  at /home/p6eval/niecza/lib/CORE.setting line 1504 (die @ 5) ␤  at /tmp/64zTxYrRXH line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4299 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4300 (module…
17:13 TimToady rakudo doesn't know it died :(
17:13 anocelot spooky
17:13 spider-mario p5eval: sub blah {my ($n) = @_; return unless $n > 0; print "hello\n"; defined(fork) and blah($n - 1);} blah(5)
17:13 p5eval spider-mario: hello
17:13 timotimo it will haunt this channel for ever :|
17:14 moritz TimToady: it's easy to give it a default message
17:14 diakopter rnp: try die try die try die try die try die try die
17:14 p6eval pugs: OUTPUT«*** Died␤    at /tmp/9mlQjlJRkH line 1, column 1 - line 2, column 1␤»
17:14 p6eval ..rakudo 221a95, niecza v24-35-g5c06e28:  ( no output )
17:14 timotimo moritz: can i ask you to help me refine the EXPORT_hash branch a bit more today?
17:14 TimToady 😒
17:14 timotimo actually, i'm not sure how much i can even contribute to that any more.
17:15 anocelot The fact that die causes a die implies this isn't an eval{}bot?
17:15 moritz timotimo: sure you can ask :-)
17:15 moritz anocelot: right, it's and eval '' bot :-)
17:15 diakopter anocelot: it is; it's invoked as a new process every time
17:16 moritz also eval in perl 6 doesn't even catch exceptions
17:17 moritz nr: eval '1 '
17:17 p6eval rakudo 221a95, niecza v24-35-g5c06e28:  ( no output )
17:17 moritz nr: eval '1 1'
17:17 p6eval niecza v24-35-g5c06e28: OUTPUT«Unhandled exception: Two terms in a row at (eval) line 1:�------> [32m1 [33m�[31m1[0m��  at /home/p6eval/niecza/boot/lib/CORE.setting line 1443 (die @ 5) �  at /home/p6eval/niecza/src/STD.pm6 line 5603 (STD.panic @ 85) �  at /home/p6eval/niecza/src/STD…
17:17 p6eval ..rakudo 221a95: OUTPUT«[31m===[0mSORRY![31m===[0m�Two terms in a row�at eval_0:1�------> [32m1 [33m�[31m1[0m�    expecting any of:�        postfix�        infix stopper�        infix or meta-infix�        statement end�        statement modifier�        statement modifier loop�»…
17:17 moritz nr: eval 'die "not caught"'
17:17 p6eval niecza v24-35-g5c06e28: OUTPUT«Unhandled exception: not caught␤  at /home/p6eval/niecza/lib/CORE.setting line 1504 (die @ 5) ␤  at (eval) line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3441 (eval @ 7) ␤  at /tmp/o8s3mhwH_g line 1 (mainline @ 3) ␤  at /home/p6eval/…
17:17 p6eval ..rakudo 221a95: OUTPUT«not caught␤  in block  at eval_0:1␤  in  at eval_0:1␤  in sub eval at src/gen/CORE.setting:602␤  in sub eval at src/gen/CORE.setting:593␤  in block  at /tmp/gOFL6Qoa_r:1␤␤»
17:18 timotimo moritz: blasted politeness. let's try this instead: "fix EXPORT_hash for me today, will ya!". see, not a question that's easily evaded any more!
17:19 diakopter p5eval: $ENV{PATH} = '/bin:/usr/bin'; system ";"
17:19 p5eval diakopter: interrupting, taking more than 5 second(s)
17:19 p5eval diakopter: No output
17:19 anocelot rn: if eval '1' say "yay!"
17:19 p6eval rakudo 221a95: OUTPUT«[31m===[0mSORRY![31m===[0m�Missing block�at /tmp/WNn8zV9DDE:1�------> [32mif eval '1' [33m�[31msay "yay!"[0m�    expecting any of:�        postfix�        infix stopper�        infix or meta-infix�        parameterized block�»
17:19 p6eval ..niecza v24-35-g5c06e28: OUTPUT«[31m===[0mSORRY![31​m===[0m��Missing block at /tmp/EI8MzUidfG line 1:�------> [32mif eval '1' [33m�[31msay "yay!"[0m��Parse failed��»
17:20 moritz timotimo: :-) will try
17:20 diakopter er
17:20 diakopter system ";"   <-- oops.
17:20 renormalist joined #perl6
17:21 diakopter p5eval: $ENV{PATH} = '/bin:/usr/bin'; print `;`
17:21 p5eval diakopter: interrupting, taking more than 5 second(s)
17:21 p5eval diakopter: No output
17:21 diakopter p5eval: $ENV{PATH} = ''; print `;`
17:21 p5eval diakopter: interrupting, taking more than 5 second(s)
17:21 p5eval diakopter: No output
17:21 geekosaur p5eval: $ENV{PATH} = '/bin:/usr/bin'; system ':'
17:21 p5eval geekosaur: interrupting, taking more than 5 second(s)
17:21 p5eval geekosaur: No output
17:21 wk joined #perl6
17:21 TimToady spam, spam, spam, spam...
17:22 diakopter p5eval: $ENV{PATH} = ''; print `dir /w`
17:22 p5eval diakopter: interrupting, taking more than 5 second(s)
17:22 p5eval diakopter: No output
17:22 dalek nqp-jvm-prep: e6ceeb3 | jnthn++ | src/org/perl6/nqp/sixmodel/Serialization (2 files):
17:22 dalek nqp-jvm-prep: Update for latest serialization changes.
17:22 dalek nqp-jvm-prep: review: https://github.com/jnthn/nqp​-jvm-prep/commit/e6ceeb3a95
17:23 timotimo moritz: i'm glad! if you need some grunt work done and you can describe it faster than you could implement it, i could do that :)
17:23 timotimo well, i could try at least
17:23 moritz timotimo: I'll probably need some input from jnthn++
17:23 moritz though there's a bit of stuff I want to try myself first
17:24 anocelot r: @nums=<1 2 3>; say "@nums.sort.join(,).";
17:24 p6eval rakudo 221a95: OUTPUT«[31m===[0mSORRY!​[31m===[0m�Variable '@nums' is not declared�at /tmp/gyLRBvyryZ:1�------> [32m@nums[33m�[31m=<1 2 3>; say "@nums.sort.join(,).";[0m�    expecting any of:�        postfix�»
17:24 timotimo missing my
17:24 anocelot r: my @nums=<1 2 3>; say "@nums.sort.join(,).";
17:24 p6eval rakudo 221a95: OUTPUT«[31m===[0mSORRY!​[31m===[0m�Preceding context expects a term, but found infix , instead�at /tmp/dYmRCTYEzj:1�------> [32mmy @nums=<1 2 3>; say "@nums.sort.join(,[33mâï¿​½ï¿½[31m).";[0m�»
17:25 moritz you need quotes around the ,
17:25 timotimo r: @nums=<1 2 3>; say "@nums[].sort().join(',').";
17:25 p6eval rakudo 221a95: OUTPUT«[31m===[0mSORRY!​[31m===[0m�Variable '@nums' is not declared�at /tmp/a0yuncPpwd:1�------> [32m@nums[33m�[31m=<1 2 3>; say "@nums[].sort().join(',').[0m�    expecting any of:�        postfix�»
17:25 timotimo r: my @nums=<1 2 3>; say "@nums[].sort().join(',').";
17:25 p6eval rakudo 221a95: OUTPUT«1,2,3.␤»
17:25 timotimo copied the wrong one m)
17:25 moritz r: my @nums=<1 2 3>; say "@nums[].sort().join(",").";
17:25 p6eval rakudo 221a95: OUTPUT«1,2,3.␤»
17:25 timotimo also, in order for arrays to be interpolated in strings you need a zen slice, too: []
17:25 moritz predictive parsing ftw
17:26 moritz or anything that ends in a postcircumfix
17:26 timotimo but not if it has dots in it, right?
17:26 timotimo r: my @nums=<1 2 3>; say "@nums.sort().join(",").";
17:26 p6eval rakudo 221a95: OUTPUT«1,2,3.␤»
17:26 timotimo oh, well i guess that's possible,t oo
17:26 moritz aye
17:26 thou joined #perl6
17:26 timotimo so i wouldn't even need the () for sort. that's cool.
17:26 anocelot Hmm...  I was looking at the "Useing perl 6" pdf and didn't see them there.
17:27 anocelot Ah.  Now I see what I did.  nvm.
17:31 anocelot So <a b c> is the replacement for qw/a b c/ ?
17:31 TimToady well, except that the latter still works
17:31 TimToady so more of a shortcut
17:31 anocelot Ah.
17:32 TimToady much as "" is short for qq//
17:32 anocelot That's handy if your data set includes lots of //////s.
17:32 TimToady :D
17:33 anocelot Use case: "We run a fence mending service and we track wither fences are straight |||||| or bent //////."
17:33 snearch joined #perl6
17:33 masak :)
17:34 masak anocelot: <a b 13> also has some magic handling of the '13', turning it into a number-string chimera.
17:34 TimToady you sure this "" feature isn't just bloat?
17:34 masak rn: my @a = <a b 13>; say @a[*-1].^name
17:34 p6eval rakudo 221a95: OUTPUT«Str␤»
17:34 p6eval ..niecza v24-35-g5c06e28: OUTPUT«IntStr␤»
17:34 masak Niecza has it.
17:35 anocelot r: my $val=2; say $val++**3;
17:35 p6eval rakudo 221a95: OUTPUT«8␤»
17:35 TimToady nr: say <1/2>.WHAT
17:35 p6eval niecza v24-35-g5c06e28: OUTPUT«(Rat)␤»
17:35 p6eval ..rakudo 221a95: OUTPUT«(Str)␤»
17:35 TimToady ooh, rakudo doesn't even have that yet
17:35 anocelot r: my $val=2; say ++$val**3;
17:35 p6eval rakudo 221a95: OUTPUT«27␤»
17:36 * anocelot tries to understand the precidence handling there.
17:36 * jnthn grumbles about IntStr and the existence of MI in something in CORE
17:37 anocelot if ++ binds tighter than **, I (incorrectly) intuited they would be the same.
17:38 anocelot r: my $val=2; say ($val++)**3;
17:38 p6eval rakudo 221a95: OUTPUT«8␤»
17:38 TimToady r: my $val=2; $val++; say $val**3
17:38 p6eval rakudo 221a95: OUTPUT«27␤»
17:39 TimToady postincrement, is, well, post
17:39 pmichaud $TimToady.words.join(', ')
17:39 moritz r: my $v = 5; say ++$v**2
17:39 p6eval rakudo 221a95: OUTPUT«36␤»
17:39 moritz seems that prefix ++ binds tighter than infix **
17:39 TimToady it's supposed to, by S03
17:39 moritz which makes sense, because prefix ++ couldn't work on the result of a **
17:40 pmichaud both prefix:<++> and postfix:<++> bind tighter than infix:<**>
17:41 cognominal joined #perl6
17:41 anocelot So what does it mean that autoincrement has a higher precedence than ** in the Precedence table in the p6 book?  (Sorry if I seem dense about this!)
17:41 moritz r: my $v = 5; say ++$v**2
17:41 p6eval rakudo 221a95: OUTPUT«36␤»
17:42 moritz anocelot: the ++ happens first, then the ** works on the result of it
17:42 pmichaud both prefix:<++> and postfix:<++>  (autoincrement) have higher precedence (bind tighter) than infix:<**>  (exponentiation)
17:42 moritz that's why the result is 36
17:42 moritz and not
17:42 moritz r: say ++($v ** 2)
17:42 p6eval rakudo 221a95: OUTPUT«[31m===[0mSORRY!​[31m===[0m�Variable '$v' is not declared�at /tmp/VtRHPde3b8:1�------> [32msay ++($v[33m�[31m ** 2)[0m�    expecting any of:�        postfix�»
17:42 pmichaud note that the result of  $x++ is the value of $x before it's postincremented
17:42 * TimToady never uses the terms "higher" or "lower" wrt precedence
17:42 moritz r: smy $v = 5; ay ++($v ** 2)
17:42 p6eval rakudo 221a95: OUTPUT«[31m===[0mSORRY!​[31m===[0m�Variable '$v' is not declared�at /tmp/3LOtuqNsV0:1�------> [32msmy $v[33m�[31m = 5; ay ++($v ** 2)[0m�    expecting any of:�        postfix�»
17:42 moritz r: my $v = 5; say ++($v ** 2)
17:42 TimToady since have the precedence tables in the world are printed upside-down
17:42 p6eval rakudo 221a95: OUTPUT«Cannot modify an immutable value␤  in sub prefix:<++> at src/gen/CORE.setting:3183␤  in sub prefix:<++> at src/gen/CORE.setting:1673␤  in block  at /tmp/GycN2P2hdr:1␤␤»
17:42 pmichaud TimToady: +1
17:42 TimToady *half
17:43 pmichaud r:  my $x = 5;  say $x++;  say $x;
17:43 p6eval rakudo 221a95: OUTPUT«5␤6␤»
17:45 anocelot Oh I get that.  I'm wondering why ($val++**2) != (++$val**2).  On the table I saw, ++ was between () and **.  I figured both $val++ and ++$val would happen before **.  But when I did the ($val++) I realized that I was backward in my assumption.
17:45 anocelot So maybe...
17:46 pmichaud $val++ does happen before **.  But the result of $val++ (passed to **) is the value of $val before it's incremented.
17:46 cognominal back and still have a problem defining a .[]  :  https://gist.github.com/cognominal/5228672
17:47 anocelot Right.  It's the pre vs post (what I expect from p5).  I think timtoady is right that I was reading the table upside down.
17:47 moritz cognominal: you probably just want let @!kids handle at_pos too
17:47 moritz cognominal: the default postcircumfix:<[ ]> calls at_pos for each element
17:47 anocelot (Which, of course, makes the blood rush to ones head and makes it hard to think clearly anyway.)
17:47 cognominal ok, got it. I had a stray "sum"
17:47 cognominal * "sym"
17:48 cognominal I originally pasted it from Grammar.pm, this explains it.
17:48 pmichaud cognominal:  overriding postcircumfix:<[ ]>  is only if you want to redefine the slicing and other default behaviors of .[]
17:49 pmichaud (which can be quite a lot)
17:49 pmichaud afk
17:50 cognominal now it returns Any but at least it is called.
17:51 moritz cognominal: does it works with   @kids handles <at_pos> ?
17:52 moritz sorry,  has @!kids handles <... at_pos>;
17:52 cognominal moriz, not tried yet
17:53 moritz you should. It's likely the simplest solution
17:53 timotimo what are the implications of the right side of handles being aclosures?
17:53 kaare_ joined #perl6
17:53 cognominal moritz: same result
17:53 timotimo or at least it seems that way from how trait mood handles works
17:54 moritz cognominal: maybe @!kids is empty?
17:54 pmurias what can be causing http://pastie.org/7092377?
17:54 moritz timotimo: I don't think closures are allowed
17:54 moritz or make sense
17:54 pmurias after I add 'use Perl6::Grammar;' to a source file
17:55 cognominal moritz: no .elems says I got 2 elements
17:55 timotimo okay. must have been confused by the raw function then
17:56 timotimo because that takes a block that returns a list.
17:56 moritz pmurias: are you adding it to Perl 6 or to an NQP file?
17:56 pmurias nqp file
17:57 pmurias it works for some files
17:57 pmurias when I add it to Perl6::P5Grammar I get that error
17:57 cognominal I get the same result with rakudo* of February, modulo the spelling of (Any)
17:58 moritz cognominal: it's somehow related to the .delete
17:59 moritz cognominal: if I do  has @!kids handles <shift unshift push pop elems at_pos>;
17:59 moritz remove the custom postcircumfix method
17:59 moritz and then do
17:59 moritz my $d = DOM.new;
17:59 moritz $d.push: 'hi!';
17:59 moritz $d.push: 'bye!';
17:59 moritz say $d[0];
17:59 moritz it works fine
17:59 moritz and slices work too
17:59 cognominal indeed, moritz++
17:59 moritz cognominal: I guess .delete(0) simply sets the element 0 to Any
18:00 moritz which is why you get an Any returned
18:00 moritz if you really want to remove the index, and not just undefine the elements, you need to call splice
18:00 cognominal indeed!
18:01 cognominal so I was barking at the wrong tree.
18:01 arnsholt Anyone happen to know if I'm allowed to use return in Parrot ops?
18:02 moritz arnsholt: iirc you are. But you have to assign to $0 to return something from them
18:02 moritz ie they all have return type void
18:02 arnsholt Yeah, I can live with that =)
18:02 moritz and return values is through out and in-out params
18:03 arnsholt Yeah, it's a bit odd
18:03 moritz in the end, a parrot op is just a C function that adhers to a certain API
18:03 cognominal with Perl 6, a DOM interface will not be a nightmare anymore :)
18:03 arnsholt But not having to fall off the end of the function saves me some branching
18:03 moritz it's perfectly understandble if you don't want to use C stack too much
18:03 moritz after all a VM wants to maintain its own stack (or heap)
18:05 arnsholt True, true
18:05 arnsholt And parrot is register-based, not stack-based
18:09 anocelot Oout of curiosity, does delete on a hash elem still remove the key/value pair?
18:10 anocelot s/Oout/out/
18:11 moritz anocelot: yes
18:11 cognominal r: %a = 'a'..'f'; say %a.perl; %a.delete('c'); say %a.perl
18:11 p6eval rakudo 221a95: OUTPUT«[31m===[0mSORRY!​[31m===[0m�Variable '%a' is not declared�at /tmp/tOqdxgFg7v:1�------> [32m%a[33m�[31m = 'a'..'f'; say %a.perl; %a.delete('c')[0m�    expecting any of:�        postfix�»
18:11 anocelot (BTW: Did you know the skype chat client will apply s/x/y/ on the prevous line?)
18:11 cognominal oops
18:11 cognominal r: my %a = 'a'..'f'; say %a.perl; %a.delete('c'); say %a.perl
18:11 p6eval rakudo 221a95: OUTPUT«("a" => "b", "c" => "d", "e" => "f").hash␤("a" => "b", "e" => "f").hash␤»
18:11 pmurias nqp only supports single inheritance?
18:12 diakopter anocelot: does it also send the s/// text? in case the recipient doesn't notice the change?
18:12 anocelot diakopter: I don't believe so.
18:13 anocelot diakopter: @quietfanatic and I discovered it quite by accident one day.  It was as close to a squee moment as I've seen for him.
18:13 diakopter mwahaha
18:14 masak wow. TIL.
18:15 anocelot I vaguely recall reading on perlmonks that delete() on an array element removed from p5 at one point?  I'm curious why the default behavior in 6 is to zero out the element.  Is it a performance issue?
18:16 tadzik woow
18:16 moritz anocelot: iirc it only removes the elements when they are at the end of the array
18:16 moritz p5eval: my @a = (1, 2, 3); delete $a[1]; \@a
18:16 p5eval moritz: [1,undef,3]
18:16 moritz see? not removed
18:16 moritz p5eval: my @a = (1, 2, 3); delete $a[2]; \@a
18:16 p5eval moritz: [1,2]
18:16 moritz removed.
18:16 moritz p5eval: my @a = (1, 2, 3); delete $a[0]; \@a
18:16 p5eval moritz: [undef,2,3]
18:17 PacoAir joined #perl6
18:17 anocelot OH!  After some digging I think I found the article I saw which says, "but this is being depreicated after 15" which is not the same at all.  >.<
18:17 timotimo r: my $str = "Tree.new(foo, bar)"; $str.substr(0, "Tree".chars + 4) = "foobarbazquux"; say $str;
18:17 p6eval rakudo 221a95: OUTPUT«Cannot modify an immutable value␤  in block  at /tmp/N8klWDrSRo:1␤␤»
18:18 anocelot s/15/12/ (cause I can't type)
18:18 timotimo how best to change the text up to the first ( to something else?
18:18 moritz r: my $str = "Tree.new(foo, bar)"; $str.substr-rw(0, "Tree".chars + 4) = "foobarbazquux"; say $str;
18:18 p6eval rakudo 221a95: OUTPUT«No such method 'substr-rw' for invocant of type 'Str'␤  in block  at /tmp/9UjxShpMEi:1␤␤»
18:18 timotimo https://gist.github.com/tim​o/5226114#file-adt-pm6-L125 - what i'd like to make prettier
18:18 moritz oh, it only exists as a sub
18:19 timotimo r: my $str = "Tree.new(foo, bar)"; substr-rw($str, 0, "Tree".chars + 4) = "foobarbazquux"; say $str
18:19 p6eval rakudo 221a95: OUTPUT«foobarbazquux(foo, bar)␤»
18:19 timotimo ah, neat.
18:20 moritz we could spec a four-argument version of substr
18:20 moritz substr($orig, $from, $chars, $replacement)
18:20 rindolf joined #perl6
18:21 moritz and that simply returns a new string with the substr replaced by $replacement
18:21 timotimo mhm.
18:21 timotimo i'd like that in this case
18:21 moritz instead of doing the replacement in-place, as p5 does
18:22 anocelot mortiz: It occurs to me that if delete spliced you'd fubar the elem pos for the rest of the array.  That's dangerous.  Requiring explicit splice makes more sense.
18:24 moritz anocelot: most IRC clients allow you to tab-complete nick names after you entered the first few characters. Which saves you from mis-spelling my nick :-)
18:24 timotimo r: my @a = <1 2 3 4>; delete @a[2]; my @b = @a; say @b; say @a;
18:24 p6eval rakudo 221a95: OUTPUT«[31m===[0mSORRY![​31m===[0m�Undeclared routine:�    delete used at line 1��»
18:24 timotimo r: my @a = <1 2 3 4>; @a[2].delete; my @b = @a; say @b; say @a;
18:24 p6eval rakudo 221a95: OUTPUT«No such method 'delete' for invocant of type 'Str'␤  in block  at /tmp/1dqSxtSCdf:1␤␤»
18:24 timotimo r: my @a = <1 2 3 4>; @a[2] :delete; my @b = @a; say @b; say @a;
18:24 p6eval rakudo 221a95: OUTPUT«1 2 3 4␤1 2 3 4␤»
18:24 timotimo r: my @a = <1 2 3 4>; @a[2] :delete; my @b = @a; say @b.perl; say @a.perl;
18:24 p6eval rakudo 221a95: OUTPUT«Array.new("1", "2", "3", "4")␤Array.new("1", "2", "3", "4")␤»
18:24 timotimo that didn't work :|
18:26 dalek v5: 21809ea | (Pawel Murias)++ | / (8 files):
18:26 dalek v5: Initial proof of concept. Currently using 'use perl5' till we patch rakudo to support use v5 as a module.
18:26 dalek v5: review: https://github.com/rakudo-p5/v5/commit/21809ea21a
18:26 pmurias FROGGS: ^^
18:29 rindolf Hi moritz , timotimo , pmurias
18:29 rindolf left #perl6
18:29 rindolf joined #perl6
18:29 rindolf Hi moritz , timotimo , pmurias . What's up?
18:30 timotimo what are some techniques to get better error reporting for grammars that one writes oneself?
18:30 timotimo hey rindolf
18:30 timotimo https://gist.github.com/timo/5226114 - algebraic datatypes from haskell-style definitions for perl6 :)
18:31 pmurias rindolf: hi
18:34 arnsholt jnthn: Aww. Using Double.parseDouble is cheating =p
18:34 moritz timotimo: basically you define your own .panic method which derives the line number from looking at $/.prematch and counting the newline characters in there
18:34 * arnsholt goes digging to see if Parrot has something useful
18:34 anocelot moritz: It could be worse.  I could 'of accidentally used an @ prefix.  XD
18:35 masak hi rindolf.
18:35 timotimo moritz: i expect all the definitions to be one-liners, though :|
18:36 tadzik pmurias: isn't this lacking 'perl5.pm'?
18:36 rindolf masak: hi, sup?
18:36 moritz anocelot: no worries :-)
18:36 pmurias it's compiling v6.pm into perl5.pbc
18:36 tadzik ah
18:37 masak rindolf: I see what you did there. :) s'fine :)
18:37 tadzik * v5, I guess
18:37 rindolf http://www.shlomifish.org/eno​ugh-with-sec/2013-03-23.html - I'd appreciate if you can go over this for correctness. I can credit you and/or a Perl 6 resource.
18:37 masak rindolf: but that resource doesn't have anything to do with Perl 6 :/
18:38 rindolf masak: but I can give a link there to it.
18:38 pmurias tadzik: yes
18:38 masak rindolf: you're missing the point.
18:38 rindolf masak: ah, OK.
18:38 masak rindolf: it would have been on-topic if this were the #rindolf channel.
18:39 rindolf masak: OK, sorry.
18:39 masak no prob.
18:40 diakopter masak: but it mentions Jennifer Lawrence..
18:41 masak oh, I missed that.
18:42 masak Jennifer Lawrence is a prefix operator in Perl 6.
18:42 diakopter your mom is a sink operator
18:42 masak yeah, then I see the connection.
18:42 dalek v5: 166db91 | (Pawel Murias)++ | / (2 files):
18:42 dalek v5: Document some hacks.
18:42 dalek v5: review: https://github.com/rakudo-p5/v5/commit/166db91f9c
18:44 pmurias rindolf: you expect us to check if you summarized the updates to your homepage correctly?
18:46 rindolf pmurias: you don't have to if you don't want to.
18:46 rindolf pmurias: I said "please".
18:46 rindolf pmurias: I want it checked for grammar/syntax/spelling mistakes.
18:46 masak rindolf: we generally don't have trouble with off-topic talk here. but that's from people who contribute daily with on-topic stuff.
18:47 masak rindolf: if you just come in here occasionally, asking "could you please proof this page on my homepage" comes off... odd.
18:47 masak sayinig "please" makes it come off... odd but polite.
18:47 rindolf masak: OK, sorry.
18:48 rindolf masak: let's drop this conversation.
18:48 rindolf I got the memo.
18:48 rindolf masak: so, sup?
18:48 masak sure. I was explaining clearly as an investment for the future ;)
18:48 masak rindolf: re "sup", I'm (as usual) not sure what to respond. it's Saturday. I feel relaxed.
18:48 masak :)
18:50 diakopter masak: [as I'm sure you're aware] the traditional [white lie] response is "not[hing] much".. but programmers don't like to say that unless in person, I've found...
18:50 masak diakopter: oh, that captures it exactly.
18:51 masak diakopter: I don't think I've even met rindolf at a conf, actually.
18:51 masak also "not much" feels like a weird conversation in a channel where people collect to, you know, do something. work towards a common goal.
18:52 diakopter "yeah, around here, we don't do much"
18:52 rindolf masak: I've only gone to conferences in Israel.
18:53 masak ah. and I haven't.
18:53 masak what do people think about the Order::None suggestion in https://rt.perl.org/rt3/Tic​ket/Display.html?id=117307 ?
18:53 cognominal joined #perl6
18:53 masak more specifically, what effects would that have on &sort, for example?
18:54 * jnthn is heading off for a week of mostly-offline vacation. Maybe I'll drop by at some point...leave anything important in privmsg or just ask when I'm back/about. :)
18:54 diakopter have a nice trip!
18:54 jnthn o/
18:54 jnthn Thanks!
18:54 * masak is heading out to have a beer with jnthn before he leaves :)
18:56 arnsholt Have fun jnthn!
18:56 * masak .oO( -Ojnthn )
18:57 diakopter masak: also, it could be that no one likes to say it unless in person..
18:57 diakopter and I've only noticed it from programmers
18:58 masak it does feel like an atmospheric greeting, yes. not an IRC one.
18:58 labster joined #perl6
19:00 labster good morning, #perl6
19:01 masak o/
19:01 labster \o
19:03 dalek ecosystem: bb08901 | (Brent Laabs)++ | META.list:
19:03 dalek ecosystem: Adding IO::Path::More
19:03 dalek ecosystem: Extends IO::Path to be more like P5's Path::Class, using File::Spec for cross-platform support
19:03 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/bb0890161b
19:06 pmurias FROGGS: have you seen the way I moved the perl5 frontend into a module?
19:14 mikess joined #perl6
19:31 SamuraiJack__ joined #perl6
19:56 timotimo can i create a signature programmatically and assign it to a method i created?
19:57 pmurias timotimo: you want to change the signature of an existing method?
19:57 timotimo if i have to, i'll create the method first
19:57 timotimo but if possible, i'd want to create the signature first
19:58 pmurias you want to do that using QAST?
19:58 timotimo i know i can inspect them, but i don't know how to assign them
19:58 timotimo i'd prefer to use the metamodel to do it
19:58 timotimo this is in perl6 code
19:58 timotimo not in nqp
19:59 pmurias isn't it possible to use QAST form perl6?
19:59 timotimo dunno.
19:59 timotimo r: say QAST::Stmt;
19:59 p6eval rakudo 221a95: OUTPUT«Could not find symbol '&Stmt'␤  in method <anon> at src/gen/CORE.setting:10615␤  in  at src/gen/Metamodel.pm:2501␤  in any find_method_fallback at src/gen/Metamodel.pm:2489␤  in any find_method at src/gen/Metamodel.pm:937␤  in block  at /tmp/lj5T4g7kPX:1␤␤»…
19:59 timotimo r: say QAST::Var;
19:59 p6eval rakudo 221a95: OUTPUT«Could not find symbol '&Var'␤  in method <anon> at src/gen/CORE.setting:10615␤  in  at src/gen/Metamodel.pm:2501␤  in any find_method_fallback at src/gen/Metamodel.pm:2489␤  in any find_method at src/gen/Metamodel.pm:937␤  in block  at /tmp/kuI7AIECsm:1␤␤»…
19:59 timotimo r: use QAST; say QAST::Var;
20:00 p6eval rakudo 221a95: OUTPUT«===SORRY!===␤Could not find QAST in any of: /home/p6eval/nom-inst/lib/parrot/4.1​0.0-devel/languages/perl6/site/lib, /home/p6eval/nom-inst/lib/parrot/4.10​.0-devel/languages/perl6/vendor/lib, /home/p6eval/nom-inst/lib/parrot/​4.10.0-devel/languages/perl6/lib, /home/p6…
20:00 arnsholt You'll probably have to rely on a lot (pretty much all) nqp:ops I think
20:00 arnsholt QAST is implemented in NQP, not Perl 6
20:00 timotimo if it's not doable sensibly, i'll stick to this approach: https://gist.github.com/tim​o/5226114#file-adt-pm6-L107
20:00 FROGGS pmurias: this does work??
20:01 pmurias FROGGS: on my machine yes
20:01 arnsholt But given what you want, you don't really want QAST I think
20:02 FROGGS pmurias: wow
20:02 pmurias FROGGS: using 'use perl5' as rakudo ignores 'use v5'
20:02 arnsholt I should be possible to twiddle the signatures of things run-time though. You might find something useful if you look in the Rakudo sources
20:02 FROGGS pmurias: that's okay for now
20:02 arnsholt IIRC src/Metamodel (or is it src/Perl6/Metamodel? Can't remember) does that kind of thing
20:03 pmurias FROGGS: if you type the commands in the README.md you can check if it works on your box
20:04 FROGGS pmurias: currently trying
20:04 timotimo src/core/Signature.pm doesn't seem to have a new method
20:04 timotimo which is why i asked here
20:04 timotimo i'll have a look at Actions, i guess
20:05 timotimo but it may not be possible. if i use variables inside the method before i set the signature, i'll get lots of "undefined" errors
20:05 timotimo and i don't see a syntactical way to assign a signature to a method as i'm creating it
20:05 pmurias there's eval
20:06 pmurias generating code seems the only sensible way
20:06 moritz timotimo: it's not so easy, since signatures also declare the parameters as variables to the block of the method
20:08 timotimo oh, eval, of course :)
20:08 timotimo that's half-way clean, even.
20:08 timotimo but for the rest of the code i'll still rely on the metamodel, i think
20:08 timotimo it feels less icky to me
20:12 timotimo is :dba or something implemented in rakudo?
20:12 moritz it is in nqp
20:13 moritz r: say '(ab' ~~ /'(' ~ ')' \w+/
20:13 p6eval rakudo 221a95: OUTPUT«Unable to parse expression in ; couldn't find final ')'␤  in any FAILGOAL at src/stage2/QRegex.nqp:1084␤  in regex  at /tmp/_FfEKUoAX_:1␤  in method ACCEPTS at src/gen/CORE.setting:10957␤  in method ACCEPTS at src/gen/CORE.setting:683␤  in block  at /tmp/_FfEKUoAX_…
20:13 moritz r: say '(ab' ~~ /:dba("foo") '(' ~ ')' \w+/
20:13 p6eval rakudo 221a95: OUTPUT«#<failed match>␤»
20:13 moritz but not in rakudo :(
20:15 FROGGS pmurias: I have to use rakudo's nom branch?
20:18 pmurias FROGGS: hmm, not sure I only tested it with the nom one
20:18 pmurias FROGGS: are there any problems with the highfive one?
20:19 moritz jnthn: ping
20:19 FROGGS pmurias++
20:20 FROGGS does work here too :o)
20:20 FROGGS pmurias: I got 'missing or wrong version og src/Perl6/P5Actions.pm'
20:20 FROGGS of*
20:20 FROGGS but using nom works
20:20 timotimo moritz: so i can find the implementation of :dba in nqp/src ... how many changes would i have to make to it to make it work in rakudo as well? i'm assuming a straight copy-paste won't work well?
20:20 moritz timotimo: I have no idea
20:21 timotimo i'll just see what it looks like then
20:24 pmurias FROGGS: so do we migrate to the rakudo-p5/v5 repo?
20:25 dalek v5: 901afde | (Tobias Leich)++ | Makefile:
20:25 dalek v5: added stagestats so we see something while we wait
20:25 dalek v5: review: https://github.com/rakudo-p5/v5/commit/901afde347
20:25 FROGGS pmurias: ohh yes
20:25 timotimo does nqp/src/QRegex/P6Regex somehow end up in rakudo? because that implements dba
20:25 FROGGS timotimo: see rakudo/src/Perl6/Grammar.pm and scroll all the way down
20:26 FROGGS there is Perl6::Regex which inherits from that
20:26 timotimo OK
20:28 FROGGS timotimo: here you should see what tokens are involved https://gist.github.com/FR​OGGS/af161ba996cee5bbef88
20:29 FROGGS highlight 'dba' in your browser or so
20:29 SamuraiJack joined #perl6
20:30 timotimo oh, cool :)
20:41 * moritz has deleted a few merged branches in the rakudo repo
20:41 FROGGS moritz++
20:47 FROGGS pmurias: I've already merged my last changes from the tmp_highfive branch in, but need to spectest a tiny change of rakudo before comitting that
20:52 timotimo i think maybe the definition of token metachar:sym<:my> is shadowing the rule metachar:sym<mod> which calls mod_internal
20:52 timotimo because mod_internal should be inherited by Perl6::RegexGrammar just fine, and the action for it, too
21:09 * timotimo gives up for now
21:14 moritz nqp: say(qq["foo"]);
21:14 p6eval nqp: OUTPUT«"foo"␤»
21:17 dalek v5: 02f3fe0 | (Tobias Leich)++ | Makefile:
21:17 dalek v5: added rule clean
21:17 dalek v5: review: https://github.com/rakudo-p5/v5/commit/02f3fe035e
21:30 dalek nqp: 5e85657 | moritz++ | src/QAST/Compiler.nqp:
21:30 dalek nqp: when encountering an error during compilation, show the source text if available
21:30 dalek nqp: review: https://github.com/perl6/nqp/commit/5e85657e3b
21:30 FROGGS moritz++ # cool!
21:31 timotimo ooooh
21:31 arnsholt Neat
21:31 arnsholt moritz++ # indeed
21:34 moritz timotimo: I've narrowed down the error in the EXPORT_hash branch
21:35 moritz timotimo: when one exports a type object, and then references it, the QAST tree contains a QAST::WVal
21:35 moritz and while that one is compiled, the serialization context is null
21:36 dalek v5: 493d9ef | (Pawel Murias)++ | Makefile:
21:36 dalek v5: add make test
21:36 dalek v5: review: https://github.com/rakudo-p5/v5/commit/493d9efdc2
21:36 moritz what I don't know is why
21:36 pmurias FROGGS: spectest a tiny change we need custom changes to rakudo?
21:37 moritz and why the same thing doesn't happen during normal exporting of type objects
21:38 FROGGS pmurias: well no, I decided to create Perl6::P5World instead
21:38 cognominal joined #perl6
21:41 pmurias I'm considering if it would a good idea to change rakudo to delegate 'use v5' to v5.pm
21:41 dalek v5: d6bb78f | (Tobias Leich)++ | / (4 files):
21:41 dalek v5: pulled latest changes from rakudo and added P5World
21:41 dalek v5: review: https://github.com/rakudo-p5/v5/commit/d6bb78f628
21:41 dalek v5: e94280c | (Tobias Leich)++ | test.pl:
21:41 dalek v5: add simple test script to track side effects
21:41 dalek v5: review: https://github.com/rakudo-p5/v5/commit/e94280ce6e
21:42 FROGGS pmurias: though I'm not sure my P5World's method isnt used
21:43 FROGGS the error message "get_iter() not implemented in class 'NQPMu'" should be gone when running: perl6 test.pl
21:43 FROGGS pmurias: well, currently it is a noop, why not change it?
21:43 FROGGS so that it will be treated as a regular module
21:44 FROGGS https://github.com/rakudo-p5/v5/blob​/master/lib/Perl6/P5Grammar.pm#L348
21:44 FROGGS I guess I know, we never hit TOP
21:45 FROGGS or do we?
21:45 FROGGS hmmm, I'll check
21:45 pmurias we don't
21:45 pmurias the parsing starts from statementslist
21:46 pmurias I get the get_iter() error
21:46 FROGGS right, me too
21:49 moritz nqp: for NQPMu { say(42) }
21:49 p6eval nqp: OUTPUT«get_iter() not implemented in class 'NQPMu'␤current instr.: '' pc 52 ((file unknown):43) (/tmp/5A_CuTp4Bq:1)␤»
21:50 moritz that's how you get that error
21:51 FROGGS moritz: right
21:55 masak pmurias: as long as you can still 'use v5' from different places in the same program. usually a module will be considered loaded if it's been loaded once, no?
21:56 pmurias hmm, I'll have to check that
21:56 moritz masak: but multiple 'use' statements still do the import actions in each scope
21:56 moritz r: { use Test; plan 1; }; { use Test; ok 1 };
21:56 p6eval rakudo 221a95: OUTPUT«1..1␤ok 1 - ␤»
21:56 moritz otherwise the second scope wouldn't have a sub &ok
21:59 masak oh, that's fine, then.
22:03 pmurias no it's not
22:07 pmurias I need to but the grammar changing code in EXPORT
22:07 pmurias &EXPORT
22:08 pmurias but it's only called when use is called with arguments (as rakudo doesn't implement the spec yet)
22:08 moritz what does the spec say?
22:09 moritz it's easy enough to change, fwiw
22:10 pmurias the spec seems to imply that EXPORTALL is called as a method on the package
22:10 pmurias and EXPORTALL calls EXPORT
22:10 moritz which is unfortunate, because you can't call methods on packages
22:10 moritz only on classes
22:12 moritz anyway, easy to fix: move the   if +@positional_imports { ... } into the else-clause with the nqp::die(...);
22:12 moritz then &EXPORT is always called when it exists
22:12 moritz I'm going to do that in the EXPORT_hash branch, and eventually it'll hit nom
22:13 moritz if you need it earlier, I can do it in nom too
22:13 moritz anyway, time to sleep&
22:14 pmurias it would be most usefull if combined with treating 'use v5' as a module
22:27 toddr joined #perl6
22:30 masak 'night, #perl6
22:30 geekosaur joined #perl6
22:30 FROGGS gnight masak
22:31 kshannon joined #perl6
22:31 pmurias joined #perl6
22:37 jkim joined #perl6
23:03 colomon joined #perl6
23:25 timotimo r: <1 2 3>.join(",")
23:25 p6eval rakudo 221a95:  ( no output )
23:25 timotimo r: say <1 2 3>.join(",")
23:25 p6eval rakudo 221a95: OUTPUT«1,2,3␤»
23:25 timotimo r: say ("foo" ~ $_ for <a b c d>).join(",")
23:25 p6eval rakudo 221a95: OUTPUT«fooa,foob,fooc,food␤»
23:27 timotimo ah, i had an item context going on
23:32 timotimo i've decided to create the 'new-foo' methods with eval now, but i don't have the symbols for the classes i want to create at that time >_<
23:40 sftp joined #perl6
23:59 timotimo ... whaaa?!?
23:59 timotimo Can not get attribute '$!signature' declared in class 'Code' with this object  -  in method new-leaf at src/gen/CORE.setting:440
23:59 FROGGS ó.ò

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

Perl 6 | Reference Documentation | Rakudo