»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
Zoffix Don't seem to have any package related to that on ubuntu fork that I use, sorry :/ No idea what that error is about. 00:00
When you figure out, maybe open a ticket for an LTA (Less Than Awesome) error message. There may be a way to make it more helpful.
huggable, rakudobug
huggable Zoffix, [email@hidden.address] or use perl6 query on rt.perl.org ; see github.com/rakudo/rakudo/#reporting-bugs
timotimo atweiden: your error comes from trying to Something::Something[$foo] where Something::Something isn't a role 00:26
m: Foo::Bar[1] 00:28
camelia rakudo-moar a4cc1c: OUTPUT«Could not find symbol '&Bar'␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
timotimo m: use NativeCall Foo::Bar[1]
camelia rakudo-moar a4cc1c: OUTPUT«===SORRY!===␤Could not find symbol '&Bar'␤»
timotimo m: use NativeCall; NativeCall[1] 00:29
camelia rakudo-moar a4cc1c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤NativeCall cannot be parameterized␤at <tmp>:1␤------> 3use NativeCall; NativeCall[1]7⏏5<EOL>␤»
timotimo hm
bioduds Im checking custom operators 00:40
very cool
so, I don't like the concatenation operator ~
I can have a custom operator that does the same as the ~ , right? 00:41
bioduds would that be simple to do? or would I need to rewrite the whole ~ operator? 00:41
timotimo no, you can just re-use the ~ operator to define your custom operator 00:44
m: my &infix:<++> = &infix:<~>; say "hello" ++ "world"
camelia rakudo-moar 547fc5: OUTPUT«helloworld␤»
timotimo here's an example 00:45
BBL
atweiden timotimo: the Something::Something[$foo] pattern DNE in my code 00:54
i'm unable to do this for instance `has TXN::Parser::AST::Entry::Posting @.posting is required;`
timotimo OK, how is Posting declared? and imported? 00:55
atweiden `use TXN::Parser::AST::Entry::Posting;`
which is a unit class
timotimo what's the unit class called exactly?
atweiden separate file
this is Entry.pm bitbucket.org/atweiden/txn-parser-...ew-default
Posting.pm bitbucket.org/atweiden/txn-parser-...ew-default
timotimo hm, interesting 00:56
timotimo m: class Foo { }; class Foo::Bar { }; class test { has Foo $.foo } 00:57
camelia ( no output )
timotimo m: class Foo::Bar { }; class Foo { }; class test { has Foo $.foo }
camelia ( no output )
timotimo m: class Foo::Bar::Baz { }; class Foo::Bar { }; class Foo { }; class test { has Foo::Bar $.foo }
camelia ( no output )
timotimo m: class Foo::Bar::Baz { }; class Foo::Bar { }; class Foo { }; class test { has Foo::Bar::Baz $.foo }
camelia ( no output )
timotimo strange 00:58
but i'll go to bed now, can't be of further assistance :(
dalek ateverable: 76a72a3 | (Aleks-Daniel Jakimenko-Aleksejev)++ | Bisectable.p6:
Oops
01:23
ateverable: 0868027 | (Aleks-Daniel Jakimenko-Aleksejev)++ | Bisectable.p6:
Oops
BenGoldberg m: enum <A B C>; say 3 * C; 01:41
camelia rakudo-moar 547fc5: OUTPUT«6␤»
BenGoldberg m: enum <A B C>; say 4 +| C; 01:41
camelia rakudo-moar 547fc5: OUTPUT«6␤»
SmokeMachine____ m: class Bind{has $.type}; my @a = Bind.new(:type(Int)), Bind.new(:type(Str)); @a.grep(*.type ~~ Str) 02:04
camelia rakudo-moar 547fc5: OUTPUT«Cannot use Bool as Matcher with '.grep'. Did you mean to use $_ inside a block?␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
SmokeMachine____ hi! whats wrong with that?
MasterDuke m: class Bind{has $.type}; my @a = Bind.new(:type(Int)), Bind.new(:type(Str)); @a.grep({ .type ~~ Str }) 02:08
camelia ( no output )
MasterDuke m: class Bind{has $.type}; my @a = Bind.new(:type(Int)), Bind.new(:type(Str)); say @a.grep({ .type ~~ Str })
camelia rakudo-moar 547fc5: OUTPUT«(Bind.new(type => Str))␤»
SmokeMachine____ but whats wrong with the * version? 02:09
bioduds thanks timotimo, youre the best
SmokeMachine____ m: my @a = ^10; say @a.grep: * %% 2 02:10
camelia rakudo-moar 547fc5: OUTPUT«(0 2 4 6 8)␤»
SmokeMachine____ m: my @b = Int, Str; say @b.grep: * ~~ Str 02:12
camelia rakudo-moar 547fc5: OUTPUT«((Str))␤»
SmokeMachine____ m: my @c = :type(Int), :type(Str); say @c.grep: *<type> ~~ Str 02:13
camelia rakudo-moar 547fc5: OUTPUT«Cannot use Bool as Matcher with '.grep'. Did you mean to use $_ inside a block?␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
dalek ateverable: 687c840 | (Aleks-Daniel Jakimenko-Aleksejev)++ | / (3 files):
Have only one list of releases

Changed 2016.07 to 2016.07.1. Also added 2016.08.1 which should be available shortly.
02:25
BenGoldberg m: sub foo($bar) { constant $baz = $bar; say $baz }; foo(1); foo(2); 02:39
camelia rakudo-moar 547fc5: OUTPUT«(Mu)␤(Mu)␤»
BenGoldberg m: enum abc <a b c>; constant bca = {abc.enums}.invert; bca{1}.say;
camelia rakudo-moar 547fc5: OUTPUT«Use of uninitialized value of type Any in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful. in block at <tmp> line 1␤5===SORRY!5=== Error while compiling <tmp>␤An exception occurred while…»
BenGoldberg m: enum abc <a b c>; constant cba = {abc.enums}.invert; say cba; 02:40
camelia rakudo-moar 547fc5: OUTPUT«Use of uninitialized value of type Any in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful. in block at <tmp> line 1␤5===SORRY!5=== Error while compiling <tmp>␤An exception occurred while…»
BenGoldberg m: enum abc <a b c>; constant cba = abc.enums; say cba;
camelia rakudo-moar 547fc5: OUTPUT«Map.new((:a(0),:b(1),:c(2)))␤»
BenGoldberg m: enum abc <a b c>; constant cba = abc.enums; say cba.invert; 02:41
camelia rakudo-moar 547fc5: OUTPUT«(0 => a 2 => c 1 => b)␤»
BenGoldberg m: enum abc <a b c>; constant cba = abc.enums.invert; say cba{2}; 02:42
camelia rakudo-moar 547fc5: OUTPUT«Type Seq does not support associative indexing.␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
BenGoldberg m: enum abc <a b c>; constant cba = abc.enums.invert.Map; say cba{2};
camelia rakudo-moar 547fc5: OUTPUT«c␤»
BenGoldberg m: enum abc <a b c>; sub foo { constant cba = abc.enums.invert.Map; say cba.WHERE }; foo() for ^20; 02:44
camelia rakudo-moar 547fc5: OUTPUT«139966692521064␤139966692521064␤139966692521064␤139966692521064␤139966692521064␤139966692521064␤139966692521064␤139966692521064␤139966692521064␤139966692521064␤139966692521064␤139966692521064␤139966692521064␤139966692521064␤1399…»
dalek ateverable: 326c44a | (Aleks-Daniel Jakimenko-Aleksejev)++ | Whateverable.pm6:
Restore SLIGHTLY-RESTRICTED setting

Guess what, we kinda lost it during the transition to Perl 6 bots.
In fact, now I see that not all of the things were restricted. Whoops!
Hopefully we will be able to get rid of it soon. See issue #25.
02:57
timotimo pff. yet another sleepless night apparently 03:13
avuserow_ is there a way to cast an integer to an int8 or similar? `$my-int.int8` doesn't seem to do it, any other ideas? 03:15
timotimo jnthn: i was wondering about exception handling with regards to a react/supply + whenever; if i have something like "whenever $socket.Supply -> { ... }" and the thing that creates the values throws an exception - like when it can't decode a string - how is the user supposed to signify she wants to catch/handle that exception?
m: my Int $foo = 999; say (my int8 $ = $foo)
camelia rakudo-moar 547fc5: OUTPUT«-25␤»
timotimo m: my Int $foo = 999; say (my uint8 $ = $foo) 03:16
camelia rakudo-moar 547fc5: OUTPUT«231␤»
timotimo m: await start { next };
camelia rakudo-moar 547fc5: OUTPUT«===SORRY!===␤next without loop construct␤»
timotimo m: await start { next }; CONTROL { default { .say } }
camelia rakudo-moar 547fc5: OUTPUT«===SORRY!===␤next without loop construct␤»
timotimo aaw
avuserow_ m: my Int $foo = 999; my $t = int8; say (my $t $ = $foo); # can I do the type indirectly? 03:18
camelia rakudo-moar 547fc5: OUTPUT«5===SORRY!5===␤Two terms in a row␤at <tmp>:1␤------> 3Int $foo = 999; my $t = int8; say (my $t7⏏5 $ = $foo); # can I do the type indirect␤ expecting any of:␤ constraint␤ infix␤ infix stopper␤ postfix…»
timotimo types of lexicals are compile-time constructs
m: my Int $foo = 999; constant $t = int8; say (my ::($t) $ = $foo); 03:19
camelia rakudo-moar 547fc5: OUTPUT«X::TypeCheck::Assignment exception produced no message␤ in block <unit> at <tmp> line 1␤␤»
timotimo m: my Int $foo = 999; say (my int8 $ = $foo);
camelia rakudo-moar 547fc5: OUTPUT«-25␤»
timotimo hum.
geekosaur well. that was "fun" 03:20
m: my Int $foo = 999; my $t = int8; say (my ::($t) $ = $foo);
camelia rakudo-moar 547fc5: OUTPUT«X::TypeCheck::Assignment exception produced no message␤ in block <unit> at <tmp> line 1␤␤»
geekosaur m: my Int $foo = 999; constant $t = int8; say (my ::($t) $ = $foo);
camelia rakudo-moar 547fc5: OUTPUT«X::TypeCheck::Assignment exception produced no message␤ in block <unit> at <tmp> line 1␤␤»
geekosaur m: my Int $foo = 999; BEGIN my $t = int8; say (my ::($t) $ = $foo); 03:21
camelia rakudo-moar 547fc5: OUTPUT«X::TypeCheck::Assignment exception produced no message␤ in block <unit> at <tmp> line 1␤␤»
geekosaur oh, hm, that wouldn't work anyway
m: my Int $foo = 999; BEGIN my $t = 'int8; say (my ::($t) $ = $foo);
camelia rakudo-moar 547fc5: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in single quotes; couldn't find final "'" ␤at <tmp>:1␤------> 3my $t = 'int8; say (my ::($t) $ = $foo);7⏏5<EOL>␤ expecting any of:␤ single quotes␤ …»
geekosaur er
m: my Int $foo = 999; BEGIN my $t = 'int8'; say (my ::($t) $ = $foo);
camelia rakudo-moar 547fc5: OUTPUT«X::TypeCheck::Assignment exception produced no message␤ in block <unit> at <tmp> line 1␤␤»
geekosaur feh
I get the idea, but that seems a bit LTA 03:22
avuserow_ okay. I'll investigate if this makes sense later. I'll work on the more interesting bit first :) 03:25
geekosaur well, as mentioned, it's compile time. but I do wonder if the compile time variants I tried should work 03:30
...in any case that exception kinda sucked; taking note, will rakudobug later when it doesn't take me 4 tries to type rakudo >.> 03:31
harmil Ah, I had another browser! :) 03:41
Anyone know why this never finishes the second "say" but the first works fine? my @N = 0..*; say @N.grep({.is-prime})[^20]; say @N.grep({(2**$_-1).is-prime})[^20] 03:42
Also, is there a timeout on the evalbot?
timotimo there is, yes
timotimo m: sleep 100; say "haha" 03:43
camelia rakudo-moar 547fc5: OUTPUT«(timeout)»
harmil m: my @N = 0..*; say @N.grep({.is-prime})[^20]; say @N.grep({(2**$_-1).is-prime})[^20]
camelia rakudo-moar 547fc5: OUTPUT«(2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71)␤(2 3 5 7 13 17 19 31 61 89 107 127 521 607 1279 2203 2281 3217 4253 4423)␤»
timotimo well, that seems to work
harmil Oh! So I need to update it seems
timotimo i can hardly believe 2 ** 71 - 1 is just 4423 03:44
timotimo m: say 2 ** 71 - 1 03:44
camelia rakudo-moar 547fc5: OUTPUT«2361183241434822606847␤»
timotimo it's ... not :)
harmil No, I think that's the 20th mersien (sp?) prime
timotimo oh, haha, you're not using the first list for the second %) 03:45
harmil No, just proving the first worked
geekosaur mersenne? 03:47
timotimo yeah, mersenne primes
harmil geekosaur: Probably. I'm as good at spelling as Perl is at ... okay, Perl is good at everything, but I had a point, dagnabbit! 03:48
timotimo harmil: if you want it to spit out new results until the timeout hits, you can ".say for" instead of "say (...)[^20]"
harmil In my install it was just hanging on the second one forever 03:49
rebuilding now
Nope, after rebuild (2016.08.1-21-g547fc51) the second expression still hangs... grrr 03:53
timotimo huh. i claimed json parsing took half of the time it takes to start gtk::simple, but now i'm only measuring about 10%?!? 03:55
timotimo OK, threw out some of the debug output and i'm back to the same measurement i had before 04:03
*phew*
oh, no, the difference is whether it's the first time after installing or a subsequent run
m: say 4 / 27 04:04
camelia rakudo-moar 547fc5: OUTPUT«0.148148␤»
timotimo 15% is still significant, though. on the first run, 50% of the start-up time can melt down bo about 1% of what it was, after that, 15% can melt down to about 1/37th of what it was 04:05
timotimo tries to sleep
geekosaur precomp? 04:10
Woodi m: say 24 / 7 06:18
camelia rakudo-moar 597052: OUTPUT«3.428571␤»
nadim Morning, I have to install a module by hand, rakudo/install/share/perl6/site seems to be the place (one o them) is there a need for a lib sub directory below that ? 07:11
lizmat would be surprised if there would need to be 07:14
nadim just tried doesn't work better than putting it there without the lib directory. I assume that module A::B would be installed under one of the 'paths P6 searches '/A/B.pm 07:16
dalek line-Perl5: 9828e67 | niner++ | / (2 files):
Add --test and --install options to configure.pl6

With this one can install Inline::Perl5 without any dependencies and without a module manager.
08:13
nine mst: ^^^
mst ooooo 08:14
masak m: grammar G { regex TOP { <blip>* }; regex blip { "b" (\d) } }; class Act { method TOP($/) { make $<blip>>>.ast }; method blip($/) { my $name = ~$0; make $name } }; G.parse("b1b2", :actions(Act.new)); .say for $/.ast
camelia rakudo-moar 945b91: OUTPUT«1␤2␤»
masak so far so good, but...
m: grammar G { regex TOP { <blip>* }; regex blip { "b" (\d) } }; class Act { method TOP($/) { make $<blip>>>.ast }; method blip($/) { my $name = ~$0; make class :: { method foo { $name } } } }; G.parse("b1b2", :actions(Act.new)); say .foo for $/.ast
camelia rakudo-moar 945b91: OUTPUT«2␤2␤»
masak I know there are some gotchas with creating classes inside routines, but... "2\n2\n"? 08:15
nine mst: hope this makes your work easier :) 08:17
masak I need to make this code not "stick" in the above way: github.com/masak/007/blob/18c61f17...#L253-L256 08:20
masak who would've thought that creating an anonymous class with an overridden ^name meta-method would come back to bite me in any way? :P 08:23
nine masak: you don't say?
masak I was very happy when I tried it an it solved all my problems 08:24
but yes, it was probably a nuclear chainsaw, in retrospect 08:25
what I really need is to lift 007 onto a proper MOP
mst masak: this is one of those times when my brain goes "y'know, string eval might've actually been less horrible" 08:28
masak mst: it was one of those "do I stop here and refactor, or do I just carve a peg of the exact shape that will work in this particular case?" kind of moments 08:30
so, yes, I have a MOP-overriding anonymous class in my code as a kind of technical debt
I seem to recall I started down the virtuous refactoring path first, but gave up because it was a lot of work 08:31
masak tries string EVAL
masak hey, that worked 08:33
m: say EVAL "42" 08:34
camelia rakudo-moar 945b91: OUTPUT«42␤»
masak also nice that constant strings can be EVAL'd now without hysterics :D
jnthn masak: From backlog: classes ain't closures. Just add an attribute to your anon class and throw a .new after it? :) 09:00
masak jnthn: aye, but I needed it to be a type object... 09:02
(for silly reasons)
jnthn oh
Then do a parametric role and pass it in is a parameter
masak hm :) 09:03
also need it to be a class, not a role... :P
(and please don't ask why, or I'll be ashamed)
masak anyway, that would have been a nice idea in a less debt-laden situation 09:04
jnthn masak: So call .^pun on the thing? :) 09:05
masak that... might work. 09:06
but I think it's time to gradually work my way out of the mess I created, instead of adding to it :P
jnthn Sounds like, yes :P :P
.oO( Can I offer you a technical mortgage? )
09:07
masak learns that closing a mortgage, either naturally bit by bit, or with a lump sum, is called "redemption" 09:09
time for some technical redemption...
El_Che I think DrForr is the next talk at yapc eu 09:10
is preparing is laptop
masak ooh
El_Che h
nadim nine: Hi, could we meet for 5 mn around lunch time, I need your help
masak watches the live stream at www.youtube.com/watch?v=A3ZSt5QKEAg 09:11
El_Che He jumped on the vim-as-slides bandwagon :) 09:12
he now pointing to #perl6 :) 09:13
masak waves back 09:14
El_Che (Danmark) 09:16
"Someone would correct me" :)
tadzik oh wow, an actual livestream :) 09:24
mst row, row, row your bloat, gently up the streeeeeam 09:27
jast down the stream is easier, though
masak .oO( please feel free to watch with me, but do *not* cross the streams )
jast and in my experience bloat takes the path of least resistance 09:29
masak interesting that DrForr++ lumps chaining comparison operators together with comparisons with junctions in them 09:50
masak oh, later the junctions show up. probably just a mis-slide, then 10:04
El_Che I hate the inbetween laptop setups
we've been mostly lucky at fosdem
melezhik HI all! 10:10
masak hi melezhik!
melezhik Does perl6 allow to have a conditional expressions which retrun a value? Like in ruby?
$a = if $b > 1 { 10 } else { 20 }
something like that ... 10:11
jnthn sure, though $a = $b > 1 ?? 10 !! 20 is a neater way
masak m: my $b = 5; my $a = do if $b > 1 { 10 } else { 20 }; say $a
camelia rakudo-moar 9ccd84: OUTPUT«10␤»
jnthn But they way you had it will parse if you stick "do2 before the if
*"do"
masak like that ^^^
melezhik jnthn, masak thanks, will try 10:12
masak melezhik: but yes, what jnthn++ said. ?? !! is the conditional operator. so unless you're doing something very funny, that's the one you want
melezhik yeah, I need really not a conditional operator
but let me try ... 10:13
masak m: say 1 R?? 2 !! 3
camelia rakudo-moar 9ccd84: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot reverse the args of because conditional operators are too fiddly␤at <tmp>:1␤------> 3say 1 R?? 2 !!7⏏5 3␤»
masak looks like we have a regression in that error message...
masak submits rakudobug
jnthn regression or was it ever right? :) 10:15
masak or never right, right. 10:16
melezhik_ "do" operator this is what I looked for, thanks 10:18
masak goodie. 10:21
though it's more of a statement prefix than an operator :) 10:22
along with `gather` and `once` and a few others
melezhik masak: sure
I just sometimes need a short way to evaluate some things depending on others ... was pretty sure that Perl has a syntax for this )))) 10:23
meant Perl6 of course 10:24
masak melezhik: currently fighting the impulse to tell you "yes, but experience tells me you probably do want ?? !!" 10:25
melezhik: I'll let you make your own choices ;)
melezhik masak: if "?? !!" allow me have a sequential statements like $a = ( ... ) ?? foo; bar; baz; !! foo; bar; baz 10:27
I am not sure 10:28
melezhik so this is why I am going to use $a = do if ... {} else {} 10:28
perlawhirl can I create a Subset type that does a Role? I know I can sub-Class an existing type, but I am being difficult :D 10:30
jnthn No.
perlawhirl ok 10:31
jnthn Subset types don't really "do" things, they're just meant as constraints.
perlawhirl yep, got it
trying to be too tricky for my own good
jnthn Note that an enum type can have extra roles applied :)
perlawhirl how's that go. short example, please? 10:32
jnthn enum Foo does SomeRole <Bar Baz>;
jnthn Something like that, iirc :) 10:32
perlawhirl ok, thanks i'll look into tit
er, *it
jnthn Pretty sure you can do that
Dunno if it's relevant to your problem :)
perlawhirl no, probably not, but interesting non-the-less 10:33
TimToady m: say infix:<X>() 10:48
camelia rakudo-moar 9ccd84: OUTPUT«(((Any)))␤»
TimToady someone should rakudobug that; really should return Empty instead of Any 10:49
m: say infix:<Z>() 10:50
camelia rakudo-moar 9ccd84: OUTPUT«()␤»
TimToady or it should just return that
DrForr masak: I know that chaining operators and junctions are differen, I just forgot to mention the proper names in the heat of the moment. 10:51
DrForr Did anyone else spot major problems in the talk? I'm going to use that kind of for the basis for my OSCON online training session. 10:55
(I'm also going to make sure I can wedge multiprocessing in - I'm going to take some time to actually learn the multiprocessing side. I want to throw that into talks, but I don't yet feel comfortable.) 10:59
perlawhirl DrForr: I didn't catch it all, my only minor crit is that I could feel the silence between your sentences... a little stilted. I'd suggest using some form of notes/flash cards ( if you don't already) which would also help out with forgetting the metion the proper names of things in the heat of the moment. 11:00
perlawhirl Content-wise, tho, I think it was good. 11:01
DrForr I was hoping to be able to split screens to have notes on my laptop, I have notes in a separate vim file.
DrForr Thanks. 11:03
perlawhirl ahh, projector setup woes can be a real pain 11:04
DrForr But yes, I should have flashcards or something. 11:05
DrForr The big part is I'm done, so I don't have to stress. 11:06
ab6tract o/ #perl6 11:09
DrForr Afternoon.
ab6tract .ask TimToady do you by any chance have the notes for your ballistic programming talk(s) online? 11:10
yoleaux ab6tract: I'll pass your message to TimToady.
ab6tract I cannot find anything but references to the dates of the talks.
But I remember joining #perl6 in 2008 or 2009, asking after the 'State of the Onion', and receiving a link to a video where you were already using this metaphor 11:11
This video is also, unfortunately, not possible to find now. Perhaps it was hosted on Google Videos back in the day.. 11:12
hi DrForr :D
for a talk on ballistics, it has left very little trace of itself 11:15
melezhik HI! Given a file path - "/foo/bar/baz/file.txt", how can I get directory name for this path? 11:26
I am sure there is a core module for this in perl6 ?
lizmat "foo/bar/baz".IO.dirname 11:30
melezhik lizmat: thanks!
sounds good - perl6 -e '"/foo/bar/baz".IO.dirname.say' ; I love when Perl6 has a foo-bar-baz.say to easy dump thing into console, it's very handy indeed! 11:32
)))
dalek line-Perl5: 7586745 | niner++ | / (3 files):
Separate configure.pl6 and make install

Now it's a sort of standardish: perl6 configure.pl6 make make test make install
11:34
ab6tract it's really unfortunate that all iterations of the talk are missing, because I think the metaphor is just really awesome 11:37
grondilu looked at create-moar-runner.pl and found $fh.print(sprintf(...)) kind of embarassing. 11:57
ab6tract also: I've got a sweet heisenbug but no time to golf it 11:59
does anyone have any pointers to resolving "pointer being freed was not allocated" (moarvm explosion) 12:00
pun intended
jnthn valgrind 12:02
dalek line-Perl5: 80d4ed3 | niner++ | .travis.yml:
Add new build step to travis config
12:09
ab6tract jnthn: hmmm.. valgrind does not provide any additional information in the crash case 12:12
melezhik anybody knows how to split long lines of code in perl6? 12:24
[Coke] finds coffee
melezhik 'foo' ~ 'bar' ~ .................... many many chunks ... ~ 'bar' 12:25
melezhik need to split it somehow and still keep it as single line 12:25
arnsholt Somehow, $work had a task where my work on NativeCall is super-relevant 12:27
arnsholt is more than a little surprised at this development
smls_ melezhik: Not sure what you mean. Can't just add newlines in between operators / method calls? 12:27
arnsholt Yeah, just add breaks where you want them 12:29
melezhik so, "/" is break symbol ?
smls_ no
arnsholt If you're coming from Python this may be odd, but since Perl has explicit statement terminators (the semicolons), you don't need to mark line continuations
smls_ statements don't end at newlines, they end at semicolon or closing bracket 12:30
arnsholt Or rather, explicit statement terminators that aren't newlines
melezhik arnsholt: got you, just add a new line where I need ... ok 12:31
arnsholt Yup! 12:32
melezhik thanks!
ab6tract melezhik: only caveat is -- you can't add a newline between an object and a method call, unless you use '\'
cygx o/ 12:34
smls_ say "foo"␤ .chars 12:35
m: say "foo"␤ .chars
camelia rakudo-moar 9ccd84: OUTPUT«3␤»
smls_ ab6tract: ^^ You can, since shortly before the 6.c release I think.
ab6tract well, i guess Tux was happy about that :)
smls_ You just can't mix that with method calls that *don't* have whitespace before them, in the same method chain
for precedence reasons that I don't quite understand 12:36
So that's the one case where you still need to escape the newline (and other whitespace) with \ 12:37
cygx m: (-10). abs .log . exp.say
camelia rakudo-moar 9ccd84: OUTPUT«10␤»
smls_ huh 12:38
did that change too?
smls_ nice :) 12:39
jnthn m: say [~] 'omg', 'wtf', 'bbq' # you can also reduce on ~ rather than putting it between all the things, which may be neater. 12:40
camelia rakudo-moar 9ccd84: OUTPUT«omgwtfbbq␤»
melezhik ab6tract: got you 12:41
ab6tract melezhik: well, it turns out I'm wrong according to the released version :) 12:42
melezhik ab6tract: not going to use with methods calls, so it's ok ;)))
melezhik one simple question 12:44
I use sub MAIN to handle command line args, it's ok 12:45
melezhik but I want to pass args like --foo bar 12:45
melezhik now I only have a choice to --foo=bar 12:45
and my tab completion becomes useless ))); 12:46
adrusi .
Xliff melezhik: You aren't forced to use signatures in MAIN. You can use @*ARGV 12:47
perl6maven.com/parsing-command-line...ents-perl6
melezhik Xliff: not sure If I get you ... 12:48
Xliff Actually it's ARGS, not ARGV.
melezhik: vv
perl6 -e 'say @*ARGS.perl' --one two 3
["--one", "two", "3"]
melezhik ok, let me show my code then ... 12:49
sub MAIN (
Str :$host!,
Str :$http_proxy,
Str :$https_proxy,
Str :$ssh_user,
Str :$ssh_private_key,
Int :$ssh_port = 22,
Bool :$verbose = False,
Xliff Ack! NOOO
melezhik Bool :$bootstrap = False,
Str :$module_run
)
what?
Xliff melezhik, please use fpaste or a gist
Do NOT spam channel with code.
melezhik ah, ok, sorry
why it is a spam? only a small code snippet
ok I will give you a link then 12:50
Xliff Anything more than 4 lines is a spam.
melezhik ah, ok 12:50
tadzik it makes reading the backlog less nice
melezhik no problem, sure
Xliff Use fpaste.scsys.co.uk
melezhik github.com/melezhik/sparrowdo/blob...wdo#L5-L18
this is my MAIN sub 12:51
and it works fine
but as I told I can't use --foo bar notation
tadzik anyway, I think you'll need a custom MAIN helper to allow the form that you're used to
Xliff Yeah, but if you want the "--foo bar" form of argument, you will need to handle @*ARGS on your own.
tadzik there are a few modules that do wacky stuff with MAIN and getopt-like things, maybe one of them does that already
melezhik so it can't be adjusted out of the box by MAIN means?
tadzik I don't think my one does 12:52
Xliff I do understand about tab completion, though. Using "=" kills it.
melezhik ah, ok
sure
= is the problem
Xliff melezhik, there is this -> github.com/Leont/getopt-long6 12:56
But it is not documented very well. Use with care.
melezhik Xliff: thanks for sharing info
generally code perl6 MAIN is fine foe me, but it don't respect spaces for parameters 12:57
tadzik MAIN feels to me like one of those things that should've evolved in module space first, and after a while a particular implementation ought to be spec...ulated 12:59
Xliff tadzik: Yeah. It would be nice to be able to add to the auto-generated usage output. Or have a mechanism to bypass it altogether. 13:00
tadzik it seems like MAIN was designed to to replace dozens of different getopt handlers that people used in perl 5, but in practice ends up being mostly good for prototyping cli apps, and eventually being replaced with something that puts more focus on the shell calling conventions than perl6's
Xliff: I think you may be able to do that with some callsame magic
have your own USAGE call back to the original USAGE 13:01
Xliff Hmmm...
Is it a hidden sub USAGE {} ?
Don't mind me and my fancy parens.
tadzik not really hidden
Xliff Well... auto generated? Part of CORE:: ? 13:02
I'll have to look into the possibilities. Thanks, tadzik++
tadzik github.com/rakudo/rakudo/blob/nom/...in.pm#L163
I'm not sure if it's part of the official API 13:03
so to say
but you can totally call it yourself, override etc
Xliff LOL
"TODO: ... Make $?USAGE available globally" 13:04
So it might Not Be There, Yet.
tadzik hm 13:04
Xliff At any rate, stomach is complaining. Time to lie back down. 13:05
tadzik I'm afraid you may be right 13:06
dalek osystem: 17987ad | (Alexey Melezhik)++ | META.list:
Fetch remote file using http.
13:25
osystem: 1b8fa92 | (Zoffix Znet)++ | META.list:
Merge pull request #242 from melezhik/master

Add Sparrowdo::RemoteFile to ecosystem.
Fetch remote file using http: github.com/melezhik/remote-file/
arw hi all. beginners question, why does this just output (Any) instead of a parse tree? pbot.rmdir.de/lY8MazWC7NZHfyROEtSuig 13:43
timotimo because it didn't parse correctly :) 13:44
have you tried either perl6-debug-m (after installing the necessary user interface module) or Grammar::Tracer or Grammar::Debugger? 13:45
arw not yet, but I was going to ask for something like that. thanks alot!
timotimo ah, your key and value tokens would blow things up
you see, token won't backtrack, as the default for "token" is to have :ratchet set to "on" 13:46
m: say "schlonz='fooooo'" ~~ / \w* /
camelia rakudo-moar 9ccd84: OUTPUT«「schlonz」␤»
timotimo oh, sorry, \w won't match a =
so that's not a problem
timotimo .o( es gibt ja so viel wissenswertes über erlangen ) 13:47
smls arw: The Grammar::Debugger module is useful for finding out why a grammar doesn't match 13:49
TheLemonMan hmm, can you use that to debug rakudo's grammar too ? 13:50
smls just install it with zef or panda, and the call your script with «perl6 -MGrammar::Debugger script.p6»»
TheLemonMan: dunno
leont Xliff, melezhik: haven't touched it in a while, but it should work and if it doesn't I will fix it
smls arw: It's super simple to use... just keep pressing enter when you run it, and it'll take you through the parse step by step. 13:51
timotimo TheLemonMan: unfortunately, rakudo's grammar is NQP code, which the Grammar::Debugger doesn't support
and we don't have something like perl6-debug-m for nqp
TheLemonMan eh, that's unfortunate 13:54
timotimo it's possible to build, but probably quite finnicky
what with nqp being "not quite" perl6 13:55
bdmatatu Hi all. I'm having trouble adding actions to a slang. Here's a simple case trying to make a synonym for 'do' -- git.io/v6Fic 13:58
smls arw: (Sorry for the delay, was afk) In this case, the problem is the \n at the end of rule empty_line and rule key_value rannot match, because the newline was already eaten by the <ws> (implicit whitespace matching in rules) 14:07
nine nadim: have a look at github.com/rakudo/rakudo/commit/6a...89ea7d6968 14:08
smls And yes, writing Perl 6 grammars for line-base (or partially line-based) formats is more cumbersome than it IMO should be.
nine nadim: raccoon is really a baby raccoon now :) 14:09
smls I think it shows that the grammars feature was for years mainly tested (and refined in a feedback loop with) Rakudo itself, and thus is best at matching free-form languages. 14:10
jnthn It's easy enough to redefine ws :) 14:11
We even provide ww if you want that part of the semantics and then different whitespace
smls jnthn: Not *that* easy actually, to recreate what <ws> does for boundaries between word vs non-word characters 14:12
oh? tell me more about ww
p6doc search doesn't find it 14:13
jnthn ww means "between two words"
m: say 'ab' ~~ /. <ww> ./ 14:14
camelia rakudo-moar 6ae6ec: OUTPUT«「ab」␤ ww => 「」␤»
jnthn m: say 'a+b' ~~ /. <ww> ./
camelia rakudo-moar 6ae6ec: OUTPUT«Nil␤»
jnthn So you could do something like token ws { <!ww> | \h+ } 14:14
smls ah, that does make it easier to write a horizontal-only <ws>
jnthn Could do with being doc'd too, apparently :) 14:15
smls yeah
arw smls: ah, thx. 14:17
smls Hm, is it possible that p6doc does not document built-in tokens other than <ws> at all?
arw smls: i'm currently still waiting for rakudobrew to build.
smls alnum gets no hits either
arw smls: but shouldn't my redefinition of <ws> take care of that? 14:20
ugexe strange, i could have swore they were because I remembering seeing <dot> documented but not implemented but I dont see anything but <ws> either 14:20
smls arw: Oh, I missed that. Hm.
smls arw: Oh, it's the <comment> rule that eats the whitespace on the following empty line 14:25
smls Because <ws> matches after the \n in rule comment 14:26
smls That means that having each rule that represents a line start with ^^ and end with \n is no good 14:28
[Coke] DrForr: can you verify if #125290 is still an issue for you?
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=125290
timotimo nine: do we have some semblance of a solution for deciding resources during Build.pm run time?
smls arw: because the implicit <ws> after the \n of one rule will eat indentation of the next line and prevent the ^^ from matching in the next rule 14:29
smls arw: Removing all the ^^ makes it match 14:32
Of course it's kinda weird to have each "line" match also contain the indentation of the line that follows it 14:33
arw smls: would that also happen if everything were token {} instead of rule? 14:33
smls no, <ws> does not implicitly match in tokens, only rules 14:34
but then you'd have to manually match whitespaces inside of lines
arw hm, yes. but i've got it to work at least: pbot.rmdir.de/CTHRqJBM_1foixfNP1WaOA 14:37
thanks to everybody :) 14:39
smls I think I once managed to parse a line-based format using a token TOP { [ <line_a> | <line_b> ]+ %% [\n|$] } 14:40
or similar 14:41
but it required some tinkering too, 'til it worked
timotimo i, too, would prefer moving the end-of-line stuff out of the individual line pieces
smls and it's no good if the format is only partailly line-based
timotimo arw: you can have parenthesis around your stuff and just put :s at the beginning
that way you don't have to put <.ws> everywhere, but by snuggling the closing parethesis against the last bit of the regex, you can prevent an additional unwanted <.ws> from being auto-generated there 14:42
alternatively
lizmat tadzik: it's not too late:
$ perl6 -e 'sub MAIN($a) { say "$a" }' foo
foo
timotimo use rule and put (:!s '}')} or something at the end
timotimo tbh, i tend to use a loop over .lines for line-based formats more often than i maybe should ... 14:43
arw yes, but for that I could have used perl5 :) 14:44
timotimo with perl6, the code inside the for loop is much nicer, still :P 14:45
smls timotimo: putting the closing paren right after the \n is really ugly though
timotimo smls: yes
smls if unspace worked in regexes, one could write \n\
timotimo you can still match individual lines against perl6 regexes, of course
smls but it doesn't
timotimo oh, that'd be nice if it did, though
smls jnthn: ^^ see preceding descussion... it's not just the default <ws> alone that makes it difficult to get a working grammar for (partially) line-based formats 14:47
arw and I guess special rules for trailing whitespace or indentation would make things even more ugly 14:48
(regarding the magically inferred <ws> in rules)
TheLemonMan talking of <ws>...
m: say (sub (\ ) { }).signature
camelia rakudo-moar 6ae6ec: OUTPUT«()␤»
timotimo on a somewhat related note, i wonder if we'll find a developer who's interested in making :P5 work a bit better
TheLemonMan here the \<space> is eliminated even before reaching the grammar 14:49
smls TheLemonMan: that's how unspace is supposed to work, isn't it? 14:50
timotimo well, sub (\ ) is fine
what isn't fine is when you have something unspace-looking and it thinks it's an un-named sigil-less variable 14:51
TheLemonMan I was wondering if this behaviour is the intended one
timotimo unless ... maybe that's a feature?
TheLemonMan it becomes a problem if you add a return type annotation as it becomes sub(\ --> Mu) 14:52
[Coke] anyone who knows how wordpress works who can address RT #128664 14:54
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=128664
[Coke] I can't find where the template for the page that has the linked image is; I only see posts (which are just the body of each page, not including the header), and the media images, which are just pngs.
TheLemonMan m: say +(sub (\) { }).signature.params == +(sub (\ --> Int) { }).signature.params
camelia rakudo-moar 6ae6ec: OUTPUT«False␤»
timotimo m: say (sub (\ --> Int) { }).signature 14:55
camelia rakudo-moar 6ae6ec: OUTPUT«( --> Int)␤»
timotimo m: say (sub (\ --> Int) { }).signature.params.perl
camelia rakudo-moar 6ae6ec: OUTPUT«()␤»
timotimo m: say (sub (\) { }).signature.params.perl
camelia rakudo-moar 6ae6ec: OUTPUT«($ is raw,)␤»
timotimo m: say (sub (\ ) { }).signature.params.perl
camelia rakudo-moar 6ae6ec: OUTPUT«()␤»
timotimo well, with (\) you get the nameless sigil-less variable
m: say (sub (\--> Int) { }).signature.params.perl
camelia rakudo-moar 6ae6ec: OUTPUT«($ is raw,)␤»
timotimo and for some reason that also happens with \--> 14:56
ab6tract when trying to run perl6-valgrind-m, I get an error saying: Unhandled exception: failed to load library 'dynext/libperl6_ops_moar.dylib' 14:59
tony-o timotimo: making :P5 work better in what way?
ab6tract latest rakudo installed just a few hours ago via rakudobrew
timotimo tony-o: make it more compatible with pcre
tony-o i haven't looked at this in a while but HTTP::Server::Async is working 100% as expected and awesome 15:01
timotimo great!
tony-o timotimo: ah - that's probably not me :-)
timotimo jnthn has recently been putting in work in the reliability department 15:01
tony-o jnthn++
ab6tract tony-o: I looked into using Green recently, but it seems that it hasn't been upgraded to use the new Supplier/Supply style
tony-o ab6tract: i think i fixed it last week, someone entered a bug. i'll take a look right now though 15:01
tony-o well, in 4 minutes when siege is complete 15:02
timotimo doesn't even know what Green is
all i know is it's not easy being green
TheLemonMan timotimo, I suspect the '\ ' is being treated as it is in "\ " 15:02
ab6tract timotimo: tony-o's snazzy parallel testing framework
tony-o timotimo: ugexe.com/parallel-testing-and-a-pe...ilgrimage/ 15:03
repo is here: github.com/tony-o/perl6-green
TheLemonMan I suspected <ws> to be too greedy but it seems it's not the culprit
ab6tract tony-o: looks like it is passing the test suite and installing now. rad!
timotimo oh, that thing!
TheLemonMan: quoted strings are an entirely different language, though 15:04
tony-o any idea what this means?: Internal error: zeroed target thread ID in work pass 15:06
TheLemonMan timotimo, I tried tracking the grammar states during the parse and it seems to get from the opening ( to the closing ) without reaching the <parameter> state
it goes <signature> -> <ws> -> <before> -> <param_sep> -> <ws> 15:07
arw hm, strange. shouldn't rule foo {<ws><something>} be the same as rule foo { <something>}? 15:08
tony-o hiker is another project that i want to work on but i need some feedback other than 'i dont like mojolicious so i won't like that either' 15:09
timotimo tony-o: i never even used mojolicious :\
arw because somehow this leading whitespace in rule seems to be different: pbot.rmdir.de/2AEU1VcRz0WImbmd3yDNrQ 15:10
nadim nine: racoon++
smls arw: No,I think the space before the first thing in a rule does not call <ws> 15:11
nadim raccoon++ I mean, it's not so small we can remove letters out of it.
smls only spaces in between tokens, and after the last
timotimo what is raccoon?
tony-o timotimo: you probably wouldn't like it :-p
smls arw: See design.perl6.org/S05.html#line_1147
specifically, the "it ignores whitespace #1" 15:12
tony-o also interested in what raccoon is 15:13
arw smls: feels buggy somehow. or at least non-symmetric with the not-ignored trailing whitespace. 15:14
smls Yeah, I'm not a fan of the trailing <ws> either 15:16
nine timotimo: raccoon is nadim++'s alias for install-dist.pl. Because it's a bit like panda but much smaller ;) 15:21
timotimo oh, ok! 15:22
nine timotimo: you mean some declarative way to build native libraries? 15:22
timotimo not quite
have you seen what GTK::Simple does?
smls Besides making life hard for line-based grammars, the trailing <ws> also causes lots of repeated calls to <ws> which can't be good for performance
nine is having a look 15:23
timotimo smls: ah, because you tend to have calls to other things at the end of your regex, which may also have a <ws> at their end 15:24
perlawhirl hi perlers... oh good, we're talking regexen.
smls timotimo: That, and "<foo> <bar>" when foo has trailing <ws>
perlawhirl trying to match a symbol at left word boundary and it ain't working 15:25
m: say 'what about !this thing' ~~ m:g/ « '!' /;
camelia rakudo-moar 6ae6ec: OUTPUT«()␤»
timotimo ah, right
perlawhirl m: say 'what about !this thing' ~~ m:g/ « 't' /; # this works
camelia rakudo-moar 6ae6ec: OUTPUT«(「t」 「t」)␤»
perlawhirl m: say 'what about !this thing' ~~ m:g/ \s <( '!' /; # so does this
camelia rakudo-moar 6ae6ec: OUTPUT«(「!」)␤»
perlawhirl why not the first thing?
smls perlawhirl: Because there' no word boundary between the space and the ! 15:26
nine timotimo: WTF?
timotimo nine: exactly
timotimo nine: if the non-windows path wouldn't touch those .dll paths, installation would fail because file not found 15:27
if the dll paths were not in resources, windows wouldn't work because file not in resources
perlawhirl smld: so whats the best globally match '!here and !here' ? 15:28
m: '!here and !here' ~~ m:g/ [ ^ | \s <( ] '!' / # like this, i suppose ?
camelia ( no output )
perlawhirl m: say '!here and !here' ~~ m:g/ [ ^ | \s <( ] '!' / # like this, i suppose ?
camelia rakudo-moar 6ae6ec: OUTPUT«(「!」 「!」)␤»
nine timotimo: so we'd need some optional resources?
timotimo that'd be one way to make it work
another would be to allow Build.pm to change the info in Meta.json 15:29
timotimo which ... could be problematic, or maybe not 15:29
smls perlawhirl: <after [^|' ']> '!' should also work
perlawhirl smls: good-o. thanks
dalek ecs: 151d791 | (Zoffix Znet)++ | v6d.pod:
Revert "Forbid Bare C<\b> in Regexes"

This reverts commit b14828bb01abb7e659b9f1a4d43ba572d3a4f173. Per discussion with pmichaud++, this can be added right now, without waiting for 6.d:
  github.com/perl6/specs/commit/b148...t-18777938
15:30
smls perlawhirl: Or maybe <!after \S> i.e. "not after a non-whitespace character"
nine timotimo: no, no, if anything we're moving towards declarative solutions. Anything that depends on the reader of meta data being able to run Perl 6 code is going to hurt us in the long run
timotimo that's true 15:31
perlawhirl smls: Ah! yes, that looks to be a better fit
smls++
hoelzro o/ #perl6 15:40
nine timotimo: there's certainly a simpler hack for Gtk::Simple: just ship it with empty .dll files and only on Windows fill them with the downloaded content. That way installing them everywhere does no harm. 15:41
hoelzro that's what I do for my modules! 15:42
leont mauke++ # funny lightning talks are important too 15:50
kyclark Where does a regex modifier go to make the whole thing case-insensitive? 15:53
Wait, got it. 15:54
leont (wrong channel)
kyclark FWIW, for use in my MAIN signature this works: 15:56
subset SortBy of Str where * ~~ /:i ^keys?|values?$/;
but this does not:
subset SortBy of Str where * ~~ m:i/^keys?|values?$/;
Skarsnik timotimo, why it's not up to the module manager to download extra ressources? 15:57
nine Skarsnik: yes, that's what I'm getting at. With a declarative way of specifying those resources, it would be the module manager's job. 15:58
skids kyclark: use /:i to embed the case sensitivity in the rx. m: is more a procedural style, and for carrying options that cannot go inside.
Skarsnik and for stuff like extern lib (in binding module) it should be an information in the meta file, as an extern dep or something, like to inform the user installing the module that will need something else x) 16:00
Skarsnik and Hello btw 16:01
nine Skarsnik: definitely. That's something even Perl 5 is still missing. I'd love to see a native-depends: ['freetype', 'gdk-3-0', ...] and smart module managers that know how to find them or download them for your system. 16:05
timotimo kyclark: m/foo/ is a command "execute this match right now", and then you smart match against the result of the match against $_ 16:17
kyclark: you could have used rx:i/.../ because that's just "a regex literal"
kyclark Ah, thanks for the clarification.
timotimo kyclark: but you don't need the * ~~, because the where clause is already applied by smart matching
kyclark ORLY? 16:18
timotimo so it'd end up doing $value ~~ (* ~~ /regex/) for you
yup
timotimo similar to the way "when" works. it also smart-matches for you 16:18
kyclark Heckin' sweet. 16:19
dalek c: 14e4a10 | (Tom Browder)++ | doc/Type/Signature.pod6:
correct grammat
tbrowder s/grammat/grammar/ 16:19
kyclark So I'm trying to show lots of different ways to accomplish the same idea (TIMTOWTDI and all), so can this be made better/shorter? 16:21
subset SortBy of Str where * (elem) <key value keys values>.Bag;
I also show the Unicode operator cuz that's cool
subset SortBy of Str where * ∈ <key value keys values>.Bag;
My favorite so far is: 16:22
subset SortBy of Str where * ∈ <key value keys values>.Bag;
oops
subset SortBy of Str where * ~~ /:i ^keys?|values?$/;
Because it's case-insensitive and handles singular/plural
Wait:
timotimo yes, smart matching against a Bag should give the same as * (elem) $the-bag
kyclark subset SortBy of Str where /:i ^keys?|values?$/;
kyclark m: 'key' ~~ <key value keys values>.Bag; 16:24
camelia ( no output )
kyclark m: say 'key' ~~ <key value keys values>.Bag;
camelia rakudo-moar 7fa2ba: OUTPUT«False␤»
kyclark m: say 'key' (elem) <key value keys values>.Bag;
camelia rakudo-moar 7fa2ba: OUTPUT«True␤»
timotimo huh 16:25
so i'm rong
nadim timotimo: it all boils down to pthreads which is called by libuv, so it's down to libc, except if we want to stop using libuv ;) 16:26
jnthn We don't.
nadim jnthn: that was understood :)
kyclark BTW, what's the name of ∈? 16:26
jnthn And even if we did we'd *still* need working threads :S
Do we have a workable workaround yet, fwiw? 16:27
nadim jnthn: build glibc with elision off
timotimo flip all tables.
jnthn nadim: I guess that's what other similarly affected projects are saying?
hoelzro timotimo: I tried your slang trick - works like a charm =)
nadim jnthn: there's an ubuntu request to be able to do that at run time, will probably not happen though 16:29
jnthn: other projects are saying nothing most of the time, so users are just rebuilding glibc. I would if the debian package system had broken dependencies 16:30
timotimo hoelzro: oh god what have i done! ;)
hoelzro sometimes I think that "use nqp;" should become "use magic;" =P 16:30
timotimo well, it's MONKEY-GUTS
timotimo i wonder if i can get some new performance opts into JSON::Fast 16:33
inspired by seeing how liz does it in the core code
timotimo nine: how do you feel about giving CU::R::Installation a little cache of json text to objects? it never modifies the objects that come out of the parse, right? 16:34
dalek c: a0fcd69 | (Tom Browder)++ | doc/Type/Signature.pod6:
correct grammar
16:35
hoelzro timotimo: ah, true 16:38
dalek c: 0022a87 | (Tom Browder)++ | doc/Type/Signature.pod6:
not sure what was intended, but rendered char looks wrong
16:41
timotimo nine: because it reads basically the same file over and over and over again when "use GTK::Simple"; the first time after installation it's responsible for 50% of the start-up time, after that it's a noticable bit less, but still a bunch 16:42
tbrowder kyclark: from wikipedia: 'The relation "is an element of", also called set membership' 16:47
perlawhirl is there an elegant way to delete an item from an array completely, ie, leave no empty container behind
m: my @a = <one two three>; @a[1] = |@; say @a;
camelia rakudo-moar 7fa2ba: OUTPUT«[one () three]␤»
perlawhirl i know i can do @a[*;*] or @a.map(|*)... but can i do while deleting? 16:48
timotimo you need to use the splice method 16:48
perlawhirl timotimo++
timotimo for most cases, that is 16:49
perlawhirl i did know that... but had conveniently forgot it
timotimo happens :)
perlawhirl timotimo: btw, re: smartmatching on Bag/Set... it's works on Hashes, so... maybe it should work on Bags/Sets too?... but i'm not a language designer 16:51
m: my $b = Bag.new(<larry curly moe>); say 'moe' ~~ $b; say 'moe' ~~ $b.Hash
camelia rakudo-moar 7fa2ba: OUTPUT«False␤True␤»
perlawhirl I guess it encourages use of the set op's
timotimo m: say 'key'.Bag ~~ <key keys value values>.Bag 16:53
camelia rakudo-moar 7fa2ba: OUTPUT«False␤»
timotimo mhh
arw ok, now i've got something parsed from my grammar. how do I get a nice usable data structure from that? 16:56
is .make the right thing to do? is there any documentation for that? 16:57
timotimo yup, make and .make are the right thing
it just sets the value of .made (aka .ast) on the result you've matched
harmil_wk arw: there are some sample grammars in the examples sections of the docs... sec... 16:58
examples.perl6.org/categories/parsers.html and especially examples.perl6.org/categories/parse...rings.html which demonstrates actions in a trivial case 16:59
smls arw: Here's a grammar I wrote that should hopefully be self-explanatory: www.reddit.com/r/dailyprogrammer/c...ma/cxyvo1r 17:00
timotimo JSON::Tiny also has a grammar + actions
arw thx, i'll read through it
smls arw: docs.perl6.org/language/grammars also has explanations 17:01
harmil_wk arw: However, in these cases, the parsed thing is a "value" In most real grammars you're going to want to build a real AST that represents expressions of operators of values and the like.
arw harmil_wk: yes. and sometimes I want to name a node of the ast after a value two levels down and stuff like that. 17:03
timotimo you can recursively access match objects
no need for every single object to have a .made
arw timotimo: yes, but i have difficulties getting further than the first level $stuff<foo>, and neither $stuff.perl nor $stuff.say are very helpful. 17:05
timotimo you can get their .keys and such if you want
arw ah
timotimo oh
best advice:
get Data::Dump::Tiny 17:06
no, wait
Data::Dump::Tree
harmil_wk timotimo: I think we're burying arw in examples... 17:06
arw maybe. and in general I think I don't know perl6 sufficiently to understand some of them. 17:07
timotimo D:D:T isn't meant as an example 17:08
it's perfect for outputting match objects
arw hm, yes, the test cases scrolling by look great :)
far better than perl5 Data::Dumper even
timotimo probably not far better than perl5 Data::Dumper::Tree, though :) 17:09
smls arw: Just use the hash subscript operator { } or < > on a Match object, to get the Match of one of its names subrules. 17:11
arw: If you have something like [<a> | <b>]+ and you need matches of a and b in the order they occured, use $/.caps (docs.perl6.org/type/Match#method_caps).
That's the gist of it :)
timotimo BBL 17:17
arw is there any equivalent to cpan.perl.org regarding the POD display for perl6 modules? 17:35
somehow modules.perl6.org only links to sources for stuff. 17:36
El_Che arw: not yet (work in progressI though). The best best is the README.md or the pods in the source 17:37
PaleZebra arw: modules.zef.pm/modules 17:45
arw PaleZebra: thx 17:47
seems like Data::Dump::Tree simply has no documentation.
PaleZebra arw: it's right there: github.com/nkh/P6-Data-Dump-Tree#usage 17:48
El_Che nice!
PaleZebra And it does show up here: modules.zef.pm/modules/Nadim%20Khem...Dump::Tree
arw PaleZebra: no, I mean "See lib/Data/Dump/Tree.pod for a complete documentation.". that just points to a useless pod
PaleZebra arw: well, it's this: gist.github.com/zoffixznet/552ca46...710ea1c327 17:49
arw: it's just GitHub doesn't know how to handle P6 pod. You might get docs with p6doc utility 17:50
modules.perl6.org/repo/p6doc
arw hm, okay, then its just github being weird.
smls m: dd; 17:51
camelia rakudo-moar 7fa2ba: OUTPUT«block <unit>␤»
smls ^^ I think that's new
(i.e. used to throw an error)
PaleZebra It dumps $?BLOCK now 17:52
m: sub foo { say "meow"; dd }()
camelia rakudo-moar 7fa2ba: OUTPUT«meow␤sub foo␤»
PaleZebra m: sub foo { say $?BLOCK }()
smls ah
camelia rakudo-moar 7fa2ba: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$?BLOCK' is not declared. Did you mean 'Block'?␤at <tmp>:1␤------> 3sub foo { say 7⏏5$?BLOCK }()␤»
PaleZebra or $?ROUTINE or whatever it is
smls m: sub foo { say &?BLOCK }()
camelia rakudo-moar 7fa2ba: OUTPUT«sub foo () { #`(Sub|60607664) ... }␤»
PaleZebra s: &dd 17:53
SourceBaby PaleZebra, Sauce is at github.com/rakudo/rakudo/blob/7fa2...ny.pm#L532
PaleZebra It's note .name ?? "{lc .^name} {.name}" !! "({lc .^name})" with callframe(1).code; 17:53
s: BagHash.new, "append", \(:42bar) 17:55
SourceBaby PaleZebra, Something's wrong: ␤ERR: Could not find candidate that can do \(:bar(42))␤ in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 29␤ in block <unit> at -e line 6␤␤
PaleZebra timotimo: ^ there's no candidate for it. But the issue you were having is giving a type object as the first argument so if the method is expecting an instance, it wouldn't be found
SourceBaby: help
SourceBaby PaleZebra, Use s: trigger with args to give to sourcery sub. e.g. s: Int, 'base'. See modules.perl6.org/dist/CoreHackers::Sourcery
arw somehow Data::Dump::Tree hates me: pbot.rmdir.de/QGFqF4zmBFL2BQgKIFWXbw 18:06
arw and without the role its useles because it shows only the first matching string... 18:07
[Coke] arw: that error makes sense to me; what is DDTR::MatchDetails ? 18:25
idiosyncrat_ Audrey Tang, who was so influential in both the Perl6 and Marpa communities is now a Minister of Digital in the Taiwanese government: focustaiwan.tw/news/aipl/201608250036.aspx 18:29
Officially it looks like she's a "minister without portfolio" 18:30
mspo mm perl packer
speaking of static linking and perl6 :)
idiosyncrat_ Surprising, but based on the link, no hoax, no joke. 18:32
arw [Coke]: according to the documentation a role for Data::Dump::Tree one should apply to change the output 18:33
Xliff m: say '\'' 18:34
camelia rakudo-moar 7fa2ba: OUTPUT«'␤»
arw [Coke]: see e.g. here: gist.github.com/zoffixznet/552ca46...p6-p6-L594 18:35
Xliff RabidGravy, you there? 18:50
RabidGravy I might be
Xliff I have X11, PanteraC and Crayola colors converted. :) 18:51
RabidGravy coolio
Xliff If you have other color options, let me know. Otherwise I will start getting this ready for the ecosystem.
There are some p6-isms I might need to take care of, too. 18:52
Just a heads up. I got your "DO EET" message in scrollback. I was already in the process of "doing it" when I got it. =)
smls m: say [Z] (<a b>, <x y>, <1 2>) 18:54
camelia rakudo-moar 7fa2ba: OUTPUT«((a x 1) (b y 2))␤»
smls m: say [Z] (<a b>, <x y>)
camelia rakudo-moar 7fa2ba: OUTPUT«((a x) (b y))␤»
smls m: say [Z] (<a b>,)
camelia rakudo-moar 7fa2ba: OUTPUT«((a b))␤»
smls ^^ TimToady, is that correct? 18:55
that edge-case means I can't use [Z] to transpose an array
smls because it doesn't return ((a) (b)) in the last, single-row case 18:58
gfldex smls: that's by design. Any reduction operator returns the single element given a single element list 19:00
smls gfldex: Even if the operator has a single-element overload?
gfldex m: say <a b> Z (); 19:01
camelia rakudo-moar 7fa2ba: OUTPUT«()␤»
[Coke] arw - that's a random gist by zoffix. 19:02
shouldn't you be looking at the Data::Dump::Tree docs?
gfldex m: say <a b> Z Empty;
camelia rakudo-moar 7fa2ba: OUTPUT«((a) (b))␤»
ugexe m: say reduce { $^a Z $^b }, (<a b>,) 19:03
camelia rakudo-moar 7fa2ba: OUTPUT«(a b)␤»
smls m: say &infix:<Z>( <a b> )
camelia rakudo-moar 7fa2ba: OUTPUT«((a b))␤»
[Coke] I don't see any reference to it here: github.com/nkh/P6-Data-Dump-Tree
and I suspect it was an abbreviation for Data Dump Tree that was not meant to compile.
smls m: say &infix:<Z>( (<a b>,) ) 19:04
camelia rakudo-moar 7fa2ba: OUTPUT«((a) (b))␤»
smls ^^ gfldex
gfldex smls: the zip operator on uneven lists is questionable to start with
smls If reduce called that, it would work out
arw committable6: the docs are raw.githubusercontent.com/nkh/P6-D...p/Tree.pod 19:05
committable6 arw, ¦«the»: Cannot find this revision
arw [Coke]: raw.githubusercontent.com/nkh/P6-D...p/Tree.pod
same docs from github
smls gfldex: Yeah, but the n=1 case is special - see the matrix transposition use-case I showed above
[Coke] arw: ok, that helps. that is defined in P6-Data-Dump-Tree/lib/Data/Dump/Tree/ExtraRoles.pm 19:07
arw [Coke]: the unabbreviated form gives the same error. and the examples use 'does DDTR::...': github.com/nkh/P6-Data-Dump-Tree/b...filter1.pl
[Coke] then try adding this to your script:
use Data::Dump::Tree::ExtraRoles;
arw [Coke]: works, thanks 19:10
[Coke] I think having 2 top level namespaces there where one is an obv. abbr. of the other. 19:13
... is not a good idea. but I don't care enough to open a ticket there.
smls gfldex, TimToady: I've used [Z] or `zip` to transpose n list of m lists before, and seen other people do so (e.g. on rosettacode). 19:16
I guess that means quite a few bugs out in the wild.
smls One wouldn't expect the n=1 case to fail while all other cases (including m=1 and n=m=0) work fine. 19:17
Would anything break if reduce were taught to call &infix:<op>( $a, ) if it supports being called with one arg? 19:18
hoelzro is there a way to ask a CallFrame if it's a "low-level" (as in from rakudo code) one? 19:20
smls m: say &infix:<+>(4)
camelia rakudo-moar 7fa2ba: OUTPUT«4␤»
smls looks like basic math operator handle it fine 19:20
smls If it couldn't be done for `reduce &foo, ...` in general, maybe just for those cases where &foo is an operator? 19:22
Those are already special-cased anyway, for the associativity and identity stuff 19:23
smls "couldn't be done" because of backwards compatibility concerns, I mean. 19:25
[Coke] arw: thank you for being patient with me, by the way, as I caught up to where you were. 19:45
timotimo i've been AFK for a long time, how's things with arw going? 19:46
[Coke] timotimo: he needed a 'use' that was missing in the docs.
timotimo oh
[Coke] otherwise that extra role wasn't ins cope
so, unstuck for a bit, I thikn. 19:47
ajr_ This code is wrong: say "or edited, " ~ sprintf("D6.2", $circ); but it produces an interesting result 20:13
The circumference of a 12.5mm tuit is 78.5398163397448 Your printf-style directives specify 0 arguments, but 1 argument was supplied in any at /home/guru/rakudo/rakudo-star-2016.07/install/share/perl6/runtime/CORE.setting.moarvm line 1 in any panic at /home/guru/rakudo/rakudo-star-2016.07/install/share/nqp/lib/NQPHLL.moarvm line 1
The more nearly correct I get the mask, the more elaborate the message. 20:14
ajr_ The "panic" makes me wonder if I've found a bug? 20:14
The "circumference" line is from a previous, valid, statement. 20:16
harmil_wk m: say "foo {sprintf "D6.2", pi}" 20:17
camelia rakudo-moar 7fa2ba: OUTPUT«Your printf-style directives specify 0 arguments, but 1 argument was supplied␤ in any at /home/camelia/rakudo-m-inst-2/share/perl6/runtime/CORE.setting.moarvm line 1␤ in any panic at /home/camelia/rakudo-m-inst-2/share/nqp/lib/NQPHLL.moarvm line 1…»
harmil_wk Yep, that looks like something to rakudobug 20:18
harmil_wk But it's really just an error message generation issue. The initial error is correct. 20:18
ajr_ bug report sent. 20:31
timotimo i don't get it, what's wrong about the error? 20:54
nine timotimo: actually I do have ideas that would allow us to skip parsing the JSON altogether unless someone really accessed the meta data through $comp-unit.distribution. 20:55
geekosaur for one, I see only mentions of internal locations...
jnthn nine: What operations need parsing JSON these days? 20:57
harmil_wk Just FYI: getting Internal error: Unwound entire stack and missed handler in some code that's mixing Promises and catching errors from tests. Not sure if it's trivial to reproduce, though...
jnthn harmil_wk: Hm, it should usually manage better than that. The one case I know of that fails that way is in nativecall callbacks. 20:58
harmil_wk It's not reliable right now, but I can try to isolate a repeater later 20:59
nine jnthn: we already have :ver, :auth: and :api in the short name lookup files. Ironically the one piece missing is the name of the source file which would be ridiculously simple to add :)
jnthn: we also parse the JSON when someone accesses %?RESOURCES
geekosaur remembers to file LTA for last night's fun 21:03
jnthn nine: ah, OK :) 21:06
jnthn nine: Was gonna say, I hope the common case didn't need it :) 21:06
nine jnthn: still does. Doesn't actually need to. Maybe if tomorrow my brane is still not up to debugging the remaining lexical_module_load failures, I'll give it some love. 21:09
I've already done a bunch of LHF for that reason today and it's not exactly a disadvantage :)
jnthn :) 21:12
But of the whole reason for the short files was to not need to parse JSON in the common cases :) 21:13
s/But of//
nine To not have to parse the JSON of all the dists to find the right one. At least I didn't read it as going one step further and not having to read the JSON for the winning dist :) 21:16
jnthn Ah, that's what I'd originally intended :) 21:18
nine Better late than never ;) And I'm glad there's still sooo low hanging fruit around for speeding up module loading :) 21:23
dalek c: c81cb65 | (Tom Browder)++ | doc/Language/quoting.pod6:
add example of an interpolating heredoc
21:29
Hotkeys tfw discord doesn't have perl6 highlighting 21:33
dalek c: 0762134 | (Tom Browder)++ | doc/Language/quoting.pod6:
add missing 's'
21:41
harmil_wk Looks like CompUnit::Util has rotted I'm getting "Method 'sink' not found for invocant of class 'NQPMu'" trying to install it. 21:44
Is there a different way to re-export an imported module's exportables? 21:45
Strangely it shows as currently passing on the modules list 21:46
hoelzro awwaiid++ # REPL fixes 22:15
awwaiid hoelzro: github.com/rakudo/rakudo/pull/847 uses the special return value to handle 'last' in REPL. Had to do some weird things
heh
profan is there any lib to use for p6 today that just lets you set up a really simple webserver which .. works? basic routing, etc
just went through one which the examples in it don't run on the latest perl6 22:16
awwaiid profan: I used bailador previously, but haven't recently, and it came with something. Might have been single-threaded though 22:17
profan it's ok if it's single threaded as long as there's something that works :p
bailador looks promising, thanks :) 22:18
dalek c: c328b06 | (Tom Browder)++ | doc/Language/quoting.pod6:
correct chars which are known to need escaping
22:37
MasterDuke .tell kyclark /:i ^ keys?|values? $ / may not do what you want. the '^' and '$' don't distribute to the different values in an alternation. i suspect you want /:i ^ [key|value]s? $ / 22:57
yoleaux MasterDuke: I'll pass your message to kyclark.