Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-02-20

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 tbrowder how so?
00:01 AlexDaniel shell(“mkdir -p $whatever”), where $whatever can be $(rm yourimportantfile)
00:02 AlexDaniel you can try jumping through the hoops with some module that will attempt to quote things in your variable, but why bother?
00:02 AlexDaniel in perl 5 you'd use system() with multiple args, in perl 6 you use run
00:02 tbrowder um, i don't think shell mkdir will work if there is a file with same name
00:02 AlexDaniel and you're safe, almost!
00:03 AlexDaniel tbrowder: the problem is not in mkdir. The problem is that you've just passed an arbitrary string into your shell and this string can contain anything
00:04 AlexDaniel it can delete all your files or whatever
00:04 tbrowder i understand the security concerns mostly, but what options are there when you need to do it?
00:04 AlexDaniel system('mkdir', '-p', '--', $path) # perl 5
00:05 AlexDaniel run ‘mkdir’, ‘-p’, ‘--’, $path # perl 6
00:06 travis-ci joined #perl6
00:06 travis-ci Doc build errored. Wenzel P. P. Peppmeyer 'provide example for run'
00:06 travis-ci https://travis-ci.org/perl6/doc/builds/203273107 https://github.com/perl6/doc/compare/3085d7c9b6f5...4a33f5e85200
00:06 travis-ci left #perl6
00:06 IOninja mkdir $path # perl 6
00:06 AlexDaniel IOninja: yea sure, that's not the point :)
00:06 telex joined #perl6
00:06 geekosaur lots of p5 programmers never escape strings sent to the shell. lots of p5 programs have potential security holes as a result, especially if used in a web context
00:07 AlexDaniel which is why I tried to make shell less available so hard
00:07 * geekosaur got in the habit of religiously using Q even in quick one-offs, because p5's quotemeta just happens to do the right thing for POSIX shells
00:07 AlexDaniel geekosaur: it's not completely right, by the way
00:07 geekosaur (a little more than the right thing, but it can't introduce new problems)
00:08 AlexDaniel for example, it doesn't escape newlines correctly, if I'm not mistaken
00:08 geekosaur no, it screws up with single quoting, but usually I;'m using it in lieu of single quoting because the POSIX spec thereof has its own holes
00:12 ggoebel joined #perl6
00:14 AlexDaniel and note that if you're on the safe side and you always use run, you can still screw it up badly if you omit ‘--’
00:15 geekosaur yep, but that's only distantly related (it's not *shell* quoting)
00:16 AlexDaniel yes yes
00:16 AlexDaniel that's correct
00:20 ZzZombo hum... what exactly is QAST in slangs for? I seem to be missing something from the docs gfldex gave me regarding them.
00:23 xinming joined #perl6
00:23 IOninja ZzZombo: search Day 1 for QAST: http://edumentab.github.io/rakudo-and-nqp-internals-course/
00:26 retupmoca joined #perl6
00:40 tbrowder AlexDaniel: ok, say i commit to using run, is it ok to form the complete cmd string first, then use .words to form the array to feed to run?
00:40 AlexDaniel tbrowder: most likely not
00:41 AlexDaniel tbrowder: store your arguments in an array if you have to
00:43 AlexDaniel all these problems come from the idea that you put your stuff into one string and then somehow attempt to split it (whether by shell or yourself). Just keep them separate all the way through
00:45 aborazmeh joined #perl6
00:45 aborazmeh joined #perl6
00:49 IRCFrEAK joined #perl6
00:49 IRCFrEAK left #perl6
00:51 mawkish__ joined #perl6
00:55 mawkish__ joined #perl6
00:59 mawkish__ joined #perl6
01:03 mawkish__ joined #perl6
01:17 mawkish__ joined #perl6
01:23 bolangi joined #perl6
01:27 mawkish__ joined #perl6
01:36 BenGoldberg s: ((use NativeCall), (Pointer[Str]))[1], 'new', \()
01:36 SourceBaby BenGoldberg, Sauce is at https://github.com/rakudo/rakudo/blob/c1a0fa7/ces/51E302443A2C8FF185ABC10CA1E5520EFEE885A1 (NativeCall::Types)#L21
01:36 BenGoldberg ???
01:37 timotimo that ... is not a link that works
01:37 AlexDaniel :D
01:38 cibs joined #perl6
01:51 BenGoldberg m: my $s = "a_b"; my $b = "B".lc; $s ~~ s/_?$b//; dd $s;
01:51 camelia rakudo-moar c1a0fa: OUTPUT: «Str $s = "a"␤»
01:51 BenGoldberg m: my $s = "a_b"; my $b = "B"; $s ~~ s/_?$b.lc//; dd $s;
01:51 camelia rakudo-moar c1a0fa: OUTPUT: «Str $s = "a_b"␤»
01:52 BenGoldberg m: my $s = "a_b"; my $b = "B"; $s ~~ s/_?{$b.lc}//; dd $s;
01:52 camelia rakudo-moar c1a0fa: OUTPUT: «Str $s = "a_b"␤»
01:52 BenGoldberg m: my $s = "a_b"; my $b = "B".lc; dd $s ~~ s/_?$b//; dd $s;
01:52 camelia rakudo-moar c1a0fa: OUTPUT: «Match.new(ast => Any, list => (), hash => Map.new(()), orig => "a_b", to => 3, from => 1)␤Str $s = "a"␤»
01:52 BenGoldberg m: my $s = "a_b"; my $b = "B"; dd $s ~~ s/_?{$b.lc}//; dd $s;
01:52 camelia rakudo-moar c1a0fa: OUTPUT: «Match.new(ast => Any, list => (), hash => Map.new(()), orig => "a_b", to => 0, from => 0)␤Str $s = "a_b"␤»
01:52 BenGoldberg m: my $s = "a_b"; my $b = "B"; dd so $s ~~ s/_?{$b.lc}//;
01:52 camelia rakudo-moar c1a0fa: OUTPUT: «Bool::True␤»
01:53 BenGoldberg m: my $s = "a_b"; my $b = "B"; dd so $s ~~ s/_? {$b.lc}//;
01:53 camelia rakudo-moar c1a0fa: OUTPUT: «Bool::True␤»
01:53 BenGoldberg m: my $s = "a_b"; my $b = "B"; dd so $s ~~ s/_? {$b.lc}//; dd $s;
01:53 camelia rakudo-moar c1a0fa: OUTPUT: «Bool::True␤Str $s = "a_b"␤»
01:54 BenGoldberg m: my $s = "a_b"; my $b = "B"; dd so $s ~~ s/a_?//; dd $s;
01:54 camelia rakudo-moar c1a0fa: OUTPUT: «Bool::True␤Str $s = "b"␤»
01:54 BenGoldberg m: my $s = "a_b"; my $b = "a"; dd so $s ~~ s/$b_?//; dd $s;
01:54 camelia rakudo-moar c1a0fa: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '$b_' is not declared␤at <tmp>:1␤------> 3 $s = "a_b"; my $b = "a"; dd so $s ~~ s/7⏏5$b_?//; dd $s;␤»
01:54 BenGoldberg m: my $s = "a_b"; my $b = "a"; dd so $s ~~ s/{$b}_?//; dd $s;
01:54 camelia rakudo-moar c1a0fa: OUTPUT: «Bool::True␤Str $s = "a_b"␤»
01:54 BenGoldberg m: my $s = "a_b"; my $b = "a"; dd so $s ~~ s/{$b} _?//; dd $s;
01:54 camelia rakudo-moar c1a0fa: OUTPUT: «Bool::True␤Str $s = "a_b"␤»
01:55 * BenGoldberg wants to know why that's not doing what he's expecting it to do.
01:57 geekosaur m: my $s = "a_b"; my $b = "a"; dd so $s ~~ s/"$b" _?//; dd $s;
01:57 camelia rakudo-moar c1a0fa: OUTPUT: «Bool::True␤Str $s = "b"␤»
01:57 BenGoldberg Ok, thanks.
02:01 AlexDaniel m: my $s = "a_b"; my $b = "a"; dd so $s ~~ s/$b _?//; dd $s;
02:01 camelia rakudo-moar c1a0fa: OUTPUT: «Bool::True␤Str $s = "b"␤»
02:02 AlexDaniel m: my $s = "a_b"; my $b = "a"; dd so $s ~~ s/[$b]_?//; dd $s;
02:02 camelia rakudo-moar c1a0fa: OUTPUT: «Bool::True␤Str $s = "b"␤»
02:03 AlexDaniel m: my $s = "a_b"; my $b = "a"; dd so $s ~~ s/<{$b}> _?//; dd $s;
02:03 camelia rakudo-moar c1a0fa: OUTPUT: «Bool::True␤Str $s = "b"␤»
02:30 BenGoldberg m: my @args = 1..3; say @args.fmt: "%d,%03d,%3d"
02:30 camelia rakudo-moar c1a0fa: OUTPUT: «Your printf-style directives specify 3 arguments, but 1 argument was supplied␤␤»
02:31 BenGoldberg m: my @args = 1...3; say @args.fmt: "%d,%03d,%3d"
02:31 camelia rakudo-moar c1a0fa: OUTPUT: «Your printf-style directives specify 3 arguments, but 1 argument was supplied␤␤»
02:31 BenGoldberg m: my @args = 1..3; say @args.elems
02:31 camelia rakudo-moar c1a0fa: OUTPUT: «3␤»
02:33 AlexDaniel m: my @args = 1..3; say sprintf "%d,%03d,%3d", @args
02:33 camelia rakudo-moar c1a0fa: OUTPUT: «1,002,  3␤»
02:33 AlexDaniel BenGoldberg: you want [s]printf, not fmt
02:33 BenGoldberg Yeah, I realized that.  Silly me, not reading the docs ;)
02:34 AlexDaniel nowadays the docs are pretty good, by the way
02:34 BenGoldberg True, that.
02:36 AlexDaniel m: my @args = 1..4; say sprintf "%d,%03d,%3d", @args
02:36 camelia rakudo-moar c1a0fa: OUTPUT: «Your printf-style directives specify 3 arguments, but 4 arguments were supplied␤␤»
02:36 AlexDaniel m: my @args; say sprintf "%d,%03d,%3d", @args
02:36 camelia rakudo-moar c1a0fa: OUTPUT: «Your printf-style directives specify 3 arguments, but no argument was supplied␤␤»
02:36 * AlexDaniel wonders what is going to happen if an array with negative size is passed…
02:39 AlexDaniel c: 2016.02 my @a[-9223372036854775808,-2]; say sprintf "%d,%03d,%3d, @a
02:39 committable6 AlexDaniel, https://gist.github.com/6e516278130b3dbb02466900a2e71735
02:39 AlexDaniel c: 2016.02 my @a[-9223372036854775808,-2]; say sprintf "%d,%03d,%3d", @a
02:39 committable6 AlexDaniel, ¦«2016.02»: Your printf-style directives specify 3 arguments, but no argument was supplied␤ «exit code = 1»
02:40 AlexDaniel awwwwwwwwwwwwww
02:40 AlexDaniel wait
02:40 AlexDaniel but where's the line number
02:40 AlexDaniel ah, ok, RT #130506
02:40 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=130506
02:48 ilbot3 joined #perl6
02:48 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
03:13 adu joined #perl6
03:30 noganex joined #perl6
03:55 madgoat joined #perl6
03:55 madgoat left #perl6
04:22 quester joined #perl6
04:24 resol joined #perl6
04:29 BenGoldberg m: sub test { Proxy.new: GET => { say "in get" } }; my $test := test; say $test for 1..3;
04:29 camelia rakudo-moar c1a0fa: OUTPUT: «Required named parameter 'FETCH' not passed␤  in sub test at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
04:29 BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" } }; my $test := test; say $test for 1..3;
04:29 camelia rakudo-moar c1a0fa: OUTPUT: «Required named parameter 'STORE' not passed␤  in sub test at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
04:29 BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" }, STORE => { say "in store" } }; my $test := test; say $test for 1..3;
04:29 camelia rakudo-moar c1a0fa: OUTPUT: «in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤True␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤True␤in get␤in get␤in get…»
04:29 BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" }, STORE => { say "in store" } }; my $test := item test; say $test for 1..3;
04:29 camelia rakudo-moar c1a0fa: OUTPUT: «in get␤in get␤in get␤True␤True␤True␤»
04:30 BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" }, STORE => { say "in store" } }; const foo = test; say foo for 1..3;
04:30 camelia rakudo-moar c1a0fa: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Preceding context expects a term, but found infix = instead␤at <tmp>:1␤------> 3ORE => { say "in store" } }; const foo =7⏏5 test; say foo for 1..3;␤»
04:30 BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" }, STORE => { say "in store" } }; const foo = test(); say foo for 1..3;
04:30 camelia rakudo-moar c1a0fa: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Preceding context expects a term, but found infix = instead␤at <tmp>:1␤------> 3ORE => { say "in store" } }; const foo =7⏏5 test(); say foo for 1..3;␤»
04:30 BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" }, STORE => { say "in store" } }; constant foo = test(); say foo for 1..3;
04:30 camelia rakudo-moar c1a0fa: OUTPUT: «in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤True␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤in get␤True␤in get␤in get…»
04:30 BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" }, STORE => { say "in store" } }; constant foo = item test(); say foo for 1..3;
04:30 camelia rakudo-moar c1a0fa: OUTPUT: «in get␤in get␤in get␤True␤True␤True␤»
04:31 BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" }, STORE => { say "in store" } }; constant foo = item test(); foo = 5;
04:31 camelia rakudo-moar c1a0fa: OUTPUT: «in get␤in get␤in get␤Cannot modify an immutable Bool␤  in block <unit> at <tmp> line 1␤␤»
04:31 resol joined #perl6
04:31 BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" }, STORE => { say "in store" } }; constant Int foo = item test(); foo = 5;
04:31 camelia rakudo-moar c1a0fa: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Missing initializer on constant declaration␤at <tmp>:1␤------> 3RE => { say "in store" } }; constant Int7⏏5 foo = item test(); foo = 5;␤»
04:31 BenGoldberg m: sub test { Proxy.new: FETCH => { say "in get" }, STORE => { say "in store" } }; Int constant foo = item test(); foo = 5;
04:31 camelia rakudo-moar c1a0fa: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3t" }, STORE => { say "in store" } }; Int7⏏5 constant foo = item test(); foo = 5;␤    expecting any of:␤        infix␤        infix stopper␤        s…»
04:47 adu hi BenGoldberg
04:48 BenGoldberg Hello.
04:49 adu how goes?
04:55 [Coke] gfldex: I think you committed bdf8ca8c - why did you commit so many failing code snippets?
04:55 * BenGoldberg is writing a perl6 plugin for his favorite irc client, hexchat.
04:57 * BenGoldberg is wondering how to intercept prints to stdout, so they get printed to the window instead of the bitbucket.
04:58 Geth ¦ doc: a9b7d1e04f | (Will "Coke" Coleda)++ | doc/Type/Pair.pod6
04:58 Geth ¦ doc: remove trailing whitespace
04:58 Geth ¦ doc: review: https://github.com/perl6/doc/commit/a9b7d1e04f
04:58 Geth ¦ doc: b62e25b2b4 | (Will "Coke" Coleda)++ | doc/Type/Any.pod6
04:58 Geth ¦ doc: Skip all the new broken placeholder sigs
04:58 Geth ¦ doc:
04:58 Geth ¦ doc: These skips should be removed as part of completing the TODO
04:58 Geth ¦ doc: review: https://github.com/perl6/doc/commit/b62e25b2b4
04:58 Cabanoss- joined #perl6
04:59 [Coke] BenGoldberg: see https://github.com/jaffa4/string-stream
04:59 resol left #perl6
05:00 BenGoldberg What I meant was, do I just assign to $*OUT ?
05:00 awwaiid joined #perl6
05:01 Resol joined #perl6
05:04 [Coke] BenGoldberg: Yes - the README shows an example of how to do it for $*IN
05:04 Geth ¦ doc: 5929f94fab | (Will "Coke" Coleda)++ | 2 files
05:04 Geth ¦ doc: learn new words
05:04 Geth ¦ doc: review: https://github.com/perl6/doc/commit/5929f94fab
05:16 wamba1 joined #perl6
05:36 travis-ci joined #perl6
05:36 travis-ci Doc build passed. Will "Coke" Coleda 'learn new words'
05:36 travis-ci https://travis-ci.org/perl6/doc/builds/203325603 https://github.com/perl6/doc/compare/b62e25b2b42c...5929f94fab15
05:36 travis-ci left #perl6
05:36 ZzZombo joined #perl6
05:36 ZzZombo joined #perl6
05:40 samcv yay new words
05:43 travis-ci joined #perl6
05:43 travis-ci Doc build passed. Will "Coke" Coleda 'Skip all the new broken placeholder sigs
05:43 travis-ci https://travis-ci.org/perl6/doc/builds/203324399 https://github.com/perl6/doc/compare/4a33f5e85200...b62e25b2b42c
05:43 travis-ci left #perl6
05:44 [Coke] When poking at pod objects, can you get back at the original line number the text came from??
05:44 [Coke] I was hopig it'd be in the (e.g.) Pod::Block::Code object.
05:44 [Coke] *hoping
05:57 curan joined #perl6
06:06 holyghost joined #perl6
06:06 Todd joined #perl6
06:06 Todd Hi All
06:07 Todd I am confused as to how to get the local data and time.
06:08 samcv m: say $dt.now
06:08 camelia rakudo-moar c1a0fa: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '$dt' is not declared␤at <tmp>:1␤------> 3say 7⏏5$dt.now␤»
06:08 samcv m: say DateTime.now
06:08 camelia rakudo-moar c1a0fa: OUTPUT: «2017-02-20T07:08:27.631597+01:00␤»
06:08 samcv m: say time
06:08 camelia rakudo-moar c1a0fa: OUTPUT: «1487570920␤»
06:08 samcv m: say now
06:08 camelia rakudo-moar c1a0fa: OUTPUT: «Instant:1487570960.465280␤»
06:08 samcv Todd, seems like you're looking for DateTime
06:09 Todd Oh that was easy.  Thank you!
06:09 samcv :)
06:10 samcv m: my $now = DateTime.now(formatter => { sprintf "%02d:%02d", .hour, .minute }); say $now
06:10 camelia rakudo-moar c1a0fa: OUTPUT: «07:10␤»
06:10 samcv Todd, you can subtract DateTime objects too
06:11 Todd Cool.  What I wanted was to put the time on to a report I was generating.  The on line DateTime had my head spinning
06:11 samcv but i think that just gets seconds
06:11 samcv the doc page you mean?
06:12 masak Todd: any way you know we could improve the docs in this case?
06:13 masak m: say DateTime.now.timezone
06:13 camelia rakudo-moar c1a0fa: OUTPUT: «3600␤»
06:13 Todd https://docs.perl6.org/routine/DateTime
06:13 masak that's the URL, yes :)
06:13 masak what part of it had your head spinning?
06:13 Todd was where I was at.  An improvement would be to have a beginners section and then an advanced section.  What I saw blew my mind
06:14 Todd Jumping right into "class" is a refresher for those that already knwo what is going on.
06:16 masak how about https://docs.perl6.org/type/DateTime -- probably the page you tried to end up on
06:18 Todd that is better, but ...
06:19 faraco joined #perl6
06:19 faraco howdy
06:19 Todd method DateTime(--> DateTime), I have no idea what is meant by -->DateTime.  Is it calling itself?
06:20 Todd And, say Date.new('2015-12-24').DateTime  what is that all about.  Why twice and why is there a date in single quotes.
06:20 Todd This is what blows a beginner's mind
06:20 Todd Need a beginners section too
06:23 [Coke] --> is how to specify the return type in the signature
06:24 [Coke] (--> is searchable on the site, btw.)
06:24 Todd And to a dumb ass like myself, that means nothing.  That is why I need a beginners section before jumping into the complicated stuff.
06:25 [Coke] we definitely need topics for beginners. (the individual class pages are probably not going to be those pages)
06:25 [Coke] For now, feel free to ask questions here.
06:25 Todd Look back in this log.  I asked how to do it as I was confused.  Someone answered
06:25 Todd perl6 -e 'say DateTime.now;'
06:25 Todd It was that stinkin' easy!
06:28 Todd I might be a bit of a hard case.  I can not learn from takihg courses.  My head hits the table.  The only way I learn (programming) is to actually code something I need.  (I do have a background in serveral old languages, such as pascal and modula2.  I code a lot in bash too.))
06:29 Todd And one example trumpts 1000 words
06:33 Todd While we are on the subject, if I search for perl 6 stuff, I get swamped with perl 5 stuff.  Be nice if there was a way around that
06:33 BenGoldberg Search for "perl6" instead of "perl 6"
06:34 Todd I usually go to https://docs.perl6.org/ and use their search.  But sometimes the answer is too compliated for a beginner
06:34 Todd That is what I do
06:35 * BenGoldberg hmms....
06:35 Todd https://duckduckgo.com/?q=perl6+datetime&amp;t=ffab&amp;ia=software
06:35 gfldex Todd: you are talking to your Perl 6 search engine right now
06:35 Todd is a search for datetime
06:35 BenGoldberg So, what's a question which, on the docs.perl6.org site, has an overly complicated answer?
06:35 Todd yes I am.  Something you'd like me to try?
06:36 Todd https://docs.perl6.org/routine/DateTime
06:37 Todd is todays confusing result.  This is a refreshed for those who already know what they are doing.  It lacks a begeinners section
06:37 BenGoldberg It is a little bit confusing.  The web site lets you search for methods, classes, and lots of other types of things.
06:37 BenGoldberg It's not uncommon for a class's method to have the same name as another class.
06:38 BenGoldberg The method for taking a Date object, and creating a DateTime object out of it, is named DateTime.
06:38 Geth ¦ doc/coke/examples: e4c8c21cdc | (Will "Coke" Coleda)++ | 2 files
06:38 Geth ¦ doc/coke/examples: refactor so extract-pod can be used elsewhere
06:38 Geth ¦ doc/coke/examples: review: https://github.com/perl6/doc/commit/e4c8c21cdc
06:38 Geth ¦ doc/coke/examples: 1610498482 | (Will "Coke" Coleda)++ | 3 files
06:38 Geth ¦ doc/coke/examples: Run one example per test, not one file
06:38 Geth ¦ doc/coke/examples:
06:38 Geth ¦ doc/coke/examples: For #1194
06:39 Geth ¦ doc/coke/examples:
06:39 Geth ¦ doc/coke/examples: * Eliminate separate example extraction step
06:39 Geth ¦ doc/coke/examples: * Use the same extract-pod mechanism used by htmlify
06:39 Geth ¦ doc/coke/examples:   (gets us the same precompilation for unchanged source)
06:39 Geth ¦ doc/coke/examples: * When a test fails, output the original code snippet
06:39 Geth ¦ doc/coke/examples:   (Line number is desired, but isn't part of the Pod object)
06:39 Geth ¦ doc/coke/examples: review: https://github.com/perl6/doc/commit/1610498482
06:39 Todd Got to go.  Thank you all for the help!
06:39 BenGoldberg When you type into the search field on docs.perl6.org, many things appear, and we don't *yet* have a way of putting the most relevant things near the top.
06:40 samcv ^
06:40 samcv i hate when i type in the word verbatim, and i get like 30 results
06:40 samcv with the one i want at the bottom or just some random stop
06:40 samcv *spot
06:41 masak the word "verbatim" gives 30 hits? that doesn't sound quite right.
06:41 BenGoldberg We should sort by lexical distance, perhaps?
06:41 masak samcv: more seriously though, sounds like there ought to be some sort of relevance ordering
06:41 samcv i type in grep and it shows one of the results as `ge`
06:41 samcv which is like 2 letters different from grep
06:42 samcv seems it shouldn't show that result imo
06:42 samcv no not that word
06:42 samcv i used the word verbatim as a word, not as that word verbatim verbatim
06:43 samcv i mean making exact matches show at the top should be not hard either?
06:43 Geth ¦ doc: coke++ created pull request #1207: Coke/examples
06:43 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1207
06:43 BenGoldberg Also, there's the PageRank algorithm, and a simple sort by popularity.
06:44 [Coke] there is a ticket for improving the search results ordering, yes.
06:44 [Coke] (exact matches being the first part of that, yes)
06:44 BenGoldberg Basically, all the things which good search engines use in deciding what pages come up when someone types something, we can do.
06:44 * [Coke] hurls https://github.com/perl6/doc/labels/search
06:45 [Coke] having a "see all" would be nice (needs dynamic search or a search results page, which is one of the tix)
06:46 samcv so `ab` and `bc` have the same lexical distance from `abc` is that correct?
06:47 BenGoldberg Yes.
06:47 [Coke] I think "have a lexical distance from 'abc' which is less than some constant" is accurate and less strict.
06:48 masak I think "is it an exact match on a method name? then bring it to the top" would do wonders
06:48 [Coke] masak: #247
06:48 jonas1 joined #perl6
06:50 [Coke] also, feedback on the new examples PR welcome, thanks.
06:50 RabidGravy joined #perl6
06:51 [Coke] (also we're testing 3466 examples in the source, whee)
06:55 ufobat joined #perl6
06:56 mawkish__ joined #perl6
06:58 bwisti joined #perl6
06:58 darutoko joined #perl6
07:00 CIAvash joined #perl6
07:02 quester left #perl6
07:03 mawkish__ joined #perl6
07:10 labster joined #perl6
07:13 mawkish_ joined #perl6
07:13 travis-ci joined #perl6
07:13 travis-ci Doc build passed. Will "Coke" Coleda 'Run one example per test, not one file
07:13 travis-ci https://travis-ci.org/perl6/doc/builds/203338032 https://github.com/perl6/doc/compare/e4c8c21cdc51^...161049848273
07:13 travis-ci left #perl6
07:18 wamba1 joined #perl6
07:23 bjz joined #perl6
07:23 Actualeyes joined #perl6
07:23 mawkish_ joined #perl6
07:26 samcv imo would be nice if `ab` had a closer score than `bc`
07:26 samcv if it matched the start of something could weight a little higher
07:28 TimToady m: my %r; push %r <== a => 42, |('b' X=> 72, 89), |('c' X=> 1, 2, 3, 4); say %r
07:28 camelia rakudo-moar c1a0fa: OUTPUT: «{a => 42, b => [72 89], c => [1 2 3 4]}␤»
07:29 TimToady IOninja: note you can subvert the named param thing with feed operators as well
07:33 abraxxa joined #perl6
07:38 ccakes joined #perl6
07:40 mawkish_ joined #perl6
07:42 abraxxa joined #perl6
07:44 mawkish_ joined #perl6
07:48 mawkish_ joined #perl6
07:52 bolangi joined #perl6
07:53 vike joined #perl6
07:55 masak arnsholt: huh. I had no idea that C and Smalltalk were created in the same year.
07:56 masak well, hm. maybe that's bending it a little bit. but it could be argued.
08:00 mr-foobar joined #perl6
08:01 arnsholt Oh, fun!
08:01 arnsholt I usually say that Smalltalk is advanced future technology from the 1980s
08:02 arnsholt (Much like Unicode)
08:02 masak wow, and Coq is older than Haskell. didn't know.
08:02 arnsholt Possibly even neater!
08:02 masak arnsholt: back in the 1990s I heard that string theory was science from the 21st century that accidentally ended up in the 20th.
08:02 masak haven't heard that much lately though :P
08:03 arnsholt =D
08:03 masak arnsholt: advanced future technology, yes. but I remember delving into the Smalltalk metamodel as jnthn was reading the "Art of the Metaobject Protocol"
08:04 masak and my predominant thought was how inheritance-based it looked, and how that made it kind of rigid in a bad way
08:04 masak imagine doing the same with roles, I thought :)
08:08 arnsholt Yeah, I do miss roles occasionally
08:23 zakharyas joined #perl6
08:35 masak does the MOP allow you to emulate them?
08:36 masak ISTR roles (though called "traits") were invented in the Smalltalk continuity
08:36 arnsholt Yeah, you can probably bolt it on somehow
08:36 rindolf joined #perl6
08:39 arnsholt Yeah, I think I see how even
08:39 arnsholt Your class object can have an initializer (MyClass class>>initialize), which I *think* should be called at appropriate times
08:40 arnsholt You can then compose in your roles there
08:40 arnsholt Although you may have to take care to get things right when a class gets recompiled
08:45 cibs joined #perl6
09:04 andrzejku joined #perl6
09:06 dakkar joined #perl6
09:15 andrzejku hi guys
09:15 andrzejku :)
09:16 DrForr Mornin'.
09:17 andrzejku DrForr, I think Perl6 got capabilities for IoT
09:18 cschwenz joined #perl6
09:19 DrForr Yay!
09:19 andrzejku yeah
09:19 andrzejku :D
09:20 andrzejku I got an idea to make somekind of framework in Perl6 to make Perl6 services and protocol for IoT using XMPP
09:20 andrzejku and I think that's enough
09:23 andrzejku the next thing is what's the way to call perl from C++
09:26 wamba1 joined #perl6
09:30 cschwenz left #perl6
09:34 andrzejku is that even possible to embed perl6?
09:38 ZzZombo joined #perl6
09:38 ZzZombo joined #perl6
09:44 ZzZombo Remind me if there is a way to make associative container with preserved order of insertion?
09:57 bjz_ joined #perl6
09:58 jnthn andrzejku: I believe Inline::Perl6 is doing it somehow; I think the majority of work is done Perl 6 side using NativeCall
09:59 Woodi andrzejku: re embading perl6: I think not yet. but you can always use cooperating proceses via network, file or pipe
10:02 ChoHag joined #perl6
10:02 Woodi oops :)
10:02 Woodi andrzejku: don't listen to me then :)
10:03 Woodi ZzZombo: https://github.com/zostay/perl6-ArrayHash
10:03 andrzejku hi Woodi :D
10:03 andrzejku didn't see you for a long time
10:03 ZzZombo m: make 42;say $/
10:03 camelia rakudo-moar c1a0fa: OUTPUT: «Cannot bind attributes in a Nil type object␤  in block <unit> at <tmp> line 1␤␤»
10:04 ZzZombo y u no maek 42???
10:04 Woodi andrzejku: usually I'm in background, having output from #here :)
10:08 ZzZombo How the fuck does https://github.com/tony-o/perl6-slang-sql/blob/master/lib/Slang/SQL.pm6#L71 work?
10:08 ZzZombo m: class A { method foo { self."!bar"() };method !bar { say 'BARRED!' } };my $a=A.new;say $a.foo;
10:08 camelia rakudo-moar c1a0fa: OUTPUT: «No such method '!bar' for invocant of type 'A'␤  in method foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
10:12 mulk[m] left #perl6
10:12 Matias[m] left #perl6
10:18 nowan joined #perl6
10:19 obfusk joined #perl6
10:33 cibs joined #perl6
10:38 astj_ joined #perl6
10:45 bjz joined #perl6
11:04 wamba1 joined #perl6
11:10 espadrine_ joined #perl6
11:17 salva joined #perl6
11:22 SmokeMachine m: class A { method foo { self!bar };method !bar { say 'BARRED!' } };my $a=A.new;say $a.foo;
11:22 camelia rakudo-moar c1a0fa: OUTPUT: «BARRED!␤True␤»
11:23 SmokeMachine m: class A { method foo { self!"bar"() };method !bar { say 'BARRED!' } };my $a=A.new;say $a.foo;
11:23 camelia rakudo-moar c1a0fa: OUTPUT: «BARRED!␤True␤»
11:23 pyrimidine joined #perl6
11:23 SmokeMachine ZzZombo: 👆
11:27 astj joined #perl6
11:28 astj joined #perl6
11:33 bolangi joined #perl6
11:37 lukaramu joined #perl6
11:43 itaipu joined #perl6
12:15 sivoais joined #perl6
12:21 sufrostico joined #perl6
12:25 poska joined #perl6
12:26 poska hey. anyone tried successfully running the Perl6 version of Inline::Python on Windows?
12:30 lep-delete joined #perl6
12:33 Geth ¦ doc: ee05bc96ef | (Tom Browder)++ | doc/Type/Proc.pod6
12:33 Geth ¦ doc: shell also creates Proc.new
12:33 Geth ¦ doc: review: https://github.com/perl6/doc/commit/ee05bc96ef
12:40 jraglin joined #perl6
12:44 tbrowder .tell AlexDaniel i've started tweaking Proc docs based on discussions yesterday. what do think about adding a warning about  the dangers of using either run or shell?  if not in Proc, maybe in some other, more general place.
12:44 yoleaux tbrowder: I'll pass your message to AlexDaniel.
12:47 dogbert11 .seen RabidGravy
12:47 yoleaux 14 Feb 2017 19:36Z <IOninja> dogbert11: do you get any warnings about Failures in DESTROY when running this code on 32-bit box? https://gist.githubusercontent.com/zoffixznet/b7fe8919516ac0e2bb791e4a
12:48 yoleaux 14 Feb 2017 19:40Z <IOninja> dogbert11: previous URL seems busted; this one: https://gist.github.com/zoffixznet/b7fe8919516ac0e2bb791e4a664b2822
12:48 yoleaux I saw RabidGravy 19 Feb 2017 18:20Z in #perl6: <RabidGravy> yeah
12:48 MasterDuke joined #perl6
12:49 dogbert11 .tell RabidGravy do you remember what test(s) you're running when you got SEGV's with Squirrel? (RT #129946)
12:49 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=129946
12:49 yoleaux dogbert11: I'll pass your message to RabidGravy.
13:01 ZzZombo SmokeMachine: ??
13:01 ZzZombo $/.'!make'($block);
13:01 ZzZombo it's not the same as $a!"bar".
13:02 zakharyas joined #perl6
13:14 moritz $a!bar calls a private method
13:14 moritz $a.'!make'() calls a method whose first character is a !
13:15 ZzZombo how the crow do you even make a method to start with '!'?
13:16 moritz through the MOP, for example
13:16 tbrowder .tell AlexDaniel it looks to me like the args for run (and now shell) are in the wrong order. also, run needs to be shown as a method. also the sig for method shell looks wrong (incomplete).
13:16 yoleaux tbrowder: I'll pass your message to AlexDaniel.
13:16 moritz $class.^add_method('look, funny chars in here', method () { say 42 }
13:16 moritz )
13:16 IOninja nqp: class Foo { method !bar () { say(42) } }; Foo.new.'!bar'()
13:16 camelia nqp-moarvm: OUTPUT: «42␤»
13:17 SmokeMachine is there any http client on ecosystem that works with unix socket?
13:19 moritz you mean talking HTTP over unix socket instead of TCP?
13:19 moritz I'm not aware of one, though that doesn't mean much
13:20 araraloren joined #perl6
13:20 moritz I think our Apache does that, when you use mod_proxy with a socket
13:24 SmokeMachine moritz: yes... Im thinking of writing a docker api client...
13:24 SmokeMachine I think im trying use docker:from<Python> first...
13:25 * jnthn pondered doing a Docker client, then realized that yak would need shaving first...
13:25 moritz SmokeMachine: maybe investigate HTTP::UserAgent; it already does normal socket and SSL socket, maybe it's got the API already to plug in a custom socket
13:25 jnthn moritz: So far as I understand it (possibly incorrectly), we'd need to support domain sokcets
13:25 jnthn (at Perl 6 level)
13:26 SmokeMachine I searched by UNIX on its GitHub page... with no luck...
13:26 jnthn Guess I can see if I can sneak it in to IO::Socket::Async at some point...
13:27 SmokeMachine no luck installing Inline::Python... :(
13:31 lukiramu joined #perl6
13:36 Geth ¦ doc: efe309a2b5 | (Tom Browder)++ | doc/Type/Proc.pod6
13:36 Geth ¦ doc: put $cmd arg in right place
13:36 Geth ¦ doc: review: https://github.com/perl6/doc/commit/efe309a2b5
13:36 newbie1 joined #perl6
14:01 IOninja m: my %h = :.abs with 5; say %h
14:01 camelia rakudo-moar 80e0bc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Malformed initializer␤at <tmp>:1␤------> 3my %h = :7⏏5.abs with 5; say %h␤    expecting any of:␤        colon pair␤»
14:01 IOninja awww, I wish this were a shortcut as well :)
14:01 timotimo oh, like abs => $_.abs?
14:02 IOninja Yeah :)
14:02 perlpilot .oO( Why can't Perl just *know* what I want and do that?!? )
14:02 IOninja Yeah :)
14:03 Geth ¦ doc: bebafa50bf | (Tom Browder)++ | doc/Type/Proc.pod6
14:03 Geth ¦ doc: fix code format
14:03 Geth ¦ doc: review: https://github.com/perl6/doc/commit/bebafa50bf
14:06 sena_kun joined #perl6
14:06 sena_kun
14:08 IOninja
14:10 IOninja heh JSON::Tiny has a bug
14:10 IOninja star: use JSON::Tiny; say to-json [Inf, -Inf, NaN]
14:10 camelia star-m 2016.10: OUTPUT: «[ Inf, -Inf, NaN ]␤»
14:10 IOninja star: use JSON::Fast; say to-json [Inf, -Inf, NaN]
14:10 camelia star-m 2016.10: OUTPUT: «[␤  {␤    "0": null␤  },␤  {␤    "0": null␤  },␤  {␤    "0": null␤  }␤]␤»
14:11 IOninja :S
14:12 timotimo what, again?
14:12 timotimo also, not "JSON::Tiny has a bug", but "JSON::Fast has a bug"
14:12 IOninja They both have bugs.
14:12 IOninja JSON ain't got Inf -Inf or NaN
14:12 timotimo timo@schmand ~/p/e/json_fast (master)> perl6 -Ilib -e 'use JSON::Fast; say to-json [Inf, -Inf, NaN]'
14:12 timotimo [
14:12 timotimo Inf,
14:12 jnthn Apparently null is the correct answer
14:12 timotimo -Inf,
14:12 timotimo NaN
14:12 timotimo ]
14:12 IOninja I can't even fathom what JSON::Fast is doing.
14:12 timotimo oh F you, json :) :) :)
14:13 timotimo * 1fedaa3 - don't asplode when using to-json on a Num. (6 months ago) <Timo Paulssen>
14:13 timotimo that's what it is doing
14:13 timotimo can we get a newer json::fast into star?
14:14 timotimo do we have a simple "isnanorinf" thing?
14:15 IOninja nqp :)
14:15 timotimo right
14:15 timotimo what is the right answer for jsonifying -0e0?
14:15 IOninja .isNaN in Perl
14:15 IOninja dunno
14:15 IOninja IMO using Mojo::JSON as a reference is a good bet
14:15 samcv star-m: use JSON::Fast; say to-json([Inf, -Inf, NaN]
14:16 camelia star-m 2016.10: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' ␤at <tmp>:1␤------> 3JSON::Fast; say to-json([Inf, -Inf, NaN]7⏏5<EOL>␤»
14:16 samcv star-m: use JSON::Fast; say from-json(to-json([Inf, -Inf, NaN]))
14:16 camelia star-m 2016.10: OUTPUT: «[{0 => (Any)} {0 => (Any)} {0 => (Any)}]␤»
14:16 Geth ¦ doc: 50c88b6d53 | (Tom Browder)++ | doc/Type/Proc.pod6
14:16 Geth ¦ doc: correct @args position, grammar
14:17 Geth ¦ doc: review: https://github.com/perl6/doc/commit/50c88b6d53
14:17 ZzZombo wtf is that JSON?
14:17 timotimo stop beating that dead horse
14:17 timotimo that was fixed 6 months ago
14:17 ZzZombo oh, it's converted back to Perl.
14:18 jnthn timotimo: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf page 507
14:18 jnthn "NaN and In伀氂inity regardless of sign are"
14:18 jnthn represented as the String null.
14:18 samcv I have taken to saving stuff using .perl since i can just load it without a module :)
14:19 timotimo thank you
14:19 samcv assuming i don't need another program to use it
14:19 timotimo mmyes, 伀氂.
14:19 jnthn uh...that copy paste went weird...what happend to the f? :D
14:19 timotimo probably a pdf that uses ligatures
14:19 jnthn It's an f in the PDF
14:19 jnthn haha, yes
14:19 IOninja Well, that's pretty sucky
14:19 IOninja I don't want nulls
14:20 timotimo set $*FIGHT_THE_POWER = "yes", and json_fast will print these as is
14:20 samcv (Note that these two in伀氂inite Number values are
14:20 samcv produced by the program expressions +Infinity (or simply Infinity) and ‐Infinity.)
14:21 IOninja As is is broken.
14:21 IOninja Encode them as strings.
14:21 timotimo ugh, that's also weird
14:21 timotimo now a float turns into a string
14:21 skids joined #perl6
14:21 samcv jnthn, what's that you saying Inf and -Inf should be represented by null?
14:22 ChoHag joined #perl6
14:22 jnthn samcv: The ECMA standard that specifies JSON /o\
14:22 samcv that's depressing. you lose information
14:22 jnthn (Link just above where I said it)
14:22 samcv no i'm looking at it
14:22 IOninja Yeah, JSON sucks.
14:23 IOninja Time to start a new standard.
14:23 stmuk_ YAML!
14:23 stmuk_ oh wait maybe JSON isn't so bad :P
14:24 samcv +Infinity and -Infinity is what the standard says produces infinity and -infinity
14:24 samcv so idk
14:24 timotimo no, that's how you get that in javascript
14:24 samcv that's what i mean
14:24 samcv but json specifies you totally lose all meaning. ugh
14:24 timotimo yes, it does
14:25 samcv sad
14:25 mr_ron joined #perl6
14:25 samcv P6ON
14:25 samcv obviously the best object notation :)
14:25 IOninja "pee...six...on"
14:25 timotimo totally
14:26 timotimo with pair notation <3
14:26 IOninja :)
14:26 timotimo i love me some pair notation
14:26 IOninja Well, I'm going with .perl .EVAL for my thing. I need dem Infs
14:27 mr_ron left #perl6
14:28 mr_ron joined #perl6
14:28 stmuk_ EVAL is very slow .. p6doc uses it
14:28 ZzZombo Why panda > zef?
14:28 stmuk_ its a pity there isn't serialisation
14:28 IOninja ZzZombo: it isn't
14:29 sena_kun ZzZombo, zef > panda
14:29 ZzZombo oh, I meant the other way
14:29 stmuk_ actually wasn't there a moar serialisation or something branch once?
14:29 IOninja hm, yeah, EVALFILE is taking so long that I think it's stuck in a infiniloop
14:29 IOninja ZzZombo: because it's better,
14:30 samcv eval is so slow because it has to start up the whole parser again right?
14:30 ZzZombo what "rakudobrew rehash" is supposed to do?
14:30 sena_kun ZzZombo, zef's development is more lively + it has more features(afaik)
14:30 samcv what sena_kun said
14:31 ZzZombo yea, right
14:31 timotimo ZzZombo: it checks if there's any new scripts in "bin" folders and rebuilds the forwarder scripts
14:32 ZzZombo where do I get that command then?
14:33 timotimo "get that command"? i don't understand
14:33 timotimo if you're not using rakudobrew at all, you don't need to do anything
14:33 ZzZombo that's what I was told to do, so IDK.
14:33 timotimo told by whom or what?
14:33 cibs joined #perl6
14:33 ZzZombo App::Mi6 is not installed. Please type the following in your command line:
14:33 ZzZombo panda update
14:33 ZzZombo panda install App::Mi6
14:33 ZzZombo rakudobrew rehash
14:34 ZzZombo Atom plugin fr P6
14:34 samcv what are you trying to use ZzZombo
14:34 timotimo ah
14:34 ZzZombo for*
14:34 samcv i didn't have much luck with that one
14:34 timotimo just ignore the rakudobrew thing
14:34 samcv ZzZombo, i would check this out https://github.com/samcv/Atom-as-a-Perl6-IDE
14:34 itaipu joined #perl6
14:34 samcv i made a really nice thing on good atom plugins for Perl 6
14:34 samcv with instructions and everything
14:36 samcv and atom-perl6-editortools still points to the old syntax highlighter :(
14:36 samcv still tries to download the old one when i just tried to install it
14:37 IOninja 42s to EVALFILE a 72kb file with a dumped array in it :S
14:37 samcv :S
14:38 samcv ZzZombo, you still there?
14:38 ZzZombo yes
14:38 samcv ok. you checking out that github i linked you to
14:38 ZzZombo yea
14:39 samcv should make sure language-perl6fe is uninstalled before installing the syntax highlighter, cause it will conflict
14:39 andrzejku hey
14:40 andrzejku I create small PoC for Perl6 IoT
14:40 samcv if you really want to use atom-editortools check it out on github, and then run `apm link path/to/atom-perl6-editor-tools`
14:41 andrzejku https://github.com/damaxi/IoT if someone want to help me
14:41 DrForr andrzejku: Excellent!
14:41 andrzejku that would be greate :)
14:41 samcv and it'll install the git version which won't depend on the old syntax highlighter.
14:41 andrzejku but I know I always can count on you in Perl6 knowledge
14:44 DrForr Looks like a good idea, I *think* Perl6 can compile on RPi, though memory is probably going to be a bit of an issue.
14:47 Geth ¦ perl6.org: 4aba6334ed | (Samantha McVey)++ | source/whatever/index.html
14:47 Geth ¦ perl6.org: Add a link github project on configuring Atom as a Perl 6 IDE
14:47 Geth ¦ perl6.org: review: https://github.com/perl6/perl6.org/commit/4aba6334ed
14:47 samcv will be good so more people can find that page from now on
14:48 ZzZombo ugh, "apm" is an unknown command.
14:57 salva joined #perl6
15:01 ZzZombo Failed to activate the atom-perl6-editor-tools package
15:01 ZzZombo Cannot find module 'atom-space-pen-views'
15:01 ZzZombo samcv ^
15:02 samcv yeah that module doesn't work properly
15:02 samcv that's why i uninstalled it :\
15:02 samcv are you on windows?
15:02 ZzZombo crap
15:02 ZzZombo yes
15:02 samcv ok that's why
15:03 ZzZombo what do you mean?
15:03 samcv apm == atom package manager
15:04 ZzZombo yea?
15:04 samcv it should be installed on windows though apparently
15:04 ZzZombo it's just wasn't on my PATH
15:04 huf joined #perl6
15:04 samcv ah ok
15:04 samcv but regardless that plugin is broken.
15:04 ZzZombo it*
15:05 samcv at least any time I have ever tried it. but those plugins i linked you to should make using perl 6 fairly nice
15:05 wamba1 joined #perl6
15:08 ZzZombo yea, thanks!
15:08 itaipu joined #perl6
15:11 samcv i gotta go to bed all. night o/
15:12 ZzZombo what's up with "item= Regex methods are slow but thorough -- they will look back in the string and really try." and others in https://docs.perl6.org/language/grammar_tutorial
15:12 ZzZombo ?
15:13 ZzZombo doesn't seem right
15:13 AlexDaniel joined #perl6
15:13 sena_kun ZzZombo, should be fixed. It seems that there was =item2.
15:15 sena_kun yes, the latest PR in this section did it. I'll fix it now.
15:16 Actualeyes joined #perl6
15:18 Geth ¦ doc: f98aa973b6 | Altai-man++ | doc/Language/grammar_tutorial.pod6
15:18 Geth ¦ doc: Fix item=
15:18 Geth ¦ doc:
15:18 Geth ¦ doc: Should be =item instead.
15:18 Geth ¦ doc: review: https://github.com/perl6/doc/commit/f98aa973b6
15:19 sena_kun ZzZombo++
15:21 ZzZombo great
15:21 ZzZombo thanks.
15:21 sena_kun ZzZombo, no problem, thanks for your report. \o/
15:29 ZzZombo how could I parse something like " this is a quoted string 1234!@!#!$\" that ends only here" in a grammar?
15:29 sena_kun ZzZombo, what result format do you expect?
15:30 ZzZombo that is, everything between " " is accepted except a newline, and \ can be used to escape the ".
15:30 ZzZombo sena_kun, whatever is inside the quotes.
15:30 ZzZombo as a string
15:31 IOninja m: '" this is a quoted string 1234!@!#!$\" that ends only here"' ~~ /'"' (.+?) <!before \\>'"'/; say $/[0]
15:31 camelia rakudo-moar 80e0bc: OUTPUT: «「 this is a quoted string 1234!@!#!$\」␤»
15:31 IOninja bah
15:31 IOninja m: '" this is a quoted string 1234!@!#!$\" that ends only here"' ~~ /'"' (.+?) <!after \\>'"'/; say $/[0]
15:31 camelia rakudo-moar 80e0bc: OUTPUT: «「 this is a quoted string 1234!@!#!$\" that ends only here」␤»
15:32 ZzZombo does . not match \n? I'm completely out of the loop with P6 regex... Somebody tell me go learn it already.
15:32 IOninja It does.
15:33 ZzZombo well, then one last thing is to exclude it.
15:33 IOninja use \N
15:34 khw joined #perl6
15:35 ZzZombo m: '"this is a quoted string 1234!@!#!$\" that ends only here"' ~~ /'"' (\N*?) <!after \\>'"'/; say $/[0]
15:35 camelia rakudo-moar 80e0bc: OUTPUT: «「this is a quoted string 1234!@!#!$\" that ends only here」␤»
15:35 ZzZombo m: '""' ~~ /'"' (\N*?) <!after \\>'"'/; say $/[0]
15:35 camelia rakudo-moar 80e0bc: OUTPUT: «「」␤»
15:35 ZzZombo fantastic
15:35 ZzZombo thanks a lot!
15:38 AlexDaniel m: ‘"this is a quoted string 1234!@!#!$\" that ends only here"’ ~~ /‘"’ ~ [<!after 「\」> ‘"’] (\N*?)/; say $/
15:38 yoleaux 12:44Z <tbrowder> AlexDaniel: i've started tweaking Proc docs based on discussions yesterday. what do think about adding a warning about  the dangers of using either run or shell?  if not in Proc, maybe in some other, more general place.
15:38 camelia rakudo-moar 80e0bc: OUTPUT: «「"this is a quoted string 1234!@!#!$\" that ends only here"」␤ 0 => 「this is a quoted string 1234!@!#!$\" that ends only here」␤»
15:38 yoleaux 13:16Z <tbrowder> AlexDaniel: it looks to me like the args for run (and now shell) are in the wrong order. also, run needs to be shown as a method. also the sig for method shell looks wrong (incomplete).
15:38 AlexDaniel m: ‘"this is a quoted string 1234!@!#!$\" that ends only here"’ ~~ /‘"’ ~ [<!after 「\」> ‘"’] (\N*?)/; say $0
15:38 camelia rakudo-moar 80e0bc: OUTPUT: «「this is a quoted string 1234!@!#!$\" that ends only here」␤»
15:38 AlexDaniel ZzZombo: another way to write it ↑
15:41 IOninja m: say 「\」
15:41 camelia rakudo-moar 80e0bc: OUTPUT: «\␤»
15:41 IOninja m: say '\'
15:41 camelia rakudo-moar 80e0bc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in single quotes; couldn't find final "'" ␤at <tmp>:1␤------> 3say '\'7⏏5<EOL>␤    expecting any of:␤        argument list␤        single quotes␤        term␤»
15:41 IOninja m: say Q'\'
15:41 camelia rakudo-moar 80e0bc: OUTPUT: «\␤»
15:41 AlexDaniel yep, it's weird. Most of the time you actually want 「」 and not ‘’
15:41 pmurias joined #perl6
15:41 IOninja m: say Q'\''
15:41 camelia rakudo-moar 80e0bc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3say Q'\'7⏏5'␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statement modifier␤      …»
15:42 * IOninja must've been thinking of ''
15:42 pmurias =SORRY!=== Error while compiling <tmp>␤Two terms in a row␤at
15:42 pmurias <tmp>:1␤------> say Q'\'⏏'␤    expecting any of:␤        infix␤        infix stopper␤
15:42 pmurias postfix␤        statement end␤        statement modifier␤      …»
15:42 pmurias [16:42] [pmurias(+i)] [2:freenode/#perl6(+Cnt)]
15:42 pmurias [#perl6] =SORRY!=== Error while compiling <tmp>␤Two terms in a row␤at
15:42 pmurias <tmp>:1␤------> say Q'\'⏏'␤    expecting any of:␤        infix␤        infix stopper␤
15:42 pmurias postfix␤        statement end␤        statement modifier␤      …»
15:42 pmurias [16:42] [pmurias(+i)] [2:freenode/#perl6(+Cnt)]
15:42 pmurias sorry
15:42 IOninja heh
15:43 rindolf joined #perl6
15:43 pmurias http://blogs.perl.org/users/pawel_murias/2017/02/rakudojs-update---we-passed-a-first-roast-test.html - rakudo.js update
15:45 IOninja pmurias++ cool
15:45 sena_kun pmurias++, your work is awesome.
15:48 TimToady you can't really use <!after> like that and get away with it
15:48 TimToady what about \\" and \\\" and so on?
15:49 AlexDaniel .tell tbrowder I've created https://github.com/perl6/doc/issues/1208, but other than that it does not look too bad
15:49 yoleaux AlexDaniel: I'll pass your message to tbrowder.
15:49 AlexDaniel TimToady: nobody said that you can escape backslashes :)
15:49 AlexDaniel but yes
15:50 AlexDaniel .tell tbrowder the dangers can be documented in language/traps, maybe
15:50 yoleaux AlexDaniel: I'll pass your message to tbrowder.
15:52 TimToady ZzZombo: instead of using <!after>, it's usually better to do something like [ '\\' . | <-[ " \n ]> ]*
15:53 TimToady you could probably get away with [ '\\' . || \N ]*? '"'
15:55 * TimToady has never used <!after> for anything useful, and it's a bit of an attractive nuisance...
15:58 MasterDuke pmurias++
16:01 IOninja ah, right, TimToady++
16:03 Geth ¦ doc: titsuki++ created pull request #1209: Add a concrete example of CStruct initialization
16:03 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1209
16:03 Geth ¦ doc: fd1ad28777 | titsuki++ | doc/Language/nativecall.pod6
16:03 Geth ¦ doc: Add a concrete example of CStruct initialization
16:03 Geth ¦ doc: review: https://github.com/perl6/doc/commit/fd1ad28777
16:03 Geth ¦ doc: c53899df49 | (Itsuki Toyota)++ | doc/Language/nativecall.pod6
16:03 Geth ¦ doc: Merge pull request #1209 from titsuki/add-cstruct-example
16:03 Geth ¦ doc:
16:03 Geth ¦ doc: Add a concrete example of CStruct initialization
16:03 Geth ¦ doc: review: https://github.com/perl6/doc/commit/c53899df49
16:04 bwisti joined #perl6
16:08 ufobat s: &trait_mod:<is>(:$default)
16:08 SourceBaby ufobat, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Variable '$default' is not declared␤at -e:6␤------>     put sourcery( &trait_mod:<is>(:<HERE>$default) )[1];␤
16:09 sufrostico joined #perl6
16:12 ufobat could anyone help me with SourceBaby :-) i'd like to figure out the source for the is default trait
16:12 jnthn s: &trait_mod:<is>(:default)
16:12 SourceBaby jnthn, Something's wrong: ␤ERR: Cannot resolve caller trait_mod:<is>(:default); none of these signatures match:␤    (Mu:U $child, Mu:U $parent)␤    (Mu:U $child, :$DEPRECATED!)␤    (Mu:U $type, :$rw!)␤    (Mu:U $type, :$nativesize!)␤    (Mu:U $type, :$ctype!)␤    (Mu:U $type, :$unsigned!)␤    (Mu:U $type, :$hidden!)␤    (Mu:U $type, Mu :$array_type!)␤    (Mu:U $type, *%fail)␤    (Attribute:D $attr, |c is raw)␤    (Attri
16:12 jnthn s: &trait_mod:<is>(Routine, :default)
16:12 timotimo right, you need to query the dispatcher for the candidate that fits
16:12 SourceBaby jnthn, Something's wrong: ␤ERR: 'Routine' cannot inherit from 'default' because it is unknown.␤  in block <unit> at -e line 6␤␤
16:12 jnthn heh, it's not passing that as a named for some reason...
16:13 timotimo i don't think you can do it without a defined Routine
16:13 jnthn Ohh
16:13 timotimo also, the s bot doesn't want you to do a call
16:13 jnthn s: &trait_mod:<is>(sub fo() { }, :default)
16:13 SourceBaby jnthn, Ehhh... I'm too scared to run that code.
16:13 jnthn haha
16:13 jnthn Yeah
16:13 timotimo s: &trait_mod:<is> \(&say, :default)
16:13 SourceBaby timotimo, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Unable to parse expression in argument list; couldn't find final ')' ␤at -e:6␤------>     put sourcery( &trait_mod:<is><HERE> \(&say, :default) )[1];␤    expecting any of:␤        infix␤        infix stopper␤
16:13 timotimo s: &trait_mod:<is>, \(&say, :default)
16:13 SourceBaby timotimo, Sauce is at https://github.com/rakudo/rakudo/blob/80e0bce/src/core/traits.pm#L131
16:13 jnthn timotimo++
16:13 timotimo :)
16:16 sufrostico joined #perl6
16:17 ufobat thanks!
16:17 timotimo YW
16:20 IOninja s: &trait_mod:<is>, \(sub {}, :default)
16:20 SourceBaby IOninja, Sauce is at https://github.com/rakudo/rakudo/blob/80e0bce/src/core/traits.pm#L131
16:20 IOninja Good bot!
16:20 * IOninja pets SourceBaby
16:21 ufobat :)
16:30 ufobat could i have a trait_mod:<is> that only applies to attributes of classes that implement a certain role? because the iplementation of this trait_mod would relay on methods and attributes of this role?
16:34 jnthn Attribute:D $a where $a.package.does(RoleName) perhaps
16:34 jnthn Or $a.package ~~ RoleName
16:36 timotimo having that in the signature as a constraint would mean that if the class doesn't implement that certain role, you'll get a very mysterious error message
16:36 timotimo so make sure to also give it a very general candidate that can provide a proper exception
16:42 ufobat okay thank you! :)
16:42 ufobat i'll play with that later! :)
16:46 sena_kun there was changes in roast lately that affected fudge, how the process of new test's adding looks like now?
16:54 sena_kun nevermind me.
16:55 [Coke] titsuki ?
16:56 pmurias if I have a division operator from my bignum library that rounds towards zero how should I turn it into one that rounds down? (or am I forced to look at modulo)
16:56 [Coke] m: IntStruct.WHAT.say
16:56 camelia rakudo-moar 80e0bc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared name:␤    IntStruct used at line 1␤␤»
16:58 cale2 joined #perl6
16:58 cale2 howdy
16:58 cale2 .seen cale2
16:58 yoleaux You're right there.
16:58 cale2 .seen tony-o
16:58 yoleaux I saw tony-o 17 Feb 2017 20:30Z in #perl6: <tony-o> do you just need a CC to get an SSL cert for it or do you need the config done?
17:09 dustinm`_ joined #perl6
17:09 tony-o_ joined #perl6
17:09 Geth ¦ doc/coke/examples: 3499d0c47e | (Will "Coke" Coleda)++ | xt/examples-compilation.t
17:09 Geth ¦ doc/coke/examples: Count chunks from 1, not 0
17:09 Geth ¦ doc/coke/examples: review: https://github.com/perl6/doc/commit/3499d0c47e
17:09 sena_kun should I create a new test file exclusively for :dba adverb in modifier section? It doesn't fit well in other places.
17:09 altLeCamarade joined #perl6
17:09 tardisx joined #perl6
17:10 k-man joined #perl6
17:10 pmurias anyone here wants to talk how nqp.js/rakudo.js should be built? (the hard part form me is how it should interacting with the npm)
17:10 pmurias s/talk/discuss/
17:11 andrewalker joined #perl6
17:13 Geth ¦ doc: a8feef1689 | (Tom Browder)++ | doc/Type/IO.pod6
17:13 Geth ¦ doc: tweak run words and examples
17:13 Geth ¦ doc: review: https://github.com/perl6/doc/commit/a8feef1689
17:16 [Coke] pmurias, sure
17:18 pmurias it seems to me that nqp should have a package.json in the root of the repo
17:19 pmurias in addition to the one we have for the nqp-js-compiled-js
17:19 [Coke] ... ok, I can't help. :)
17:23 pmurias for rakudo.js I'm leaning towards having something like 'perl Configure.PL --backends=js --get-npm' that would just install a prebuilt nqp.js from the npm
17:25 jnthn A tad off-topic but someone here probably knows. :) In bash (or also using standard UNIX tools) is there a way to do 'some-command | tee foo.txt', but (a) also capturing stderr in foo.txt, (b) leaving both stdout/stderr intact (so 2>&1 before the | tee will not fly), and (c) not swallowing the exitcode of the original command like tee seems to?
17:26 jnthn I guess this also boils down to "can I redirect to a file and leave the output to the console intact"...
17:27 jnthn pmurias: Is there a reason not to have --gen-nqp just work out for the JavaScript backend?
17:29 jnthn (e.g. just bulid it)?
17:29 jnthn Since NQP updates relatively often, and the NPM build may lag, unless we are automatically publishing it
17:35 pmurias jnthn: --gen-nqp should work, OTOH that would require building the moarvm as I don't keep a prebuilt nqp-js-on-js in the nqp repo
17:37 timotimo jnthn: what happens if you tee with the append mode from two "processes"?
17:37 cale2 jnthn: https://kyclark.gitbooks.io/metagenomics/content/unix_exercises.html do a ctrl+F for "You can redirect errors into a file like so:"
17:38 timotimo like ((foo | tee -a foobar.txt) (somehow switch 1 and 2) | tee -a foobar.txt) (somehow switch 1 and 2 back)
17:38 ugexe i would think using a tee on stdout and a tee on stderr could somehow be made to handle it
17:38 timotimo sounds like we want a perl6 script that does that
17:39 timotimo because perl6 is good at that kind of stuff
17:39 ugexe run/shell :merge doesn't work yet
17:39 cale2 In the book example it shows `$ program 1>out 2>err` where stout gets printed to a file named out and sterr gets printed to a file named err
17:39 ugexe or maybe it does now. i havent checked in over a year now that i think about it :)
17:40 timotimo you don't want to merge
17:40 cale2 `$ program 2>err` prints errors to a file named err and prints stout to the console
17:40 jnthn cale2: Thanks, but that's not quite it; I need the 2 streams in 1 file and also on the console; that just sends them to a file
17:40 timotimo that's the whole point
17:40 jnthn Well, I want the file merged
17:41 cale2 ah
17:41 timotimo right, but if you :merge, you can't pick apart stdout and stderr for proper output any more :)
17:42 jnthn ugexe: (tee on stdout/stderr) I played a bit with that, but `command > >(tee foo) 2> >(tee foo)` goes pretty badly (not surprisingly) :)
17:42 jnthn Oh, and it merges the streams...d'oh
17:43 cale2 just don't cross the streams
17:43 jnthn Oh, but that's fixable with `> >(tee foo) 2> >(tee foo 1>&2)`
17:44 itaipu joined #perl6
17:44 cale2 for the people here, I started putting together a little book about perl6 ecosystem stuff. including web dev. mainly to teach myself in the process. here's a rough draft of the web chapter https://github.com/WildYorkies/peregrinations-in-perl6/blob/master/book/4-HowToWeb.md
17:44 timotimo jnthn: you need to tell it to open in append mode, don't you?
17:46 BenGoldberg joined #perl6
17:46 jnthn timotimo: heh, that does seme to work, though I'm still a tad uneasy about two processes having opened the same file :)
17:48 BenGoldberg Can anyone tell me whether it's possible to unload code?  I'm writing a perl6 plugin for my favorite irc client, and I want to be able to load and unload individual scripts.
17:51 MasterDuke cale2: nice. noticed you typo'ed receive as recieve a couple times though
17:51 BenGoldberg If not, I can probably just use one separate interpreter for each and every script, but that would surely be a serious waste of memory.
17:54 cale2 MasterDuke: good catch. I've just been writing it on the github online editor, so no spellcheck there :P
17:58 robertle joined #perl6
17:58 Geth ¦ ecosystem: bradclawsie++ created pull request #298: added DB-Rscs
17:58 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/pull/298
17:59 El_Che lo
18:00 Geth ¦ ecosystem: 7001b90dec | (brad clawsie)++ | META.list
18:00 Geth ¦ ecosystem: added DB-Rscs
18:00 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/7001b90dec
18:00 Geth ¦ ecosystem: d676c82300 | Altai-man++ | META.list
18:00 Geth ¦ ecosystem: Merge pull request #298 from bradclawsie/master
18:00 Geth ¦ ecosystem:
18:00 Geth ¦ ecosystem: added DB-Rscs
18:00 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/d676c82300
18:02 Voldenet well, a propos what BenGoldberg said, is there some good tool to instrument memory allocations/deallocations and general usage in moarvm?
18:03 timotimo the profiler does that, but the html frontend is currently a bit b0rked in that regard
18:03 timotimo you can get it to output sqlite-supported .sql and manually inspect it, but that's not ideal, of course
18:04 timotimo i've been working on an nqp:: op called "vmhealth" that outputs a few stats about the process, including how much memory is used in which size buckets and how many minor and major collections have happened so far
18:04 Voldenet Nifty!
18:05 timotimo https://github.com/MoarVM/MoarVM/pull/536 - got any comments on the data it presents?
18:05 timotimo o i had meant to post the current output
18:06 itaipu joined #perl6
18:07 wamba1 joined #perl6
18:07 robertle I can get --profile to segfault quite reproducibly btw... is that a known thing? anyone seen it? I only see it in parallel workloads...
18:07 timotimo yes, it asplodes when you have more than one thread
18:08 andrzejku joined #perl6
18:09 timotimo this game is refusing to do a major collection :D
18:10 timotimo a-ha!
18:10 Voldenet timotimo: hm, the output is very /internal/ - it's not a bad thing, but you could do naming to be more... friendly ;)
18:11 Voldenet nursery_bytes -> bytes_per_thread
18:11 Voldenet gc_seqnr -> gc_runs
18:11 timotimo sure, that's easy
18:12 mr_ron joined #perl6
18:13 MasterDuke robertle: RT #128280 is related
18:13 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=128280
18:23 dogbert17 joined #perl6
18:25 st_elmo joined #perl6
18:49 gfldex tbrowder: I strongly disagree with your commit a8feef1689. You removed a lot of information without adding any clarity.
18:49 espadrine joined #perl6
18:51 tbrowder gfldex: sorry, but on my browser i saw formatting errors (mismatched ,') and no explanation for the shell example in the middle of discussion of run, a
18:51 yoleaux 15:49Z <AlexDaniel> tbrowder: I've created https://github.com/perl6/doc/issues/1208, but other than that it does not look too bad
18:51 yoleaux 15:50Z <AlexDaniel> tbrowder: the dangers can be documented in language/traps, maybe
18:54 gfldex tbrowder: I do agree that the example could do with some explanation and we should do something about the font (if we can actually find a good webfont). But removing the vital infromation that no shell-out happens is a big no-no.
18:54 tbrowder please revert if you wish...and you're right, i probably should have commented or discussed it first
18:55 Geth ¦ doc: e3ce0985fe | (Wenzel P. P. Peppmeyer)++ | doc/Type/IO.pod6
18:55 Geth ¦ doc: Revert "tweak run words and examples"
18:55 Geth ¦ doc:
18:55 Geth ¦ doc: This reverts commit a8feef1689a8a1657f3e5f16c122c390bffc5e23.
18:55 Geth ¦ doc: review: https://github.com/perl6/doc/commit/e3ce0985fe
18:55 gfldex tbrowder: what OS is your browser running on?
18:56 andrzejku :)
18:56 tbrowder i see it both on Debian (Chrome) and ios9 (also Chrome)
18:56 pyrimidine joined #perl6
18:59 tbrowder please help my proc understanding: how does p6 run a system command without "shelling out?"
18:59 tbrowder is ther
18:59 gfldex tbrowder: by asking the OS to run the executable directly
19:00 gfldex tbrowder: if the OS could not do that, it would not be able to run a different shell then the default
19:01 gfldex tbrowder: can you see the following 4 glyphs? „ “ ‚ ‘
19:01 tbrowder hm...that AFAIK isn't explained very clearly anywhere in current docs.
19:02 gfldex tbrowder: I don't think it should. To shell or not to shell is a question for operation system design.
19:05 atweiden joined #perl6
19:05 atweiden m: https://gist.github.com/atweiden/99d94483b89b752c8c50af9f16419c28
19:05 camelia rakudo-moar 80e0bc: OUTPUT: «Current date:              2017-02-20␤Target date:         2023-09-12␤Days remaining:              2395␤Bitcoin block count:       798809␤Decred block count:      798926␤»
19:06 atweiden what is strange about this gist is if i uncomment line 28 to pull current-block-count from the cmdline, it returns a totally erroneous result
19:07 atweiden however, you'd need additional software to repro
19:07 Tonik joined #perl6
19:07 tbrowder glyphs: i see but don't have a keyboard to repeat all of them, and my eyes aren't seeing clearly, but i think they are two pairs of non-ascii quotes; if you want users to be aware of system dangers i think shellout is well wort mentioning.
19:08 atweiden have tried playing with qx{} and shell to no avail
19:09 atweiden aw jeez, nvm
19:10 gfldex tbrowder: those glyphs are standard quote and single quote chars for many middle and east european countries. Also they are distinct from the quotes a shell would use, what makes them useful for run and shell.
19:10 gfldex tbrowder: shell could do with a little warning about shell escapes. I will add one.
19:12 tbrowder ok, back to shell, is diff between run and shell somewhat like diff between p5 exec and system? or did they both "shellout?"
19:14 Geth ¦ doc: 061178a707 | (Wenzel P. P. Peppmeyer)++ | doc/Type/IO.pod6
19:14 Geth ¦ doc: some explaining in the example
19:14 Geth ¦ doc: review: https://github.com/perl6/doc/commit/061178a707
19:14 Geth ¦ doc: f5f1ddd02a | (Wenzel P. P. Peppmeyer)++ | doc/Type/IO.pod6
19:14 Geth ¦ doc: add explicit warning sign to `shell`
19:14 Geth ¦ doc: review: https://github.com/perl6/doc/commit/f5f1ddd02a
19:14 tbrowder to me the capability of the run command is very powerful, now that i have a better feel for it--obviates need for using NativeCall for any things i think.
19:14 tbrowder s/any/many
19:17 tbrowder changes look better
19:18 gfldex tbrowder: in Perl 5 both system and exec are quite magic, they may or may not run a shell depeding on arguments
19:20 tbrowder ok, so, in p6, can we say that, using run, we will never shell out?
19:21 gfldex tbrowder: the OS may not agree and if a shebang is used a shell may be run anyway on *nix
19:21 tbrowder thanks!
19:21 gfldex tbrowder: however, shell escapes should never happen on run
19:22 tbrowder gotcha
19:23 tbrowder looks like i should never have to use shell just to run a sys cmd on *nix then (i know, never say never)
19:25 tbrowder one more question gfldex, i asked AlexDaniel yesterday about forming a complete command string and then using .words to feed run with the resulting array. yr opinion?
19:25 gfldex tbrowder: if you run a .p6 as a cron job or udev you may have to run a shell to make things work
19:26 hobbs tbrowder: as long as you know exactly what you're doing (that string doesn't contain any multi-word strings)
19:26 gfldex tbrowder: .words may be more liberal when it comes to <ws> then you may like. Not sure tho.
19:27 tbrowder okay, i'll keep that in mind since i'm working on a cron job now.
19:27 tbrowder multi-word example?
19:27 hobbs in p5 I often end up writing something like system(qw(command -flags -flags -flags), $arg, '-opt', $arg)
19:27 hobbs where the initial qw part is akin to what you're talking about
19:28 itaipu joined #perl6
19:29 tbrowder in p5 i usually formed the complete cmd string outside and then fed single str to system
19:29 Actualeyes joined #perl6
19:29 gfldex some time ago I had to deal with a file called „Let's do it!.doc“. That was a real PITA.
19:29 hobbs tbrowder: yeah, that's best avoided
19:29 hobbs I try to be properly paranoid about that at all times
19:30 RabidGravy Was someone looking for me earlier, my scrollback only goes back five hours :)
19:30 yoleaux 12:49Z <dogbert11> RabidGravy: do you remember what test(s) you're running when you got SEGV's with Squirrel? (RT #129946)
19:30 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=129946
19:31 tbrowder well, since i don't program on windows i usually don't have problems with weird file names. i just rename those i get from windows friends.
19:32 RabidGravy well I think it was something to do with samewith but I couldn't reproduce out of the code
19:32 tbrowder gfldex: thanks for the enlightenment!
19:32 gfldex yw
19:33 dogbert17 RabidGravy: so if you ran the tests several/many times it would eventually SEGV?
19:33 gfldex samcv: please have a look at the highlight for https://docs.perl6.org/type/IO#sub_run if you got the time to spare
19:34 RabidGravy dogbert17, no it would reliably segv after a certain number of tests
19:34 RabidGravy I took all the samewith out and it stopped doing it
19:35 samcv gfldex, can you open a ticket for me?
19:35 dogbert17 so the code in your repo is 'fixed'?
19:35 samcv https://github.com/perl6/atom-language-perl6
19:35 BenGoldberg hobbs, Just so you know, even with strict and warnings on, -opt works perfectly fine without quotes around it.
19:35 hobbs BenGoldberg: true enough
19:36 * BenGoldberg thinks that that was introduced to make Tk code look nicer.
19:37 sufrostico joined #perl6
19:37 gfldex samcv: https://github.com/perl6/doc/issues/1210
19:37 samcv thx
19:39 RabidGravy dogbert17, yeah, it's fine now, I even upped the number of tests and everything
19:40 RabidGravy obviously it's still unfinished but it works for the simple stuff
19:42 dogbert17 RabidGravy: I'm looking at SEGV issues in RT in order to figure out which of them are still relevant, i.e. still bugs out
19:45 RabidGravy right, well the approximate cause of that was highly nested methods with samewith
19:46 RabidGravy let me try and find the commit that fixed it
19:46 dogbert17 thx
19:47 TEttinger joined #perl6
19:47 SmokeMachine m: say 55296.chr # why?
19:47 camelia rakudo-moar 80e0bc: OUTPUT: «Error encoding UTF-8 string: could not encode codepoint 55296␤  in block <unit> at <tmp> line 1␤␤»
19:47 sufrostico joined #perl6
19:48 cibs joined #perl6
19:51 andrzejku joined #perl6
19:53 andrzejku hi :)
19:54 DrForr Evenin'.
19:54 eroux joined #perl6
19:56 gdonald joined #perl6
20:04 jjido joined #perl6
20:16 eroux joined #perl6
20:34 eroux joined #perl6
20:37 jjido_ joined #perl6
20:41 SmokeMachine .u pizza
20:41 yoleaux U+1F355 SLICE OF PIZZA [So] (🍕)
20:43 BenGoldberg Don't say such things, you'll make me hungry!
20:44 hobbs I *am* hungry
20:45 SmokeMachine sorry!
20:45 gfldex .u Eierschecke
20:45 yoleaux No characters found
20:45 gfldex :(
20:47 labster joined #perl6
20:50 RabidGravy dogbert17, I think https://github.com/jonathanstowe/Squirrel/commit/8cedb983596b616b0dea0fa5e7b5578090b623ba but there were a lot
20:51 AlexDaniel joined #perl6
21:00 andrzejku how can I measure time in script?
21:00 andrzejku some reliable time subs?
21:01 gfldex m: say 'start'; sleep 10; say now - BEGIN now;
21:01 camelia rakudo-moar 80e0bc: OUTPUT: «start␤10.0095722␤»
21:04 jjido joined #perl6
21:04 gdonald joined #perl6
21:06 andrzejku gfldex thnks
21:19 robertle anyone know a programmatic way to find out if a comp unit I know by name is module or a class?
21:19 timotimo i don't think you can get that info without loading the compunit
21:20 robertle loading as in require?
21:22 lizmat and a new Perl 6 Weekly hits the Net: https://p6weekly.wordpress.com/2017/02/20/2017-08-evolving-slangs/
21:24 robertle ::($f).HOW seems to do something along those lines...
21:26 Voldenet Okay, I've made some grammars... but they're all of type "Match", which is not very preferable.
21:26 jnthn m: class C { }; module M { }; say C.HOW ~~ Metamodel::ClassHOW; say M.HOW ~~ Metamodel::ClassHOW
21:26 camelia rakudo-moar 80e0bc: OUTPUT: «True␤False␤»
21:26 sunnavy joined #perl6
21:26 Voldenet Is usage of gather/take pattern a good idea here?
21:28 moritz Voldenet: the typical way to return non-Match things from grammars is to use make() or $/.make()
21:28 jnthn Voldenet: Are you trying to produce a more relevant data structure from the data the grammar matches?, rather than just having the Match object?
21:28 jnthn If so, see make and action classes
21:28 Voldenet jnthn: Well, it makes sense, but that feels very /java/ :P
21:28 moritz Voldenet: see https://perlgeek.de/blog-en/perl-6/2017-006-book-grammar.html
21:29 moritz or https://leanpub.com/perl6 for a bit more verbose treatment </plug>
21:29 jnthn Voldenet: You can embed the make statements directly inside of the tokens
21:30 jnthn If writing an actions class is really too objectional :P
21:30 Voldenet Now that's the /perl/, post the example :P
21:30 Voldenet just a simple one will do
21:31 jnthn m: grammar G { token TOP { <word>+ % ',' { make [$<word>.map(*.made)] }; token word { \w+ { make ~$/ } }; say G.parse('abc,def,gh').ast.perl
21:31 camelia rakudo-moar 80e0bc: OUTPUT: «5===SORRY!5===␤Unrecognized regex metacharacter ; (must be quoted to match literally)␤at <tmp>:1␤------> 3d>+ % ',' { make [$<word>.map(*.made)] }7⏏5; token word { \w+ { make ~$/ } }; say G␤Malformed regex␤at <tmp>:1␤------> 3+ % '…»
21:31 jnthn d'oh :)
21:31 jnthn m: grammar G { token TOP { <word>+ % ',' { make [$<word>.map(*.made)] } }; token word { \w+ { make ~$/ } }; say G.parse('abc,def,gh').ast.perl
21:31 camelia rakudo-moar 80e0bc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3 } }; say G.parse('abc,def,gh').ast.perl7⏏5<EOL>␤    expecting any of:␤        postfix␤        statement end␤        statement modifier␤        stateme…»
21:31 jnthn grr
21:31 jnthn m: grammar G { token TOP { <word>+ % ',' { make [$<word>.map(*.made)] } }; token word { \w+ { make ~$/ } } }; say G.parse('abc,def,gh').ast.perl
21:31 camelia rakudo-moar 80e0bc: OUTPUT: «["abc", "def", "gh"]␤»
21:31 jnthn There we go
21:32 Voldenet that looks incredibly hacky ( ¬‿¬)
21:32 jnthn Too late to count braces, apparently :)
21:32 Voldenet my kind of perl (⌐‿⌐ )
21:34 itaipu joined #perl6
21:41 BenGoldberg m: dd Any.kv
21:41 camelia rakudo-moar 80e0bc: OUTPUT: «()␤»
21:41 BenGoldberg m: dd 1.kv;
21:41 camelia rakudo-moar 80e0bc: OUTPUT: «(0, 1).Seq␤»
21:42 BenGoldberg m: dd "foo".kv
21:42 camelia rakudo-moar 80e0bc: OUTPUT: «(0, "foo").Seq␤»
21:42 BenGoldberg m: dd Any.defined
21:42 camelia rakudo-moar 80e0bc: OUTPUT: «Bool::False␤»
21:43 BenGoldberg m: dd (class :: { sub defined { True } }).kv;
21:43 camelia rakudo-moar 80e0bc: OUTPUT: «()␤»
21:43 BenGoldberg s: Int, 'kv', \()
21:43 SourceBaby BenGoldberg, Sauce is at https://github.com/rakudo/rakudo/blob/80e0bce/src/core/Any.pm#L93
21:44 BenGoldberg m: my $foo = class :: { sub defined { True } }; dd $foo
21:44 camelia rakudo-moar 80e0bc: OUTPUT: «<anon|60285232> $foo = <anon|60285232>␤»
21:44 BenGoldberg m: my $foo = class :: { sub defined { True } }; dd defined $foo
21:44 camelia rakudo-moar 80e0bc: OUTPUT: «Bool::False␤»
21:45 BenGoldberg s: &defined, Any
21:45 SourceBaby BenGoldberg, Something's wrong: ␤ERR: Cannot resolve caller sourcery(Sub+{<anon|65569312>}, Any); none of these signatures match:␤    ($thing, Str:D $method, Capture $c)␤    ($thing, Str:D $method)␤    (&code)␤    (&code, Capture $c)␤  in block <unit> at -e line 6␤␤
21:45 BenGoldberg s: &defined, \(Any)
21:45 SourceBaby BenGoldberg, Something's wrong: ␤ERR: Cannot resolve caller sourcery(Sub+{<anon|65569312>}, Capture); none of these signatures match:␤    ($thing, Str:D $method, Capture $c)␤    ($thing, Str:D $method)␤    (&code)␤    (&code, Capture $c)␤  in block <unit> at -e line 6␤␤
21:45 BenGoldberg s: &defined, \()
21:45 SourceBaby BenGoldberg, Something's wrong: ␤ERR: Cannot resolve caller sourcery(Sub+{<anon|65569312>}, Capture); none of these signatures match:␤    ($thing, Str:D $method, Capture $c)␤    ($thing, Str:D $method)␤    (&code)␤    (&code, Capture $c)␤  in block <unit> at -e line 6␤␤
21:47 BenGoldberg Surely Sub+{<anon|65569312>} should match with &code, and \() with Capture?
21:48 BenGoldberg s: Any, 'defined', \()
21:48 SourceBaby BenGoldberg, Sauce is at https://github.com/rakudo/rakudo/blob/80e0bce/src/core/Mu.pm#L91
21:49 BenGoldberg m: my $foo = class :: { sub defined { True } }; dd definite $foo
21:49 camelia rakudo-moar 80e0bc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    definite used at line 1. Did you mean 'defined'?␤␤»
21:54 labster joined #perl6
22:02 cale2 does anyone have good examples for `andthen` and `orelse`?
22:04 IOninja I have a few, but I'm hesitant to let you judge their goodness.
22:04 * AlexDaniel looks at https://irclog.perlgeek.de/perl6/search/?nick=&amp;q=andthen
22:04 IOninja heh
22:05 IOninja cale2: some https://github.com/perl6/geth/blob/master/lib/Geth/GitHub/Hooks/Preprocessor.pm6#L34-L45
22:05 IOninja `with` compiles to `andthen` so you can rephrase any of em in the other direction
22:07 cale2 IOninja: We need examples for andthen and orelse in the docs, but I honestly can't think of when to use andthen. most people use defined-or (//) instead of orelse as well
22:07 kurahaupo__ joined #perl6
22:08 IOninja how?
22:09 IOninja They're quite different.
22:10 IOninja m: Int orelse fail "Can't use {$_.^name}; gimme a proper number"
22:10 camelia rakudo-moar 80e0bc: OUTPUT: «Can't use Int; gimme a proper number␤  in block <unit> at <tmp> line 1␤␤»
22:10 IOninja m: Int // fail "Can't use {$_.^name}; gimme a proper number"
22:10 camelia rakudo-moar 80e0bc: OUTPUT: «Can't use Any; gimme a proper number␤  in block <unit> at <tmp> line 1␤␤»
22:11 IOninja m: my $answer; say $answer // 42
22:11 camelia rakudo-moar 80e0bc: OUTPUT: «42␤»
22:11 IOninja m: my $answer; say $answer or say "No answer"
22:11 camelia rakudo-moar 80e0bc: OUTPUT: «(Any)␤»
22:11 IOninja m: my $answer; say $answer orelse say "No answer"
22:11 camelia rakudo-moar 80e0bc: OUTPUT: «(Any)␤»
22:11 IOninja bah
22:12 IOninja m: sub foo { }; foo 42 // say "No answer"
22:12 camelia rakudo-moar 80e0bc: OUTPUT: «Too many positionals passed; expected 0 arguments but got 1␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
22:12 IOninja m: sub foo ($) { }; foo 42 // say "No answer"
22:12 camelia rakudo-moar 80e0bc: ( no output )
22:12 IOninja m: sub foo ($) { }; foo 42 orelser say "No answer"
22:12 camelia rakudo-moar 80e0bc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3sub foo ($) { }; foo 42 o7⏏5relser say "No answer"␤»
22:12 IOninja m: sub foo ($) { }; foo 42 orelse say "No answer"
22:12 camelia rakudo-moar 80e0bc: OUTPUT: «No answer␤»
22:12 IOninja And so on. Different precedence
22:14 IOninja notandthen seems to be undocumented
22:14 IOninja s: &infix:<notandthen>
22:14 SourceBaby IOninja, Sauce is at https://github.com/rakudo/rakudo/blob/80e0bce/src/core/operators.pm#L640
22:15 IOninja and `without` compiles to it, so same as with andthen and with; can rephrase in different order.
22:15 gfldex IOninja: it seams to be un-roasted too
22:15 IOninja yikes
22:15 AlexDaniel oops…
22:16 IOninja Well, it is, indirectly. There are at least some tests for without
22:17 IOninja kinda scary that some things have 0% coverage :(
22:21 Voldenet what's the serialization method of choice to use with perl6?
22:21 Voldenet JSON/XML/Protobuf/?
22:22 IOninja TIL that .perl.EVAL route is uber slow.
22:22 IOninja And JSON doesn't preserve Inf/-Inf/NaN
22:23 Voldenet True, but it's not a big problem.
22:25 Voldenet + could be worked out with storing them as strings
22:25 Voldenet still, what /works best/ in perl6? :P
22:26 perlpilot whatever actually *works*  ;-)
22:27 * perlpilot still slightly wishes someone would port Sereal to Perl 6 though.
22:27 Geth ¦ doc: cdb9fe2895 | (Wenzel P. P. Peppmeyer)++ | doc/Language/phasers.pod6
22:27 Geth ¦ doc: LEAVE a simple example behind
22:27 Geth ¦ doc: review: https://github.com/perl6/doc/commit/cdb9fe2895
22:40 BenGoldberg So I've got a question:  If I wanted some random program to have a plugin based architecture, and wanted plugins to not be able to see each other, I could load each one's code inside of individual Safe.pm objects.  Throwing away or resetting the object would obviously unload most or all of the plugin's data.  How would I do this in perl6?
22:40 BenGoldberg Err, "I could (in perl5) load ..."
22:40 sufrostico joined #perl6
22:41 Voldenet joined #perl6
22:41 Voldenet joined #perl6
22:42 dotness joined #perl6
22:46 sufrostico joined #perl6
22:48 Voldenet okay, I'm trying to use glorious perl to parse json - it obviously fails because the class can't be represented by the serializer anyhow
22:48 Voldenet is there some funny feature which I can use to turn class into a "hash"?
22:49 IOninja ....to *parse* JSON? wat
22:49 Voldenet s/parse/serialize/
22:49 Voldenet ugh
22:49 Voldenet it doesn't even mean the same thing, ekhm
22:50 Voldenet in JS you JSON.Parse :P
22:50 Voldenet or .parse
22:50 DrForr And in Perl 6 you JSON::Fast.from-json :)
22:51 IOninja Voldenet: dunno, maybe someone done cooked up a role you could mix in
22:51 dotness joined #perl6
22:51 Voldenet DrForr: class x { has $.i; }; use JSON::Fast; my @a = map { x.new(:i($_)) }, 1..3; say to-json(@a);
22:52 IOninja Voldenet: and what about class Y { has $!x } ?
22:52 Voldenet the same
22:52 IOninja the same what?
22:52 Voldenet [{ "0": null }, ...] etc.
22:53 Voldenet [{ "0": null }, { "0": null }, { "0": null }]
22:53 Voldenet this is actually the result without newlines
22:53 IOninja Oh, just make them all { "0": null } ?
22:53 IOninja a class would serialize to { "0": null }?
22:53 Voldenet Yeah
22:53 Voldenet however, if I add "is Hash" then I get empty objects, which is... something :P
22:53 IOninja Oh, heh, I thought you wanted to extract attributes and all
22:54 Voldenet I'm just trying to do some "good, OOP" serialization :)
22:55 IOninja star: use JSON::Fast; say to-json class {}.new but '{ "0": null }';
22:55 camelia star-m 2016.10: OUTPUT: «{␤  "0": null␤}␤»
22:56 IOninja star: use JSON::Fast; my @a = map { x.new(:i($_)) }, 1..3; @a .= duckmap: -> $_ where $ !~~ Str|Numeric { $_ but '{ "0": null }'; }; say to-json @a
22:56 camelia star-m 2016.10: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    x used at line 1␤␤»
22:56 IOninja star: use JSON::Fast; class x { has $.i }; my @a = map { x.new(:i($_)) }, 1..3; @a .= duckmap: -> $_ where $ !~~ Str|Numeric { $_ but '{ "0": null }'; }; say to-json @a
22:56 camelia star-m 2016.10: OUTPUT: «[␤  {␤    "0": null␤  },␤  {␤    "0": null␤  },␤  {␤    "0": null␤  }␤]␤»
22:56 IOninja Worked the first time... That means it got a bug in it :}
22:57 Voldenet :-)
23:15 ufobat joined #perl6
23:32 SCHAAP137 joined #perl6
23:36 skids joined #perl6
23:40 Actualeyes joined #perl6
23:40 lep-delete joined #perl6
23:42 timotimo i'll give JSON::Fast support for a dynvar that'll make Inf, -Inf, and NaN non-standard json
23:43 Geth ¦ doc: titsuki++ created pull request #1211: Use Point instead of IntStruct
23:43 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1211
23:43 timotimo for when you need to use json for stuff, but your other side is also perl6
23:43 Geth ¦ doc: b69701502c | titsuki++ | doc/Language/nativecall.pod6
23:43 Geth ¦ doc: Use Point instead of IntStruct
23:43 Geth ¦ doc: review: https://github.com/perl6/doc/commit/b69701502c
23:43 Geth ¦ doc: c24beb8e3b | (Itsuki Toyota)++ | doc/Language/nativecall.pod6
23:43 Geth ¦ doc: Merge pull request #1211 from titsuki/fix-cstruct
23:43 Geth ¦ doc:
23:43 Geth ¦ doc: Use Point instead of IntStruct
23:43 Geth ¦ doc: review: https://github.com/perl6/doc/commit/c24beb8e3b
23:48 IOninja cool
23:49 timotimo gaaaah what the fuck zef
23:49 [Coke] titsuki++
23:50 IOninja .oO( a dynvar with a hash.... :{ NaN => 'NaN', Set => { .keys.sort.join: ',' }, {$_ !~~ Str|Numeric } => {'0': Nil} }
23:50 IOninja )
23:50 timotimo then i'll rename it JSON::Slow
23:50 IOninja :)
23:50 IOninja It'll be fast eventually... when Perl is fast.
23:51 timotimo nevarrrrrrrr
23:51 timotimo anyway, i pushed that patch
23:51 timotimo and bumped the version number
23:59 cale2 what's a simple module that I can use as an example of great modules

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

Perl 6 | Reference Documentation | Rakudo