»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend! | YAPC::NA talk submissions due end of Month. Have you submitted your talk?
Set by toddr_ on 18 March 2013.
timotimo n: say "perl".succ; 00:02
p6eval niecza v24-35-g5c06e28: OUTPUT«perm␤»
timotimo m)
00:06 colomon joined 00:09 fgomez joined, cognominal__ left, cognominal joined 00:11 fgomez left 00:12 fgomez joined 00:13 cognominal__ joined 00:14 cognominal left 00:17 cognominal__ left 00:21 orafu left
timotimo r: say { foo => (1, 2, 3)>>.Str } 00:26
p6eval rakudo 221a95: OUTPUT«("foo" => $("1", "2", "3")).hash␤»
timotimo r: say { foo => @((1, 2, 3)>>.Str) }
p6eval rakudo 221a95: OUTPUT«("foo" => ("1", "2", "3").list.item).hash␤»
timotimo why does it turn it into an item always? is that right? 00:27
00:28 cognominal__ joined
timotimo r: say { foo => [1, 2, 3] } 00:31
p6eval rakudo 221a95: OUTPUT«("foo" => [1, 2, 3]).hash␤»
timotimo that's an Array, right?
r: say [1, 2, 3].WHAT
p6eval rakudo 221a95: OUTPUT«(Array)␤»
timotimo mhm.
00:34 orafu joined
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:43 japhb_ left 00:51 cognominal joined 00:52 cognominal__ left 00:55 census2 left
timotimo how do i add a "handles" thing from source? 00:55
jnthn Calling trait_mod:<handles> is probably the easiest way 00:56
timotimo oh, so just $my_attribute handles <a b c> in the code? 00:57
why does it surprise me, that i can just write that outside a class, too?
jnthn No 00:59
timotimo hm, so do i set :has_accessor to 0?
jnthn You need to call it
timotimo ah, i'll actually call it. yeah, all right
jnthn triat_mod:<handles>($attr, <a b c>) or so
timotimo yup 01:00
01:01 cognominal left
timotimo hm, i still lack a way to name the sub-attributes 01:03
as in Tree = Branch Tree, Tree | Str - the names for both trees and the string
maybe it should become something like this
as in Tree = Branch Tree left, Tree right | Str cargo - the names for both trees and the string
01:05 Chillance_ left
dalek pan style="color: #395be5">perl6-examples: 36c240e | (David Warring)++ | parsers/CSSGrammar.pm:
CSSGrammar tweak
01:06
01:06 cognominal joined
timotimo jnthn: interestingly the second argument of handles has to be a thunk that returns a list. curious. 01:08
01:17 cognominal left
timotimo now i have running code. only need to test if it actually does what i hope it does 01:21
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:26
01:26 cognominal joined
jnthn timotimo: The name you pass and where you install it are orthogonal. 01:28
timotimo: The package of Tree is accessible with Tree.WHO
timotimo oh, maybe that was my mistake
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
It's nothing to do with inheritance.
timotimo yes, indeed
supertype is a misnomer, kind of
i should change that
i still get "symbol not found: Branch". i passed the Tree thing like my \Tree := create-thingy(); 01:32
01:38 cognominal left
timotimo hm. now i have to figure out how to create a method. 01:43
oh, just create a sub and add_method it 01:44
01:45 cognominal joined
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␤»
timotimo r: sub yoink($a, :$b) { say "$a $b"; }; sub pass-through(|$c) { yoink(\$c); }; pass-through(100, :b<foo>); 01:52
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 ␤»
timotimo r: sub yoink($a, :$b) { say "$a $b"; }; sub pass-through(|$c) { yoink.invoke($c); }; pass-through(100, :b<foo>);
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))␤»
timotimo r: sub yoink($a, :$b) { say "$a $b"; }; sub pass-through(\$c) { yoink.invoke($c); }; pass-through(100, :b<foo>);
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))␤»
timotimo how do i capture? :|
01:52 jaldhar joined
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␤␤»
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«===SORRY!===␤Variable '$c' is not declared␤at /tmp/o7cttsuY1M:1␤------> $b"; }; sub pass-through(|c) { yoink(|$c⏏); }; pass-through(100, :b<foo>);␤ expecting any of:␤ postfix␤»
timotimo r: sub yoink($a, :$b) { say "$a $b"; }; sub pass-through(|c) { yoink(|c); }; pass-through(100, :b<foo>);
p6eval rakudo 221a95: OUTPUT«100 foo␤»
timotimo aha!
Type check failed in assignment to '$.attr_c'; expected 'Str' but got 'Str' >_> 01:57
02:01 cognominal left
timotimo hum. somehow the method doesn't get added for my handles 02:07
02:08 xinming joined
timotimo actually ... something else is wrong 02:10
jnthn: any intuitions what i might be doing wrong if i get Can not get attribute '$.leaf' declared in class 'Stash' with this object ?
r: gist.github.com/timo/838088f579a36520bc1f 02:11
p6eval rakudo 221a95: OUTPUT«===SORRY!===␤Two terms in a row␤at /tmp/vW7fMtz5GM:1␤------> https⏏://gist.github.com/timo/838088f579a36520␤ expecting any of:␤ argument list␤ postfix␤ infix stopper␤ infix or meta-infix␤ st…
timotimo didn't that once work?
r: gist.github.com/timo/838088f579a36520bc1f
p6eval rakudo 221a95: OUTPUT«===SORRY!===␤Two terms in a row␤at /tmp/NlCUvGxgh2:1␤------> http⏏://gist.github.com/timo/838088f579a36520␤ expecting any of:␤ argument list␤ postfix␤ infix stopper␤ infix or meta-infix␤ sta…
timotimo r: gist.github.com/timo/838088f579a36520bc1f
p6eval rakudo 221a95: OUTPUT«===SORRY!===␤Confused␤at /tmp/RmXAWRxo6g:1␤------> gist.github.com/timo/838088⏏f579a36520bc1f␤ expecting any of:␤ whitespace␤»
timotimo i'm pretty sure the evalbot did that some time ago :(
02:12 xinming_ left, census left, cognominal joined, telex joined
timotimo oh, it may not work because it's a secret gist? 02:15
r: gist.github.com/timo/5226114
p6eval rakudo 221a95: ( no output ) 02:16
timotimo uh, that's not much better
02:16 FROGGS_ left 02:17 FROGGS_ joined 02:24 cognominal left
timotimo i don't know why the attribute doesn't get added :( 02:27
jnthn "declared in class 'Stash'" sounds very weird 02:29
Are you passing a .WHO in place of a type object somewhere? 02:30
Like, in the constructor to Attribute perhaps
timotimo would you look at my newest code? 02:33
gist.github.com/timo/5226114 - just updated this with the newest thing
you'll notice that there's an uninitialized leaf where i print "the leaf is: $t.leaf()" 02:34
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
so i'm guessing one of the accessors is wrong?
jnthn :package($type.HOW) 02:35
Don't think that wants to be .HOW
Just the type object, $type
timotimo oh?
jnthn :package($container-type.WHO) 02:36
And that one is wron gin the way I mentioned above ;)
Get rid of the .WHO
timotimo Cannot look up attributes in a type object now happens when i call $t.storage() after getting rid of the WHOs
also, .leaf is still undefined 02:37
jnthn You've probably got further 02:38
I don't see you ever doing .new on the types you create 02:39
.handles won't work out well if there's no instance to look up attributes in
timotimo oh, i thought i did
look at the generated new-$type.lc
in line 101 i do the .new
er, 103
it's well hidden :)
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:41
That will pass a single positional argument
Which is a Pair
timotimo so, why doesn't the new method explode horribly?
jnthn Try self.bless(*, |($name.lc => $type.new(|c)))
timotimo Type check failed in assignment to '$.leaf'; expected 'Leaf' but got 'Leaf' 02:42
that's excellent!
jnthn Because it's not an error to pass positionals to bless, they just don't do what you're after
timotimo it means that I got further!
fwiw, i get the same error when i remove the comment in line 68 so that the type of the attributes is correct, too.
the same kind of error 02:43
"expected A but got A"
i wonder if i can change rakudo so that expected A but got A would become more helpful 02:44
02:44 am0c joined 02:45 sevin left
timotimo oh god i made it work! 02:45
i had to .WHAT for :type(...) 02:46
celebratory arm flailing ensues:
\o/
thanks for staying up late, jnthn :)
jnthn \o/
timotimo you are my hero
jnthn np :)
02:47 FROGGS__ joined
jnthn Well, this is nothing compared to what I gotta do tomorrow so... :) 02:47
timotimo heh, ok
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?
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...)
SubsetHOW isn't terribly unusual, I don't think. 02:48
timotimo very cool.
and i'll make some proper test code.
jnthn method new_type(:$name = '<anon>', :$refinee!, :$refinement!) {
That pretty much tells it all. 02:49
02:49 PacoAir left
jnthn refinee is the type you're refining, refinement is anything you can smartmatch against 02:50
02:50 FROGGS_ left
jnthn The entire SubsetHOW is like 75 lines of code. :) 02:50
timotimo :) 02:51
oh, haha
i'm smart
of course i set :type("Int") 02:52
that doesn't make too much sense
jnthn No, types are most certainly not strings in Perl 6 ;)
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:53
p6eval rakudo 221a95: OUTPUT«===SORRY!===␤Cannot declare a variable by indirect name (use a hash instead?)␤at /tmp/LKl__YOCAW:1␤------> my $z = "FOO"; my $PKG::($z)::BAR⏏ = 24; say $PKG::($z)::BAR; # should thi␤»
jnthn OK, sleep time & 02:54
timotimo good night jnthn
and have a nice vacation :)
so, where do i post this example and get mad karma for it? 02:59
lue what example? 03:03
03:04 am0c left
timotimo algebraic data types in perl6 03:05
03:08 aindilis left
timotimo oh, wha? 03:09
lue sounds interesting
timotimo r: say method { return 1 };
p6eval rakudo 221a95: OUTPUT«<anon>␤»
03:09 orafu left
timotimo r: say(method { return 1 }); 03:09
03:09 OuLouFu joined
p6eval rakudo 221a95: OUTPUT«<anon>␤» 03:09
03:09 OuLouFu is now known as orafu
timotimo r: Str.HOW.add_method(Str, 'foobar', method { for ^10 { when *>5 { return $_ } } }); 03:10
p6eval rakudo 221a95: ( no output )
timotimo i get "Attempt to return outside of any Routine" locally with my much more complicated code :(
lue r: say method foo { return 1 }; 03:11
p6eval rakudo 221a95: OUTPUT«Useless declaration of a has-scoped method in mainline␤foo␤»
03:11 drbean left 03:13 drbean joined 03:14 FROGGS__ left 03:17 FROGGS joined
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␤␤»
timotimo r: "foobar(".index("(")
p6eval rakudo 221a95: ( no output )
timotimo r: say "foobar(".index("(") 03:19
p6eval rakudo 221a95: OUTPUT«6␤»
timotimo r: say "foobar(123)"[^*.index("(")]
p6eval rakudo 221a95: OUTPUT«use of uninitialized variable $max of type Int in numeric context in block at /tmp/kGfFXkNgjO:1␤␤␤»
timotimo r: say "foobar(123)"[^"foobar(".index("(")]
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:…
timotimo r: say "foobar(123)"[^("foobar(".index("("))]
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:…
timotimo need to decommute now 03:21
03:40 preflex left, preflex_ joined 03:41 preflex_ is now known as preflex 04:05 drbean left 04:07 drbean joined, wk_ joined
timotimo i need to create a better signature i see :| 04:08
r: sub yoink(|c) { say |c.^methods }; yoink(1, 2, 3); yoink(:foo, :bar);
p6eval rakudo 221a95: OUTPUT«BUILDat_keyat_poshashlistelemsCaptureFLATTENABLE_LISTFLATTENABLE_HASHpairsvalueskeyskvgistStrNumericperl␤BUILDat_keyat_poshashlistelemsCaptureFLATTENABLE_LISTFLATTENABLE_HASHpairsvalueskeyskvgistStrNumericperl␤»
04:08 wk left
timotimo whoa 04:09
r: sub yoink(|c) { say |c.^methods.perl }; yoink(1, 2, 3);
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 *%_) { ..…
timotimo oh, that's cute
i got positionals to work for the new-foo methods as well 04:14
now it'll be okay to construct a little example
i'll build the subtypes first,i think 04:15
04:26 thou_ joined, thou_ left
timotimo huh. i'm having trouble creating a subset... 04:26
r: Metamodel::SubsetHOW.new_type(:refinee(Str), :refinement({$^a.lc eq $^a})) 04:27
p6eval rakudo 221a95: ( no output )
timotimo the error was in a place where i totally didn't expect it to be, interesting. 04:29
i think i'm getting too tired to properly operate this heavy machinery
04:35 dwoldrich joined
timotimo i guess i just need a bit of sleep. 04:37
turns out i just needed to move the subset creation after the composition of the refinee 04:43
04:49 cibs left 04:54 colomon left 06:27 FROGGS left 06:35 SamuraiJack joined 06:43 SamuraiJack_ joined, SamuraiJack left 06:46 drbean left 06:49 drbean joined 06:51 raiph left 06:53 FROGGS joined 06:55 cibs joined, drbean left 06:57 drbean joined 07:06 Targen joined 07:13 raiph joined 07:33 FROGGS left, rindolf joined 07:47 FROGGS joined 07:48 spider-mario joined 08:05 chinaXing joined 08:08 drbean left 08:09 drbean joined 08:27 cognominal joined 08:29 rindolf left, rindolf joined
moritz good morning to everybody in the UGT :-) 08:35
08:36 wk_ left
labster good morning! 08:42
08:44 zby_home_ joined 08:48 thou left
sorear o/ 08:52
08:57 ilogger2 joined, ChanServ sets mode: +v ilogger2 09:03 thou joined 09:07 FROGGS joined 09:14 wk joined 09:17 thou left 09:25 FROGGS left 09:29 domidumont joined 09:32 FROGGS joined 09:59 domidumont left 10:00 domidumont joined
masak good forenoon, #perl6 10:17
moritz \o masak 10:18
moritz nags masak about t2 reviews
10:26 Chillance joined
masak today's plan: t2 reviews. 10:33
10:37 woosley joined
moritz \o/ 10:38
10:53 spider-mario joined 11:09 snearch joined 11:10 cognominal joined 11:16 snearch left 11:18 Rix joined 11:33 proller joined 11:34 FROGGS left 11:39 FROGGS joined 11:43 pmurias joined 12:21 colomon joined, drbean joined 12:22 proller left 12:26 proller joined 12:33 SamuraiJack__ joined 12:57 PacoAir joined
cognominal \o * 13:02
looks like a pompom girl
rn: class A is Hash is Array {}; A.new.push: '\o *' 13:05
p6eval niecza v24-35-g5c06e28: ( no output )
..rakudo 221a95: OUTPUT«Trailing item in Hash.push in block at /tmp/eG9vGsAYo5:1␤␤»
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 *'
p6eval rakudo 221a95, niecza v24-35-g5c06e28: ( no output )
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
rn: class A is Hash is Array {}; A.new.Arry.push: '\o *'
p6eval rakudo 221a95: OUTPUT«No such method 'Arry' for invocant of type 'Hash'␤ in block at /tmp/CMJMeMtOCr:1␤␤»
..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/…
cognominal oops
rn: class A is Hash is Array {}; A.new.Array.push: '\o *'
p6eval rakudo 221a95: ( no output )
..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…
cognominal acking the tests with 'class.*is \w+ is \w+' to search hapinness 13:13
jnthn, any idea? 13:15
13:16 chinaXing joined, rindolf joined
moritz the problem is that in Rakudo, class Hash has a method 'push' directly 13:17
but Array has the one inherited from List
r: class A is Hash is Array { }; say A.^mro;
p6eval rakudo 221a95: OUTPUT«(A) (Hash) (EnumMap) (Array) (List) (Iterable) (Cool) (Any) (Mu)␤»
cognominal but is there a way to call the right method from a derived class? 13:18
13:20 SamuraiJack joined, SamuraiJack__ left
jnthn sure, just qualify it 13:20
self.Hash::push
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
cognominal Should have a way, to say that en masse. 13:24
moritz the method resolution order is known at compile time
cognominal: there might be better ways, for example with delegation
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
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... :)
cognominal: Or delegation. Which Perl 6 makes much easier by providing the "handles" trait
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?
jnthn Sure, then you probably want to consider delegation.
pmurias jnthn: and static lexicals are set with setstaticlex?
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 left 13:31 rindolf joined
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.
pmurias jnthn: sometimes QAST::Block nodes are part of the ast while being declared somewhere else?
masak wrapping+delegation > inheritance 13:32
jnthn pmurias: Their placement in the AST is what determines outer relationships.
masak: s/wrapping/composition/ ;)
pmurias: However that doesn't imply any kind of named installation
cognominal agreeing with mask and jnthn
pmurias jnthn: and is there a clear rule when the outer relationship is established? 13:34
cognominal now let's see if there is not any snag when dealing with postcircumfix operators
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:35
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
pmurias: In the case of a closure being invokved, that outer comes straight from the closure object itself.
arnsholt jnthn: Can you live with sixmodelobject.pmc's VTABLE_does looking like this: gist.github.com/arnsholt/5227768 ? 13:40
masak jnthn: yes, composition was what I was after. 13:42
jnthn: thought wrapping is a kind of composition, no? :)
13:43 pmurias left 13:45 proller_ joined, proller left, pmurias joined
dalek kudo/tmp_highfive: 0206db8 | (Tobias Leich)++ | src/Perl6/P5 (2 files):
strip all occourances of colonpair
13:45
jnthn arnsholt: Looks workable 13:48
jnthn afk for a bit
13:50 lee_ joined
arnsholt Excellent! 13:50
cognominal jnthn++, masak++ 13:52
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 :/ 13:54
14:00 woosley left, woosley joined, census joined 14:07 am0c joined 14:10 cognominal left 14:13 pmurias left 14:15 cognominal joined 14:21 pmurias joined 14:22 proller_ left 14:23 proller_ joined, Psyche^ joined, proller_ left 14:24 Psyche^ is now known as Patterner 14:26 bruges joined
timotimo masak: i made a lot of progress on the ADT module 14:34
masak ooh 14:40
masak really hopes that means instrumenting the MOP to reduce boilerplate from the class-based gist he wrote
timotimo yes.
masak \o/
timotimo that's exactly what it means
masak that's... ossum.
timotimo opossum?
masak maybe even that. 14:41
do you have anything I could look at?
timotimo boy, do i ever! ;)
masak is it time to think of a follow-up email to Philippe?
\o/
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
rather than being forced to make them using a given statement.
i think the current code is look-at-able
gist.github.com/timo/5226114 - look at the example at the bottom. this code works :) 14:42
masak looks
nice. 14:44
timotimo++
timotimo :) 14:45
jnthn did all the hard bug-hunting for me
oh 14:49
why did i re-create the subsets down there? that doesn't make sense
oh, silly me, i was looking at *your* gist
masak: did you notice how .gist and .perl show Tree.new-foo for each of the parts? :D 14:50
masak no, I didn't run the thing. 14:51
is that good or bad?
14:52 eiro joined
timotimo i think it's good 14:52
Tree.new-branch(left => Tree.new-branch(left => Tree.new-leaf(storage => 1), [...]))
masak timotimo: # XXX remove this and we'll get an "attempt to return outside of any Routine" ... ?!
timotimo that's what it looks like when .gisted
14:53 woosley left
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
timotimo: it's one of our future FAQs :)
timotimo oh ... yeah, that's right m)
masak timotimo: anyway, good work.
masak takes a walk in the nice weather
timotimo thanks :) 14:54
feel free to write that followup email some time soon
unless of course you notice something very bad that needs fixing first
masak oh, I meant that you could write it ;) 14:55
timotimo me? oh my. 14:58
i suppose i could do that.
14:59 kivutar joined 15:12 mls joined 15:13 kivutar left 15:20 pmurias left 15:23 moukeddar joined
dalek kudo/tmp_highfive: 80e4d98 | (Tobias Leich)++ | src/Perl6/P5 (2 files):
make subroutines work
15:23
moukeddar o/ #perl6
anybody here? 15:25
moritz no, we're all bots
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
maybe we'll get methods for classes working in the next week!
but rakudo is totally production ready! almost!
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
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
moritz same here :-)
moukeddar it's more about architecure concerns 15:30
moritz that's probably ok
15:30 wk left
timotimo doesn't seem very far off-topic at first glance. i say go ahead 15:30
moukeddar architecture*
it's from here that i learned about DDD and CQRS 15:31
15:31 mls left, mtk joined, mls joined, chinaXing left
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 ?
timotimo "get a proper mail client"? hehehe.
15:35 pmurias joined
pmurias FROGGS: ping 15:35
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?
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 :|
internal teaching systems?
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
moukeddar so, it's all about data being queried by large groups of users
timotimo moritz: wow, that's clever. i'll go hunt for it
moukeddar Information technology services 15:39
timotimo now i'll just have to mention p6l and look at the irc log
ah, right.
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?
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
i'll try to set up my mail client with the nntp instead
oh, whoops, "download all headers" didn't go over very well 15:46
now i crashed my mail client, too
masak moukeddar! \o/ 15:50
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.
"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)
moukeddar masak: sounds like event sourcing would make it easier to do, no ? 15:54
masak yes, in the sense that the intent is preserved through the stored events. 15:56
there's bound to be an even (or a set of events) corresponding to command A.
we generally don't store commands for business logic.
moukeddar and that's what the event store is for, preserve the intents, so, events go in the log, the commands no ? 15:57
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
masak but it's the events that determine the state the system is in.
dalek kudo/tmp_highfive: 2d1a2cf | (Tobias Leich)++ | src/Perl6/World.pm:
v5 doesnt have colonpair
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
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
moukeddar i understand now,but logging the commands could be useful to something
timotimo FROGGS: not sure if this is helpful, but have you seen how jnthn implemented Rakudo::Debugger? 16:04
FROGGS pmurias: and currently I want to see progress, and dont wanna wasting days by moving around code
timotimo: I've seen his code months ago, yes
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
but ya, having an v5 module would be sweet (some day)
I dont know why, but I must always think of a PHP module... :/ 16:08
must be pretty easy to do that
timotimo run PHP in perl6?
FROGGS ya 16:10
timotimo it's probably not easy to get the semantics to match bug-per-bug, though 16:11
16:20 crab2313 joined
pmurias FROGGS: we can import things from rakudo internals when running as a module. 16:26
FROGGS: the main reason I want to do that is to avoid recompiling the setting on every change to the Perl 5 grammar.
FROGGS: I'll take care of the move then 16:27
FROGGS: one problem is that rakudo ignores all version numbers so we either have to use 'use v5suffix' or patch rakudo 16:30
moritz it really shouldn't ignore all version numbers 16:33
another hack would to upper-case it 16:34
use V5; # :-)
spider-mario :D 16:39
or make use <number> special
use 5;
16:40 mangala joined
spider-mario but that’s ugly and does not allow for minor version numbers 16:40
TimToady or if it does, you re-introduce p5's use 5.016 confusion 16:42
we want to make different mistakes with p6 16:44
anocelot "use 5.016" was confusing? 16:46
TimToady what does 'use 5.16' mean then?
turns out to be the same as 'use 5.160'
and there ain't a v5.160 yet...
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
TimToady so p6 requires the v on v5.16
16:48 PacoAir left
TimToady so that it accidentally is not interpreted as a different kind of object 16:48
or however you say that in English...
anocelot use v5-0-16?
TimToady people like dots in versions
anocelot ...but it would be properly dash-ambiguated. 16:49
TimToady <whimper/>
anocelot Gomen nasai. 16:50
pmurias spider-mario: we could just make 'use v5' special
anocelot Or substitute something special for "use" for several years. "abuse v5" 16:51
masak Perl -- the first language with the "abuse" keyword!
TimToady anocelot: I can tell you're gonna fit right in here...
masak people would nod and say "sounds about right" :P
timotimo "'abuse': the first abuse keyword in perl6 that's actually called 'abuse'" 16:53
"in perl history*"
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:00
17:01 rindolf left
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:02
*exact
anocelot Hmm... "abuse" could take other parmeters and act accordingly. "abuse php" - warn "with pleasure\n";
diakopter p5eval: `php --version` 17:03
p5eval diakopter: ERROR: Insecure $ENV{PATH} while running with -T switch at (eval 7) line 1.
17:03 SamuraiJack_ joined
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 SamuraiJack left
diakopter p5eval: $ENV{PATH} = '/bin:/usr/bin'; `php --version` 17:05
p5eval diakopter: interrupting, taking more than 5 second(s)
diakopter: No output
TimToady p5eval: use 5.16;
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.
diakopter p5eval: use 5.016; $ENV{PATH} = '/bin:/usr/bin'; say `php --version` 17:06
p5eval diakopter: interrupting, taking more than 5 second(s)
diakopter: No output
anocelot Enlightening. (Which is far superior to being in lightning.)
diakopter p5eval: print 'alive'; use 5.016; $ENV{PATH} = '/bin:/usr/bin'; say `php --version`
p5eval diakopter: interrupting, taking more than 5 second(s) 17:07
diakopter: alive
diakopter p5eval: use 5.016; $ENV{PATH} = '/bin:/usr/bin'; print 'alive'; say `php --version`
p5eval diakopter: interrupting, taking more than 5 second(s)
diakopter: alive
arnsholt Oh, I'd already started that stuff ^_^
diakopter p5eval: use 5.016; $ENV{PATH} = '/bin:/usr/bin'; say `ls`
p5eval diakopter: interrupting, taking more than 5 second(s)
diakopter: No output
diakopter eh.
spider-mario p5eval: $ENV{PATH}='/bin:/usr/bin'; system 'php', '--version'; 17:08
p5eval spider-mario: interrupting, taking more than 5 second(s)
spider-mario: No output
timotimo why can you even try to 'system' from p5eval?
spider-mario I don’t what is and what is not allowed by p5eval
diakopter p5eval: use 5.016; $ENV{PATH} = '/bin:/usr/bin'; fork or print 'alive' 17:09
p5eval diakopter: alive
diakopter p5eval: use 5.016; $ENV{PATH} = '/bin:/usr/bin'; fork and print 'alive'; #lolz
p5eval diakopter: No output
diakopter anocelot: p6eval is the super-fun one 17:10
anocelot p6eval: say it isn't so;
moritz p5eval: system "echo foo"
p5eval moritz: ERROR: Insecure $ENV{PATH} while running with -T switch at (eval 7) line 1.
moritz p5eval: $ENV{PATH} = '/bin:/usr/bin'; system "echo foo"
p5eval moritz: interrupting, taking more than 5 second(s)
moritz: No output
diakopter oh.. maybe $|++ 17:11
TimToady p5eval: use 5.016; $ENV{PATH} = '/bin:/usr/bin'; fork and (fork or print "alive\n")
p5eval TimToady: No output
moritz p5eval: $ENV{PATH} = '/bin:/usr/bin'; system 'echo "foo\n"'
spider-mario p5eval: sub blah {my ($n) = @_; return unless $n > 0; print "hello\n"; fork or blah($n - 1);} blah(5)
p5eval moritz: interrupting, taking more than 5 second(s)
moritz: No output
spider-mario: hellohellohellohellohello
spider-mario yay, fork works
or maybe not
timotimo p5eval system 'killall' 'p5eval irc bot binary'
diakopter ergh
spider-mario hm, I’m stupid 17:12
anocelot is tempted to issue a fork while fork and test the proclimit...
spider-mario it doesn’t prove anything, why did I even think it would?
diakopter anocelot: you have to do r: n: or p: rakudo/niecza/pugs or most combinations of those work
spider-mario p5eval: sub blah {my ($n) = @_; return unless $n > 0; print "hello\n"; fork and blah($n - 1);} blah(5)
p5eval spider-mario: hello
spider-mario ok.
diakopter rnp: die die die 17:13
p6eval rakudo 221a95: OUTPUT«␤ in block at /tmp/VWZ7U_67pq:1␤␤»
..pugs: OUTPUT«*** Died␤ at /tmp/WlOJzOy74v line 1, column 1 - line 2, column 1␤»
..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…
TimToady rakudo doesn't know it died :(
anocelot spooky 17:14
spider-mario p5eval: sub blah {my ($n) = @_; return unless $n > 0; print "hello\n"; defined(fork) and blah($n - 1);} blah(5)
p5eval spider-mario: hello
timotimo it will haunt this channel for ever :|
moritz TimToady: it's easy to give it a default message
diakopter rnp: try die try die try die try die try die try die
p6eval pugs: OUTPUT«*** Died␤ at /tmp/9mlQjlJRkH line 1, column 1 - line 2, column 1␤»
..rakudo 221a95, niecza v24-35-g5c06e28: ( no output )
timotimo moritz: can i ask you to help me refine the EXPORT_hash branch a bit more today?
TimToady 😒 17:15
timotimo actually, i'm not sure how much i can even contribute to that any more.
anocelot The fact that die causes a die implies this isn't an eval{}bot?
moritz timotimo: sure you can ask :-)
anocelot: right, it's and eval '' bot :-) 17:16
diakopter anocelot: it is; it's invoked as a new process every time
moritz also eval in perl 6 doesn't even catch exceptions 17:17
nr: eval '1 '
p6eval rakudo 221a95, niecza v24-35-g5c06e28: ( no output )
moritz nr: eval '1 1'
p6eval niecza v24-35-g5c06e28: OUTPUT«Unhandled exception: Two terms in a row at (eval) line 1:␤------> 1 ⏏1␤␤ 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:18
..rakudo 221a95: OUTPUT«===SORRY!===␤Two terms in a row␤at eval_0:1␤------> 1 ⏏1␤ expecting any of:␤ postfix␤ infix stopper␤ infix or meta-infix␤ statement end␤ statement modifier␤ statement modifier loop␤»…
moritz nr: eval 'die "not caught"'
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/…
..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␤␤»
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!
diakopter p5eval: $ENV{PATH} = '/bin:/usr/bin'; system ";" 17:19
p5eval diakopter: interrupting, taking more than 5 second(s)
diakopter: No output
anocelot rn: if eval '1' say "yay!"
p6eval rakudo 221a95: OUTPUT«===SORRY!===␤Missing block␤at /tmp/WNn8zV9DDE:1␤------> if eval '1' ⏏say "yay!"␤ expecting any of:␤ postfix␤ infix stopper␤ infix or meta-infix␤ parameterized block␤»
..niecza v24-35-g5c06e28: OUTPUT«===SORRY!===␤␤Missing block at /tmp/EI8MzUidfG line 1:␤------> if eval '1' ⏏say "yay!"␤␤Parse failed␤␤»
moritz timotimo: :-) will try 17:20
diakopter er
system ";" <-- oops.
17:21 renormalist joined
diakopter p5eval: $ENV{PATH} = '/bin:/usr/bin'; print `;` 17:21
p5eval diakopter: interrupting, taking more than 5 second(s)
diakopter: No output
diakopter p5eval: $ENV{PATH} = ''; print `;`
p5eval diakopter: interrupting, taking more than 5 second(s)
diakopter: No output
geekosaur p5eval: $ENV{PATH} = '/bin:/usr/bin'; system ':'
p5eval geekosaur: interrupting, taking more than 5 second(s) 17:22
geekosaur: No output
17:22 wk joined
TimToady spam, spam, spam, spam... 17:22
diakopter p5eval: $ENV{PATH} = ''; print `dir /w`
p5eval diakopter: interrupting, taking more than 5 second(s)
diakopter: No output
dalek p-jvm-prep: e6ceeb3 | jnthn++ | src/org/perl6/nqp/sixmodel/Serialization (2 files):
Update for latest serialization changes.
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
well, i could try at least
moritz timotimo: I'll probably need some input from jnthn++
though there's a bit of stuff I want to try myself first 17:24
anocelot r: @nums=<1 2 3>; say [email@hidden.address]
p6eval rakudo 221a95: OUTPUT«===SORRY!===␤Variable '@nums' is not declared␤at /tmp/gyLRBvyryZ:1␤------> @nums⏏=<1 2 3>; say [email@hidden.address] expecting any of:␤ postfix␤»
timotimo missing my 17:25
anocelot r: my @nums=<1 2 3>; say [email@hidden.address]
p6eval rakudo 221a95: OUTPUT«===SORRY!===␤Preceding context expects a term, but found infix , instead␤at /tmp/dYmRCTYEzj:1␤------> my @nums=<1 2 3>; say [email@hidden.address]
moritz you need quotes around the ,
timotimo r: @nums=<1 2 3>; say "@nums[].sort().join(',').";
p6eval rakudo 221a95: OUTPUT«===SORRY!===␤Variable '@nums' is not declared␤at /tmp/a0yuncPpwd:1␤------> @nums⏏=<1 2 3>; say "@nums[].sort().join(',').␤ expecting any of:␤ postfix␤»
timotimo r: my @nums=<1 2 3>; say "@nums[].sort().join(',').";
p6eval rakudo 221a95: OUTPUT«1,2,3.␤»
timotimo copied the wrong one m)
moritz r: my @nums=<1 2 3>; say "@nums[].sort().join(",")."; 17:26
p6eval rakudo 221a95: OUTPUT«1,2,3.␤»
timotimo also, in order for arrays to be interpolated in strings you need a zen slice, too: []
moritz predictive parsing ftw
or anything that ends in a postcircumfix
timotimo but not if it has dots in it, right?
r: my @nums=<1 2 3>; say [email@hidden.address]
p6eval rakudo 221a95: OUTPUT«1,2,3.␤»
timotimo oh, well i guess that's possible,t oo
moritz aye
17:27 thou joined
timotimo so i wouldn't even need the () for sort. that's cool. 17:27
anocelot Hmm... I was looking at the "Useing perl 6" pdf and didn't see them there.
Ah. Now I see what I did. nvm.
17:29 cognominal left
anocelot So <a b c> is the replacement for qw/a b c/ ? 17:31
TimToady well, except that the latter still works
so more of a shortcut
anocelot Ah. 17:32
TimToady much as "" is short for qq//
anocelot That's handy if your data set includes lots of //////s.
TimToady :D 17:33
17:33 moukeddar left
anocelot Use case: "We run a fence mending service and we track wither fences are straight |||||| or bent //////." 17:33
17:33 snearch joined
masak :) 17:34
anocelot: <a b 13> also has some magic handling of the '13', turning it into a number-string chimera.
TimToady you sure this "" feature isn't just bloat?
masak rn: my @a = <a b 13>; say @a[*-1].^name
p6eval rakudo 221a95: OUTPUT«Str␤»
..niecza v24-35-g5c06e28: OUTPUT«IntStr␤»
masak Niecza has it. 17:35
anocelot r: my $val=2; say $val++**3;
p6eval rakudo 221a95: OUTPUT«8␤»
TimToady nr: say <1/2>.WHAT
p6eval niecza v24-35-g5c06e28: OUTPUT«(Rat)␤»
..rakudo 221a95: OUTPUT«(Str)␤»
TimToady ooh, rakudo doesn't even have that yet
anocelot r: my $val=2; say ++$val**3;
p6eval rakudo 221a95: OUTPUT«27␤»
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.
r: my $val=2; say ($val++)**3; 17:38
p6eval rakudo 221a95: OUTPUT«8␤»
TimToady r: my $val=2; $val++; say $val**3
p6eval rakudo 221a95: OUTPUT«27␤» 17:39
TimToady postincrement, is, well, post
pmichaud $TimToady.words.join(', ')
moritz r: my $v = 5; say ++$v**2
p6eval rakudo 221a95: OUTPUT«36␤»
moritz seems that prefix ++ binds tighter than infix ** 17:40
TimToady it's supposed to, by S03
moritz which makes sense, because prefix ++ couldn't work on the result of a **
pmichaud both prefix:<++> and postfix:<++> bind tighter than infix:<**>
17:41 cognominal joined
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:42
p6eval rakudo 221a95: OUTPUT«36␤»
moritz anocelot: the ++ happens first, then the ** works on the result of it
pmichaud both prefix:<++> and postfix:<++> (autoincrement) have higher precedence (bind tighter) than infix:<**> (exponentiation)
moritz that's why the result is 36
and not
r: say ++($v ** 2)
p6eval rakudo 221a95: OUTPUT«===SORRY!===␤Variable '$v' is not declared␤at /tmp/VtRHPde3b8:1␤------> say ++($v⏏ ** 2)␤ expecting any of:␤ postfix␤»
pmichaud note that the result of $x++ is the value of $x before it's postincremented
TimToady never uses the terms "higher" or "lower" wrt precedence
moritz r: smy $v = 5; ay ++($v ** 2) 17:43
p6eval rakudo 221a95: OUTPUT«===SORRY!===␤Variable '$v' is not declared␤at /tmp/3LOtuqNsV0:1␤------> smy $v⏏ = 5; ay ++($v ** 2)␤ expecting any of:␤ postfix␤»
moritz r: my $v = 5; say ++($v ** 2)
TimToady since have the precedence tables in the world are printed upside-down
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␤␤»
pmichaud TimToady: +1
TimToady *half
pmichaud r: my $x = 5; say $x++; say $x;
p6eval rakudo 221a95: OUTPUT«5␤6␤» 17:44
17:45 snearch left
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
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.
cognominal back and still have a problem defining a .[] : gist.github.com/cognominal/5228672
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
cognominal: the default postcircumfix:<[ ]> calls at_pos for each element 17:48
anocelot (Which, of course, makes the blood rush to ones head and makes it hard to think clearly anyway.)
cognominal ok, got it. I had a stray "sum"
* "sym"
I originally pasted it from Grammar.pm, this explains it.
pmichaud cognominal: overriding postcircumfix:<[ ]> is only if you want to redefine the slicing and other default behaviors of .[] 17:49
(which can be quite a lot)
afk
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
sorry, has @!kids handles <... at_pos>;
cognominal moriz, not tried yet
moritz you should. It's likely the simplest solution 17:53
timotimo what are the implications of the right side of handles being a^Hclosures?
17:53 kaare_ joined
cognominal moritz: same result 17:53
timotimo or at least it seems that way from how trait mood handles works
moritz cognominal: maybe @!kids is empty? 17:54
pmurias what can be causing pastie.org/7092377?
moritz timotimo: I don't think closures are allowed
or make sense
pmurias after I add 'use Perl6::Grammar;' to a source file 17:55
cognominal moritz: no .elems says I got 2 elements
timotimo okay. must have been confused by the raw function then 17:56
because that takes a block that returns a list.
moritz pmurias: are you adding it to Perl 6 or to an NQP file? 17:57
pmurias nqp file
it works for some files
when I add it to Perl6::P5Grammar I get that error
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
cognominal: if I do has @!kids handles <shift unshift push pop elems at_pos>; 17:59
remove the custom postcircumfix method
and then do
my $d = DOM.new;
$d.push: 'hi!';
$d.push: 'bye!';
say $d[0];
it works fine
and slices work too
cognominal indeed, moritz++ 18:00
moritz cognominal: I guess .delete(0) simply sets the element 0 to Any
which is why you get an Any returned
if you really want to remove the index, and not just undefine the elements, you need to call splice
cognominal indeed! 18:01
so I was barking at the wrong tree.
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
ie they all have return type void
arnsholt Yeah, I can live with that =) 18:03
moritz and return values is through out and in-out params
arnsholt Yeah, it's a bit odd
moritz in the end, a parrot op is just a C function that adhers to a certain API
cognominal with Perl 6, a DOM interface will not be a nightmare anymore :)
arnsholt But not having to fall off the end of the function saves me some branching
moritz it's perfectly understandble if you don't want to use C stack too much
after all a VM wants to maintain its own stack (or heap) 18:04
arnsholt True, true 18:06
And parrot is register-based, not stack-based
anocelot Oout of curiosity, does delete on a hash elem still remove the key/value pair? 18:10
s/Oout/out/ 18:11
moritz anocelot: yes
18:11 am0c left
cognominal r: %a = 'a'..'f'; say %a.perl; %a.delete('c'); say %a.perl 18:11
p6eval rakudo 221a95: OUTPUT«===SORRY!===␤Variable '%a' is not declared␤at /tmp/tOqdxgFg7v:1␤------> %a⏏ = 'a'..'f'; say %a.perl; %a.delete('c')␤ expecting any of:␤ postfix␤»
anocelot (BTW: Did you know the skype chat client will apply s/x/y/ on the prevous line?)
cognominal oops
r: my %a = 'a'..'f'; say %a.perl; %a.delete('c'); say %a.perl 18:12
p6eval rakudo 221a95: OUTPUT«("a" => "b", "c" => "d", "e" => "f").hash␤("a" => "b", "e" => "f").hash␤»
pmurias nqp only supports single inheritance?
diakopter anocelot: does it also send the s/// text? in case the recipient doesn't notice the change?
anocelot diakopter: I don't believe so.
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.
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
moritz anocelot: iirc it only removes the elements when they are at the end of the array
p5eval: my @a = (1, 2, 3); delete $a[1]; \@a
p5eval moritz: [1,undef,3]
moritz see? not removed 18:17
p5eval: my @a = (1, 2, 3); delete $a[2]; \@a
p5eval moritz: [1,2]
moritz removed.
p5eval: my @a = (1, 2, 3); delete $a[0]; \@a
p5eval moritz: [undef,2,3]
18:17 PacoAir joined
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:18
p6eval rakudo 221a95: OUTPUT«Cannot modify an immutable value␤ in block at /tmp/N8klWDrSRo:1␤␤»
anocelot s/15/12/ (cause I can't type)
timotimo how best to change the text up to the first ( to something else?
moritz r: my $str = "Tree.new(foo, bar)"; $str.substr-rw(0, "Tree".chars + 4) = "foobarbazquux"; say $str;
p6eval rakudo 221a95: OUTPUT«No such method 'substr-rw' for invocant of type 'Str'␤ in block at /tmp/9UjxShpMEi:1␤␤»
timotimo gist.github.com/timo/5226114#file-adt-pm6-L125 - what i'd like to make prettier
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
p6eval rakudo 221a95: OUTPUT«foobarbazquux(foo, bar)␤»
timotimo ah, neat.
moritz we could spec a four-argument version of substr 18:20
substr($orig, $from, $chars, $replacement)
18:21 rindolf joined
moritz and that simply returns a new string with the substr replaced by $replacement 18:21
timotimo mhm.
i'd like that in this case
moritz instead of doing the replacement in-place, as p5 does
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:23
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;
p6eval rakudo 221a95: OUTPUT«===SORRY!===␤Undeclared routine:␤ delete used at line 1␤␤»
timotimo r: my @a = <1 2 3 4>; @a[2].delete; my @b = @a; say @b; say @a;
p6eval rakudo 221a95: OUTPUT«No such method 'delete' for invocant of type 'Str'␤ in block at /tmp/1dqSxtSCdf:1␤␤»
timotimo r: my @a = <1 2 3 4>; @a[2] :delete; my @b = @a; say @b; say @a;
p6eval rakudo 221a95: OUTPUT«1 2 3 4␤1 2 3 4␤»
timotimo r: my @a = <1 2 3 4>; @a[2] :delete; my @b = @a; say @b.perl; say @a.perl;
p6eval rakudo 221a95: OUTPUT«Array.new("1", "2", "3", "4")␤Array.new("1", "2", "3", "4")␤»
timotimo that didn't work :|
dalek : 21809ea | (Pawel Murias)++ | / (8 files):
Initial proof of concept. Currently using 'use perl5' till we patch rakudo to support use v5 as a module.
18:26
pmurias FROGGS: ^^
18:26 crab2313 left
rindolf Hi moritz , timotimo , pmurias 18:29
18:29 rindolf left, rindolf joined
rindolf Hi moritz , timotimo , pmurias . What's up? 18:29
timotimo what are some techniques to get better error reporting for grammars that one writes oneself? 18:30
hey rindolf
gist.github.com/timo/5226114 - algebraic datatypes from haskell-style definitions for perl6 :) 18:31
pmurias rindolf: hi
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:35
arnsholt goes digging to see if Parrot has something useful
anocelot moritz: It could be worse. I could 'of accidentally used an @ prefix. XD
masak hi rindolf.
timotimo moritz: i expect all the definitions to be one-liners, though :|
tadzik pmurias: isn't this lacking 'perl5.pm'? 18:36
rindolf masak: hi, sup?
moritz anocelot: no worries :-) 18:37
pmurias it's compiling v6.pm into perl5.pbc
tadzik ah
masak rindolf: I see what you did there. :) s'fine :)
tadzik * v5, I guess
rindolf www.shlomifish.org/enough-with-sec/...03-23.html - I'd appreciate if you can go over this for correctness. I can credit you and/or a Perl 6 resource.
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.
pmurias tadzik: yes
masak rindolf: you're missing the point.
rindolf masak: ah, OK.
masak rindolf: it would have been on-topic if this were the #rindolf channel. 18:39
rindolf masak: OK, sorry.
masak no prob.
diakopter masak: but it mentions Jennifer Lawrence.. 18:40
masak oh, I missed that. 18:41
Jennifer Lawrence is a prefix operator in Perl 6. 18:42
diakopter your mom is a sink operator
masak yeah, then I see the connection.
dalek : 166db91 | (Pawel Murias)++ | / (2 files):
Document some hacks.
pmurias rindolf: you expect us to check if you summarized the updates to your homepage correctly? 18:44
rindolf pmurias: you don't have to if you don't want to. 18:46
pmurias: I said "please".
pmurias: I want it checked for grammar/syntax/spelling mistakes.
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
rindolf: if you just come in here occasionally, asking "could you please proof this page on my homepage" comes off... odd.
sayinig "please" makes it come off... odd but polite. 18:48
rindolf masak: OK, sorry.
18:48 cognominal left
rindolf masak: let's drop this conversation. 18:48
I got the memo.
masak: so, sup?
masak sure. I was explaining clearly as an investment for the future ;)
rindolf: re "sup", I'm (as usual) not sure what to respond. it's Saturday. I feel relaxed. 18:49
:)
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
diakopter: I don't think I've even met rindolf at a conf, actually.
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"
rindolf masak: I've only gone to conferences in Israel.
masak ah. and I haven't. 18:53
what do people think about the Order::None suggestion in rt.perl.org/rt3/Ticket/Display.html?id=117307 ?
18:53 cognominal joined
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. :)
diakopter have a nice trip! 18:55
jnthn o/
Thanks!
masak is heading out to have a beer with jnthn before he leaves :)
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..
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
labster good morning, #perl6 19:00
masak o/ 19:01
labster \o
dalek osystem: bb08901 | (Brent Laabs)++ | META.list:
Adding IO::Path::More
19:03
pmurias FROGGS: have you seen the way I moved the perl5 frontend into a module? 19:07
19:14 mikess joined 19:31 SamuraiJack__ joined 19:32 SamuraiJack_ left 19:40 cognominal left 19:53 domidumont left
timotimo can i create a signature programmatically and assign it to a method i created? 19:56
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
but if possible, i'd want to create the signature first
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
i'd prefer to use the metamodel to do it
this is in perl6 code
not in nqp
pmurias isn't it possible to use QAST form perl6? 19:59
timotimo dunno.
r: say QAST::Stmt; 20:00
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␤␤»…
timotimo r: say QAST::Var;
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␤␤»…
timotimo r: use QAST; say QAST::Var;
p6eval rakudo 221a95: OUTPUT«===SORRY!===␤Could not find QAST in any of: /home/p6eval/nom-inst/lib/parrot/4.10.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…
arnsholt You'll probably have to rely on a lot (pretty much all) nqp:ops I think
QAST is implemented in NQP, not Perl 6
timotimo if it's not doable sensibly, i'll stick to this approach: gist.github.com/timo/5226114#file-adt-pm6-L107 20:01
FROGGS pmurias: this does work??
pmurias FROGGS: on my machine yes 20:02
arnsholt But given what you want, you don't really want QAST I think
FROGGS pmurias: wow
pmurias FROGGS: using 'use perl5' as rakudo ignores 'use v5'
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
FROGGS pmurias: that's okay for now
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
timotimo src/core/Signature.pm doesn't seem to have a new method
which is why i asked here
i'll have a look at Actions, i guess 20:05
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
and i don't see a syntactical way to assign a signature to a method as i'm creating it 20:06
pmurias there's eval
generating code seems the only sensible way 20:07
moritz timotimo: it's not so easy, since signatures also declare the parameters as variables to the block of the method
timotimo oh, eval, of course :) 20:08
that's half-way clean, even.
but for the rest of the code i'll still rely on the metamodel, i think 20:09
it feels less icky to me
is :dba or something implemented in rakudo? 20:12
moritz it is in nqp 20:13
r: say '(ab' ~~ /'(' ~ ')' \w+/
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_…
moritz r: say '(ab' ~~ /:dba("foo") '(' ~ ')' \w+/
p6eval rakudo 221a95: OUTPUT«#<failed match>␤»
moritz but not in rakudo :(
FROGGS pmurias: I have to use rakudo's nom branch? 20:16
pmurias FROGGS: hmm, not sure I only tested it with the nom one 20:19
FROGGS: are there any problems with the highfive one?
moritz jnthn: ping
FROGGS pmurias++ 20:20
does work here too :o)
pmurias: I got 'missing or wrong version og src/Perl6/P5Actions.pm'
of*
but using nom works 20:21
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?
moritz timotimo: I have no idea
timotimo i'll just see what it looks like then
pmurias FROGGS: so do we migrate to the rakudo-p5/v5 repo? 20:24
dalek : 901afde | (Tobias Leich)++ | Makefile:
added stagestats so we see something while we wait
20:25
FROGGS pmurias: ohh yes
timotimo does nqp/src/QRegex/P6Regex somehow end up in rakudo? because that implements dba
FROGGS timotimo: see rakudo/src/Perl6/Grammar.pm and scroll all the way down 20:26
there is Perl6::Regex which inherits from that
timotimo OK
FROGGS timotimo: here you should see what tokens are involved gist.github.com/FROGGS/af161ba996cee5bbef88 20:28
highlight 'dba' in your browser or so 20:29
20:29 SamuraiJack__ left, SamuraiJack joined
timotimo oh, cool :) 20:31
20:37 SamuraiJack left
moritz has deleted a few merged branches in the rakudo repo 20:41
FROGGS moritz++
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:48
timotimo i think maybe the definition of token metachar:sym<:my> is shadowing the rule metachar:sym<mod> which calls mod_internal 20:52
because mod_internal should be inherited by Perl6::RegexGrammar just fine, and the action for it, too 20:53
21:00 rindolf left 21:07 kaare_ left
timotimo gives up for now 21:09
moritz nqp: say(qq["foo"]); 21:14
p6eval nqp: OUTPUT«"foo"␤»
dalek : 02f3fe0 | (Tobias Leich)++ | Makefile:
added rule clean
21:17
p: 5e85657 | moritz++ | src/QAST/Compiler.nqp:
when encountering an error during compilation, show the source text if available
21:30
FROGGS moritz++ # cool! 21:31
timotimo ooooh
arnsholt Neat
moritz++ # indeed 21:32
moritz timotimo: I've narrowed down the error in the EXPORT_hash branch 21:34
timotimo: when one exports a type object, and then references it, the QAST tree contains a QAST::WVal 21:35
and while that one is compiled, the serialization context is null 21:36
dalek : 493d9ef | (Pawel Murias)++ | Makefile:
add make test
moritz what I don't know is why
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
FROGGS pmurias: well no, I decided to create Perl6::P5World instead 21:38
21:39 cognominal joined
pmurias I'm considering if it would a good idea to change rakudo to delegate 'use v5' to v5.pm 21:41
dalek : d6bb78f | (Tobias Leich)++ | / (4 files):
pulled latest changes from rakudo and added P5World
: e94280c | (Tobias Leich)++ | test.pl:
add simple test script to track side effects
FROGGS pmurias: though I'm not sure my P5World's method isnt used 21:42
the error message "get_iter() not implemented in class 'NQPMu'" should be gone when running: perl6 test.pl 21:43
pmurias: well, currently it is a noop, why not change it?
so that it will be treated as a regular module
github.com/rakudo-p5/v5/blob/maste...ar.pm#L348 21:45
I guess I know, we never hit TOP
or do we?
hmmm, I'll check
pmurias we don't
the parsing starts from statementslist 21:46
I get the get_iter() error
FROGGS right, me too 21:47
moritz nqp: for NQPMu { say(42) } 21:50
p6eval nqp: OUTPUT«get_iter() not implemented in class 'NQPMu'␤current instr.: '' pc 52 ((file unknown):43) (/tmp/5A_CuTp4Bq:1)␤»
moritz that's how you get that error
FROGGS moritz: right 21:51
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:55
pmurias hmm, I'll have to check that 21:56
moritz masak: but multiple 'use' statements still do the import actions in each scope
r: { use Test; plan 1; }; { use Test; ok 1 };
p6eval rakudo 221a95: OUTPUT«1..1␤ok 1 - ␤»
moritz otherwise the second scope wouldn't have a sub &ok 21:57
masak oh, that's fine, then. 21:59
pmurias no it's not 22:03
I need to but the grammar changing code in EXPORT 22:07
&EXPORT
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?
it's easy enough to change, fwiw 22:09
pmurias the spec seems to imply that EXPORTALL is called as a method on the package 22:10
and EXPORTALL calls EXPORT
moritz which is unfortunate, because you can't call methods on packages
only on classes
anyway, easy to fix: move the if +@positional_imports { ... } into the else-clause with the nqp::die(...); 22:12
then &EXPORT is always called when it exists
I'm going to do that in the EXPORT_hash branch, and eventually it'll hit nom 22:13
if you need it earlier, I can do it in nom too
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
masak 'night, #perl6 22:30
22:30 geekosaur joined
FROGGS gnight masak 22:30
22:31 pmurias left, kshannon joined 22:32 pmurias joined 22:37 jkim joined 22:53 jkim left 22:56 colomon left 23:03 colomon joined 23:08 PacoAir left
timotimo r: <1 2 3>.join(",") 23:25
p6eval rakudo 221a95: ( no output )
timotimo r: say <1 2 3>.join(",")
p6eval rakudo 221a95: OUTPUT«1,2,3␤»
timotimo r: say ("foo" ~ $_ for <a b c d>).join(",") 23:26
p6eval rakudo 221a95: OUTPUT«fooa,foob,fooc,food␤»
timotimo ah, i had an item context going on 23:27
23:29 pmurias left 23:31 census left
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:32
23:40 sftp joined
timotimo ... whaaa?!? 23:59
Can not get attribute '$!signature' declared in class 'Code' with this object - in method new-leaf at src/gen/CORE.setting:440