Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-09-21

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:03 cschwenz joined #perl6
00:03 cschwenz left #perl6
00:23 tbrowder hib
00:25 entonian joined #perl6
00:31 schmause joined #perl6
00:47 headcase joined #perl6
00:54 headcase_ joined #perl6
00:56 aborazmeh joined #perl6
00:56 aborazmeh joined #perl6
00:59 headcase joined #perl6
01:32 piojo_ joined #perl6
01:35 headcase joined #perl6
01:37 headcase_ joined #perl6
01:53 rngoodn joined #perl6
01:54 ilbot3 joined #perl6
01:54 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!
01:58 maettu joined #perl6
02:00 mtj_ joined #perl6
02:04 Cabanossi joined #perl6
02:09 kyan joined #perl6
02:11 kyan Hi! In shell scripts, I often do exception handling like: foo=''; [[ "$foo" == '' ]] && echo "fail"
02:12 * kyan just thought of a test
02:14 rngoodn joined #perl6
02:20 kyan I was going to say, I don't get why ( $argument1 === '' ) && fail "That is an empty string."; didn't fail — it's because I was casting to a number before that, so it was a 0 by that point. Sorry for the bother.
02:21 geekosaur joined #perl6
02:28 geekosaur joined #perl6
02:40 skids .tell Zoffix https://github.com/skids/perl6-ArithFunctor <== persisiting types aross math without "is Int" or whatnot.
02:40 yoleaux skids: I'll pass your message to Zoffix.
02:56 mr-foobar joined #perl6
02:59 noganex_ joined #perl6
03:04 Cabanossi joined #perl6
03:13 geekosaur joined #perl6
03:17 wamba joined #perl6
03:23 TreyHarris joined #perl6
03:33 Cabanossi joined #perl6
03:34 Deejizzel joined #perl6
03:47 skids joined #perl6
03:51 zakharyas joined #perl6
04:04 Possum joined #perl6
04:06 wamba joined #perl6
04:19 cdg joined #perl6
04:28 mr-foobar joined #perl6
04:29 headcase joined #perl6
04:48 Cabanossi joined #perl6
04:49 eythian joined #perl6
04:53 Ven`` joined #perl6
05:21 moritz other opinions on https://github.com/perl6/DBIish/issues/100 would be very welcome
05:26 wamba joined #perl6
05:26 mr-foobar joined #perl6
05:27 [Coke] m: my @a = (5,7,9,10,8,6); say [==] @a.sort(-*).kv.rotor(2)>>.sum
05:27 camelia rakudo-moar 78a482: OUTPUT: «True␤»
05:29 [Coke] m: my @a = (5,7,9,10,6); say [==] @a.sort(-*).kv.rotor(2)>>.sum
05:29 camelia rakudo-moar 78a482: OUTPUT: «False␤»
05:29 [Coke] whee.
05:29 headcase joined #perl6
05:39 patrickz joined #perl6
05:40 patrickz left #perl6
05:41 knobo joined #perl6
05:46 rngoodn joined #perl6
05:49 domidumont joined #perl6
06:08 espadrine joined #perl6
06:11 domidumont joined #perl6
06:14 rngoodn joined #perl6
06:14 andrzejku joined #perl6
06:17 rngoodn joined #perl6
06:28 ufobat joined #perl6
06:29 headcase joined #perl6
06:33 setty1 joined #perl6
06:33 Cabanossi joined #perl6
06:34 wamba joined #perl6
06:36 rngoodn joined #perl6
06:47 piojo_ joined #perl6
06:47 [particle] joined #perl6
06:57 piojo joined #perl6
06:58 rngoodn joined #perl6
07:03 Cabanossi joined #perl6
07:05 jonas1 joined #perl6
07:09 wamba joined #perl6
07:22 Geth ¦ doc: d3b64823e9 | (Philippe Bruhat (BooK))++ | doc/Language/5to6-perlvar.pod6
07:22 Geth ¦ doc: Clarify that $*EXECUTABLE-NAME is a Str, and $*EXECUTABLE is an IO::Path
07:22 Geth ¦ doc: review: https://github.com/perl6/doc/commit/d3b64823e9
07:29 stmuk grrrr the return of R0b0t1
07:29 yoleaux 20 Sep 2017 23:45Z <japhb> stmuk: In 06fe4c4d2910e8beb4edf30cc5e0cec2673c7165, wouldn't you want to check $jobs instead of TEST_JOBS, since it's broken whether the job count comes from the environment or a command line flag?  Or are you leaving --jobs as an escape hatch?
07:29 knobo joined #perl6
07:30 stmuk .tell japhb I'll fix that shortly .. thanks!
07:30 yoleaux stmuk: I'll pass your message to japhb.
07:30 BooK also, run( $*EXECUTABLE, ... ) will only not succeed if changing directories and the path in not in the PATH
07:30 BooK m: say $*EXECUTABLE.perl; $*CWD = "/"; run( $*EXECUTABLE, "-e", "say «hello»")
07:30 camelia rakudo-moar 963a0f: OUTPUT: «IO::Path.new("./rakudo-m-inst/bin/perl6-m", :SPEC(IO::Spec::Unix), :CWD("/home/camelia"))␤run is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in sub run at src/RESTRICTED.setting line 14␤  in block <unit…»
07:30 BooK nevermind
07:30 BooK $ install/bin/perl6 -e 'say $*EXECUTABLE.perl; $*CWD = "/"; run( $*EXECUTABLE, "-e", "say «hello»")'
07:30 BooK IO::Path.new("install/bin/perl6", :SPEC(IO::Spec::Unix), :CWD("/home/book/src/perl6/rakudo"))
07:30 BooK The spawned command 'install/bin/perl6' exited unsuccessfully (exit code: 1) in block <unit> at -e line 1
07:31 BooK works fine with run( $*EXECUTABLE.absolute )
07:31 dakkar joined #perl6
07:32 BooK obviously, it makes sense sometimes to have a relative path and ignore the :CWD, and sometimes not
07:34 rindolf joined #perl6
07:41 piojo_ joined #perl6
07:44 gfldex https://gist.github.com/ed62484b162e7d7d06376e2f42deefb2
07:44 gfldex says: Type check failed in binding to parameter '$l'; expected Distance but got Int (15)
07:44 gfldex where does it get the Int from?
07:48 moritz gfldex: you didn't make infix:</> a multi
07:49 moritz gfldex: so it tries to recurse into the same candidate
07:49 moritz and gets a type error
07:49 moritz (if you look at the backtrace, you'll see that infix:</> appears twice)
07:59 DrForr timotimo: Indeed I would, and even noticed before reading IRC :)
08:03 tyil anyone used the mongodb module for perl 6?
08:03 tyil whenever I try to insert a DateTime.now, it ends up in mongodb as some date very close to the unix epoch
08:03 tyil (ISODate("1970-01-18T10:19:40.860Z"))
08:05 domidumont joined #perl6
08:08 wamba joined #perl6
08:09 moritz might be some confusion between seconds and microseconds since epoch
08:10 DrForr What's the equivalent of 'panda installdeps' in the brave new world of zef?
08:10 leont joined #perl6
08:11 DrForr (not really new, I know, I'm jst getting back up to speed and fixing broken sh*t)
08:11 darutoko joined #perl6
08:11 gargle joined #perl6
08:12 DrForr This is for Travis - I guess I could find a working module and copy its .travis.yml, I guess I'll do that.
08:13 moritz DrForr: you can simply zef install .
08:13 moritz DrForr: that installs the deps, runs the tests, installs the module under test
08:13 DrForr Danke schoen.
08:14 moritz https://github.com/moritz/Math-Model/blob/master/.travis.yml
08:14 moritz that's what I stole from somewhere, and now use in most of my p6 projects
08:14 DrForr Thanks, saved me a click :)
08:14 moritz r/savedyouaclick
08:18 DrForr I actually delved into reddit for my first time yesterday. Looked... random. Which is fine by me, shambolic seems to be my life this last few weeks.
08:18 DrForr Hell, months.
08:19 DrForr I may also have tgo get one of these ThinkPad Carbons for myself once the money starts to flow back in.
08:20 cdg joined #perl6
08:21 robertle joined #perl6
08:23 zakame joined #perl6
08:23 zakame hello o/
08:24 moritz \o
08:25 zakame hi moritz, just the persons I need :D can I bump a MIME::Base64 release?  Gerd from https://github.com/perl6/Perl6-MIME-Base64/pull/11 wants to make a package for Fedora but needs a tarball for it
08:26 DrForr zakame: Seems like a decent guy, he just did perl6-readline for me.
08:26 zakame DrForr: yeah I noticed on FB :D
08:27 DrForr Nod.
08:27 moritz zakame: no objections from me
08:28 zakame yay, thanks guys! :D
08:28 moritz zakame: do you need anything (permission-wise or else) to do that?
08:29 zakame not that I know of, I have write on the repo I think, I'll let you know
08:29 moritz apart from some permissions, I don't have any special authority over perl6 on github, so you can decide stuff like on your own
08:30 zakame gotcha
08:30 gfldex moritz: is that recursive behaviour a ENODOC?
08:30 moritz gfldex: no, it's quite obvious
08:31 gfldex where is that doced then?
08:31 moritz gfldex: you define an infix:</>. If it's not a multi, it's the only infix:</> visible in that scope
08:31 zakame I'll make a release, then try to check on the 2 issues still open for it
08:32 moritz this is nothing special to operators; it's the same for all subs
08:32 gfldex that wasn't my question
08:32 gfldex where in the docs do we tell the reader?
08:33 moritz where do we tell the reader what?
08:33 moritz that subs without "multi" aren't multis?
08:36 rindolf joined #perl6
08:37 moritz if you think it would have helped you, you can add an explanation to the section on Multiple Dispatch
08:42 gfldex it would have helped me to know that the dispatcher will ignore candidates in any outer scope if there is a non-multi in the given scope
08:42 gfldex guess what, nobody ever told me!
08:43 moritz then spread the knowledge! :-)
08:48 lowbro joined #perl6
08:48 lowbro joined #perl6
08:52 Ven`` joined #perl6
08:55 ChoHag joined #perl6
08:56 mr-foobar joined #perl6
09:03 Cabanossi joined #perl6
09:06 piojo joined #perl6
09:09 Aaronepower joined #perl6
09:15 margeas joined #perl6
09:27 ChoHag joined #perl6
09:45 eliasr joined #perl6
09:48 Cabanossi joined #perl6
09:51 wamba joined #perl6
09:59 TimToady joined #perl6
10:07 tbrowder o/ #perl6
10:08 DrForr Ahoj.
10:08 teatime Good $greeting-time, $person-name!
10:08 tbrowder ref Test: any easy way to test for a non-zero exit code on linux?
10:09 teatime like in a shell script?
10:09 Aaronepower joined #perl6
10:09 teatime after you execute a command, $? is the exit code.
10:10 tbrowder dies-ok seems to need an exception
10:10 teatime or you can just put it in an if statement; in shell, 0 is true.
10:10 teatime ah.
10:11 jnthn $ ./perl6-m -e 'use Test; dies-ok { run("/bin/false") }'
10:11 jnthn ok 1 -
10:12 zakharyas joined #perl6
10:12 tbrowder we can use exit n to tell the system an error, it eoul be nice to have a Test test for that
10:12 tbrowder s/eoul/would/
10:13 * teatime tries to figure out why jnthn's example works; it doesn't appear that throws an exception?
10:14 tbrowder jnthn: hm, as teatime says, how does that work?
10:16 Aaronepower joined #perl6
10:18 tbrowder in my code for failures i'm using CATCH and using die then. Shouldn't the die trigger dies-ok?
10:19 jnthn It depends on the return value of run being sunk
10:19 jnthn If that doesn't happen inside of the try block then it won't throw an exception inside of there
10:19 jnthn Can force it with sink run(...)
10:21 tbrowder hm, have to check on use of sink. Thanks jnthn.
10:27 * teatime tries to figure out why the examples have '>foo.txt' as the filename instead of 'foo.txt'.  https://docs.perl6.org/routine/run#(IO)_sub_run
10:29 teatime not that it technically affects the examples, but it confused me for a second thinking shell redirection was involved
10:30 jast classic Perl syntax for selecting the open mode
10:31 teatime ah, yeah, it is, but that isn't what's going on there
10:33 BooK Zoffix: https://rt.perl.org/Public/Bug/Display.html?id=132140 # as promised
10:47 ChoHag joined #perl6
10:50 geekosaur it's demonstrating that it created and removed a file whose name contains a shell metacharacter
10:50 teatime ahhh
10:50 geekosaur that should probably be mentioned somewhere as the reason for the example
10:50 teatime thank you.
11:11 cdg joined #perl6
11:48 Cabanossi joined #perl6
11:50 Geth ¦ doc/robertle-perl5-regex-adverb: 71b11fdd7a | (Robert Lemmen)++ (committed using GitHub Web editor) | doc/Language/regexes.pod6
11:50 Geth ¦ doc/robertle-perl5-regex-adverb: Document :Perl5 adverb
11:50 Geth ¦ doc/robertle-perl5-regex-adverb: review: https://github.com/perl6/doc/commit/71b11fdd7a
11:50 Geth ¦ doc: robertlemmen++ created pull request #1571: Document :Perl5 adverb
11:50 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1571
11:52 ShalokShalom_ joined #perl6
12:04 pmurias joined #perl6
12:04 rindolf joined #perl6
12:06 virtualsue_ joined #perl6
12:06 abraxxa joined #perl6
12:07 domidumont joined #perl6
12:11 piojo_ joined #perl6
12:12 ram_ joined #perl6
12:18 travis-ci joined #perl6
12:18 travis-ci Doc build passed. Robert Lemmen 'Document :Perl5 adverb'
12:18 travis-ci https://travis-ci.org/perl6/doc/builds/278150945 https://github.com/perl6/doc/commit/71b11fdd7a70
12:18 travis-ci left #perl6
12:25 AlexDaniel joined #perl6
12:30 vendethiel- joined #perl6
12:30 zakame hi again o/ how's perl6 on the jvm?  I was checking MIME::Base64::Perl's code and saw it unwrap <'a' ..'z'> ranges due to a jvm bug, but its from 2015
12:31 timotimo hm, have there been commits to that repo recently at all? besides maybe updating the META6 file or something?
12:32 Geth ¦ doc/robertle-perl5-regex-adverb: 769ff7b1f0 | (Robert Lemmen)++ (committed using GitHub Web editor) | doc/Language/regexes.pod6
12:32 Geth ¦ doc/robertle-perl5-regex-adverb: reword to avoid perl5-is-old suggestions
12:32 Geth ¦ doc/robertle-perl5-regex-adverb: review: https://github.com/perl6/doc/commit/769ff7b1f0
12:35 zakame yep I updated it a while ago for a version bump, it is being packaged for Fedora by someone else
12:36 moritz zakame: rakudo on JVM is in a bit of a sad state, afaict
12:39 zakame i see, I tried building it my rakudobrew but invoking perl6 gives me "java.nio.file.NoSuchFileException: blib/Perl6/BOOTSTRAP.jar"
12:42 zakharyas joined #perl6
12:44 skids joined #perl6
12:49 piojo joined #perl6
12:50 [Coke] how to use [==] @stuff with an arbitrary sub instead of an op?
12:51 timotimo [[&sub]] i'd expect
12:51 timotimo since [&sub] is how you turn any sub into an infix operator
12:51 Zoffix .
12:51 yoleaux 02:40Z <skids> Zoffix: https://github.com/skids/perl6-ArithFunctor <== persisiting types aross math without "is Int" or whatnot.
12:51 [Coke] ok. what about an inline sub right there?
12:51 timotimo m: sub test($a, $b) { say "$a test $b" }; [[&test]] 1, 2, 3, 4, 5
12:51 camelia rakudo-moar 045ef4: OUTPUT: «Potential difficulties:␤    Useless use of [[&test]] in sink context␤    at <tmp>:1␤    ------> 3sub test($a, $b) { say "$a test $b" }; 7⏏5[[&test]] 1, 2, 3, 4, 5␤1 test 2␤True test 3␤True test 4␤True test 5␤»
12:51 Zoffix skids: but by defining a million of ops, something I uinderstood grondilu wished to avoid.
12:51 timotimo hm, or not.
12:51 timotimo oh, it was correct!
12:51 rgrau joined #perl6
12:52 timotimo just doesn't like me using it for side-effects :)
12:52 timotimo which makes a lot of sense
12:52 skids Zoffix: yes, but they can be defined once by that module, and never again no matter how many people use it.
12:52 Zoffix [Coke]: can't have whitespace in there, so that pretty much makes inline sub impossible..
12:52 timotimo [Coke]: you can still use the .reduce method instead, where you can put an inline sub without trouble
12:53 Zoffix skids: is it in the ecosystem? Don't show up on MP6.o
12:53 [Coke] timotimo zoffix thanks.
12:53 timotimo doesn't read as nicely of course, though with a "given" you can put the list in the back and the sub in the front
12:53 skids No I just wrote the draft last night.
12:54 skids It will be useful to find out where it breaks, because that will point to a few places where maybe we should have coercive params on core functions.
12:54 timotimo m: say .reduce(sub $a, $b { $a + $b }) given <1 2 3 4>
12:54 camelia rakudo-moar 045ef4: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3say .reduce(sub7⏏5 $a, $b { $a + $b }) given <1 2 3 4>␤    expecting any of:␤        new name to be defined␤»
12:54 timotimo m: say .reduce(sub :: $a, $b { $a + $b }) given <1 2 3 4>
12:54 camelia rakudo-moar 045ef4: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3say .reduce(sub ::7⏏5 $a, $b { $a + $b }) given <1 2 3 4>␤    expecting any of:␤        new name to be defined␤»
12:54 timotimo m: say .reduce(sub :: ($a, $b) { $a + $b }) given <1 2 3 4>
12:54 camelia rakudo-moar 045ef4: OUTPUT: «10␤»
12:54 timotimo what is wrong with me right now :)
12:55 Zoffix skids: might want to run it by grondilu :) They were the ones making custom numerics
12:55 Zoffix m: say .reduce({ $^a + $^b }) given <1 2 3 4>
12:55 camelia rakudo-moar 045ef4: OUTPUT: «10␤»
12:57 [Coke] reduce isn't quite the same as [==] though;
12:57 [Coke] it's doing something slightly different.
12:57 timotimo oh, it doesn't necesarily know about chaining
12:57 [Coke] (so, good for adding everything together, but not chaining a comparison)
12:57 timotimo m: say .reduce(&infix:<==>) given <2 2 2 2 2>
12:57 camelia rakudo-moar 045ef4: OUTPUT: «True␤»
12:57 timotimo it can, but the op has to be marked chaining, i'd say
12:58 moritz but &infix:<==> is chaining
12:58 moritz oh
12:58 moritz m: say .reduce(&infix:<==>) given <2 2 2 2 3>
12:58 camelia rakudo-moar 045ef4: OUTPUT: «False␤»
12:59 moritz m: say [&&] <2 2 2 2>.rotor(2 => -1).map(&[==])
12:59 camelia rakudo-moar 045ef4: OUTPUT: «True␤»
12:59 moritz m: say [&&] <2 2 2 2 3>.rotor(2 => -1).map(&[==])
12:59 camelia rakudo-moar 045ef4: OUTPUT: «True␤»
12:59 timotimo hm, whoops?
12:59 timotimo m: say <2 2 2 3>.rotor(2 => -1).map(&[==])
12:59 camelia rakudo-moar 045ef4: OUTPUT: «(True True)␤»
12:59 moritz it's considering the sublist a single item
12:59 timotimo that's not enough
12:59 Zoffix m: say [&&] <2 2 2 2 3>.rotor(2 => -1)
13:00 camelia rakudo-moar 045ef4: OUTPUT: «(2 3)␤»
13:00 Zoffix m: say [&&] <2 2 2 2 3>.rotor(2 => -1).flat.map(&[==])
13:00 camelia rakudo-moar 045ef4: OUTPUT: «False␤»
13:00 timotimo well, that just gives you the last true one
13:00 moritz m: say <2 2 2 3>.rotor(2 => -1).map({ &[==](|$_)})
13:00 camelia rakudo-moar 045ef4: OUTPUT: «(True True False)␤»
13:00 moritz m: say [&& ] <2 2 2 3>.rotor(2 => -1).map({ &[==](|$_)})
13:00 camelia rakudo-moar 045ef4: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3say [&& ] <27⏏5 2 2 3>.rotor(2 => -1).map({ &[==](|$_)}␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statemen…»
13:00 moritz m: say [&&] <2 2 2 3>.rotor(2 => -1).map({ &[==](|$_)})
13:00 camelia rakudo-moar 045ef4: OUTPUT: «False␤»
13:00 moritz m: say [&&] <2 2 2 2>.rotor(2 => -1).map({ &[==](|$_)})
13:00 camelia rakudo-moar 045ef4: OUTPUT: «True␤»
13:00 Zoffix m: say .reduce(&infix:<==>) given <2 2 2 2 1>
13:00 camelia rakudo-moar 045ef4: OUTPUT: «False␤»
13:00 Zoffix m: say .reduce(&infix:<==>) given <2 2 2 2 1>
13:01 camelia rakudo-moar 045ef4: OUTPUT: «False␤»
13:02 mcmillhj joined #perl6
13:04 [Coke] m: ?all(<4 6 8 7 5>.sort.rotor(2=>-1).map({$_[0]+1==$_[1]}))
13:04 camelia rakudo-moar 045ef4: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "?" in expression "?all(<4 6 8 7 5>.sort.rotor(2=>-1).map({$_[0]+1==$_[1]}))" in sink context (line 1)␤»
13:04 [Coke] m: say ?all(<4 6 8 7 5>.sort.rotor(2=>-1).map({$_[0]+1==$_[1]}))
13:04 camelia rakudo-moar 045ef4: OUTPUT: «True␤»
13:05 * moritz loves rotor
13:06 moritz last used in https://gist.github.com/moritz/8cd941011b5a947e5401ce23fe279e84
13:06 * [Coke] usually feels like he's failed if he needs it. :|
13:07 moritz in the gist above I think it's a perfectly legitimate use case
13:07 Ven`` I'm mostly thankful I don't have to do it by hand, usually.
13:07 Ven`` o/, #perl6
13:07 [Coke] m: [&&] <4 6 8 7 5>.sort.rotor(2=>-1).map({$_[0]+1==$_[1]}) # there, no junctions, at least.
13:07 camelia rakudo-moar 045ef4: ( no output )
13:07 moritz ok, something  @border Z=> @borders[1..*] might worked too, but I don't think rotor is wrong in any way there
13:08 cdg joined #perl6
13:11 Ven`` moritz: that doesn't "go around" though
13:11 moritz Ven``: and for my use case, it shouldn't
13:12 Ven`` alright :-)
13:40 wamba joined #perl6
13:40 headcase joined #perl6
13:52 timotimo [Coke]: why not more like .[0] .. .[*-1] eqv @$_ given <4 6 8 7 5>.sort
13:52 timotimo m: .[0] .. .[*-1] eqv @$_ given <4 6 8 7 5>.sort
13:52 camelia rakudo-moar 045ef4: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "eqv" in expression ".. .[*-1] eqv @$_" in sink context (line 1)␤»
13:52 timotimo m: say .[0] .. .[*-1] eqv @$_ given <4 6 8 7 5>.sort
13:52 camelia rakudo-moar 045ef4: OUTPUT: «False␤»
13:52 timotimo ah, yes, range isn't eqv a list
13:52 timotimo m: say (.[0] .. .[*-1]).List eqv $_.List given <4 6 8 7 5>.sort
13:52 camelia rakudo-moar 045ef4: OUTPUT: «False␤»
13:53 timotimo m: (say (.[0] .. .[*-1]).List.perl; say $_.List.perl) given <4 6 8 7 5>.sort
13:53 camelia rakudo-moar 045ef4: OUTPUT: «(4, 5, 6, 7, 8)␤(IntStr.new(4, "4"), IntStr.new(5, "5"), IntStr.new(6, "6"), IntStr.new(7, "7"), IntStr.new(8, "8"))␤»
13:53 Ven`` mh.
13:53 timotimo haha
13:54 timotimo m: say (.[0] .. .[*-1]).List eqv $_.List given (4, 6, 8, 7, 5).sort
13:54 camelia rakudo-moar 045ef4: OUTPUT: «True␤»
13:54 timotimo [Coke]: you like that more?
13:54 Ven`` :\
13:58 timotimo oh oh oh oh
13:58 timotimo how about this
13:59 timotimo m: say [==] $_ Z- 1..* given <4 6 8 7 5>.sort
13:59 camelia rakudo-moar 045ef4: OUTPUT: «True␤»
13:59 timotimo m: say [==] $_ Z- 1..* given <4 6 8 7 999>.sort
13:59 camelia rakudo-moar 045ef4: OUTPUT: «False␤»
13:59 timotimo [Coke]: i like this one the best :D
13:59 Ven`` Perl 6.
14:01 rindolf joined #perl6
14:02 timotimo of course now you can't just .squish to get rid of duplicates
14:05 headcase joined #perl6
14:08 Khisanth joined #perl6
14:09 cdg joined #perl6
14:19 headcase joined #perl6
14:33 bdmatatu joined #perl6
14:35 rngoodn joined #perl6
14:41 ChoHag joined #perl6
14:48 Cabanossi joined #perl6
14:56 kyan joined #perl6
14:56 itaipu joined #perl6
14:59 cdg joined #perl6
15:07 jdv79 timotimo: got it.  its just endianness issue.
15:07 timotimo jdv79: huh, we have to manually htons the port number?
15:08 timotimo well, maybe ntohs
15:08 jdv79 yup
15:08 timotimo m(
15:08 jdv79 i'll try to code and test it
15:08 timotimo thanks!
15:11 kyan Hi! What am I doing wrong here?
15:11 kyan p6: grammar EM { token identifier { \d+ } }; sub runParserTest(Str $code, Pair $rule) { say $code; say $rule.WHAT; }; runParserTest("foo(String, String qux?, *)", :rule<identifier>);
15:11 camelia rakudo-moar 045ef4: OUTPUT: «Too few positionals passed; expected 2 arguments but got 1␤  in sub runParserTest at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
15:13 timotimo kyan: you forgot to mark the $rule parameter as named in the sub declaration
15:14 timotimo oh
15:14 timotimo you wanted a positional pair, you need to put parenthesis around the pair, or use "rule" => "identifier" (including the quotation marks on the left of the =>)
15:14 kyan They should both be positional...
15:15 timotimo no, when you pass it like that it's a named argument
15:15 timotimo the caller makes that decision, not the callee
15:15 timotimo it's purely syntactical
15:15 * timotimo AFK again
15:15 kyan Thank you!
15:16 * kyan not sure why that's named there, probably need to familiarize more with routine call syntax
15:17 perlpilot :foo<blah> and  foo => "blah" are considered named args
15:18 teatime that they look like Pair's is entirely intentional
15:19 kyan Oh, so I can also write this like, Str $code, Str :$rule
15:19 kyan (in the routine signature)
15:19 b2gills p6: grammar EM { token identifier { \d+ } }; sub runParserTest(Str $code, Pair $rule) { say $code; say $rule.WHAT; }; runParserTest("foo(String, String qux?, *)", (:rule<identifier>));
15:19 camelia rakudo-moar 045ef4: OUTPUT: «foo(String, String qux?, *)␤(Pair)␤»
15:20 b2gills p6: grammar EM { token identifier { \d+ } }; sub runParserTest(Str $code, Str :$rule) { say $code; say $rule.WHAT; }; runParserTest("foo(String, String qux?, *)", :rule<identifier>);
15:20 camelia rakudo-moar 045ef4: OUTPUT: «foo(String, String qux?, *)␤(Str)␤»
15:23 grondilu m: proto f(Int $) {*}; subset Odd of Int where * % 2; sub g(Odd $x) { f($x) }
15:23 camelia rakudo-moar 045ef4: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Calling f(Int) will never work with declared signature ␤at <tmp>:1␤------> 3Odd of Int where * % 2; sub g(Odd $x) { 7⏏5f($x) }␤»
15:23 grondilu ^why?
15:24 grondilu I'm not calling f(Int), I'm calling f(Odd)
15:25 grondilu m: proto f(Int $) {*}; subset Odd of Int where * % 2; multi f(Odd $) { 0 }; sub g(Odd $x) { f($x) }
15:25 camelia rakudo-moar 045ef4: ( no output )
15:25 grondilu I guess I have to write a candidate for f
15:29 jonas1 joined #perl6
15:30 SHODAN joined #perl6
15:37 headcase joined #perl6
15:42 kyan Ok, so in this, if I understand correctly, baz() gets called with a single named parameter called "foo" with the value "bar".
15:42 kyan p6: sub baz(Pair $qux) { say $qux.WHAT; }; my Str $foo="bar"; say :$foo.WHAT; baz(:$foo);
15:42 camelia rakudo-moar 045ef4: OUTPUT: «(Pair)␤Too few positionals passed; expected 1 argument but got 0␤  in sub baz at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
15:42 kyan So, that makes me assume Pairs get interpreted as named parameters when passed to subs.
15:43 kyan However, this produces a different result:
15:43 kyan p6: sub baz(Pair $qux) { say $qux.WHAT; }; my Str $foo="bar"; my Pair $example=:$foo; say $example.WHAT; baz($example);
15:43 camelia rakudo-moar 045ef4: OUTPUT: «(Pair)␤(Pair)␤»
15:43 kyan Is it only when a Pair is created within the context of a routine call that it is interpreted as named parameters?
15:44 grondilu there are rules about that indeed.  It's documented in S06
15:44 grondilu if you want a Pair not to be interpreted as a named parameter, enclose it with parenthesis
15:44 grondilu IIRC
15:45 b2gills or you can use 'foo' => 'bar' for a positional
15:45 kyan Yeah, that works, I just didn't get why it works (since it would still be the same type)
15:45 grondilu see "Named arguments" section in S06
15:46 b2gills In this case it is about syntax, not about type
15:46 perlpilot kyan: wrt your "different result", it's a syntactic thing, not a type thing.
15:46 kyan Ok. Thanks!
15:46 kyan grondilu: (this? Seems to be what I want. https://github.com/perl6/roast/blob/master/S06-signature/named-parameters.t)
15:47 grondilu no that the test suite
15:47 grondilu I was talking about synopsis
15:48 * kyan thought the test suite was the current version of the synopses... probably misunderstood something
15:48 grondilu https://github.com/perl6/specs/blob/master/S06-routines.pod
15:48 Cabanossi joined #perl6
15:49 kyan Ohhhh, ok, for some reason I thought that was obsolete. Thanks!
15:49 perlpilot S06: Named arguments
15:49 perlpilot S06:Named arguments
15:49 synopsebot6 Link: http://design.perl6.org/S06.html#Named_arguments
15:49 piojo joined #perl6
15:49 grondilu Seems like people prefer the docs in docs.perl6.org lately, but I still rely on the synopsis personally
15:50 kyan Oh, it says "Note: these documents may be out of date". That's why I had that impression
15:50 perlpilot grondilu: heh, me too!  They seem to have more information
15:50 grondilu (they are just easier to read on the console)
15:51 [Coke] wrote a one line "json-tidy" that is "use JSON::Fast; say to-json from-json $*ARGFILES.slurp;" \o/
15:52 [Coke] (which will be super useful dealing with the rancher CLI)
15:54 perlpilot [Coke]: I tend to use jq for tidying.  Plus it's quite useful if you have wade through large json data or transform it into other json data
15:54 kyan Huh, this is weird. Grammar::Tracer doesn't seem to do anything unless it's included at the beginning of my script, so I can't conditionally include it when a test fails
15:55 perlpilot kyan: It modifies the way the grammar is built, so yeah.
15:56 ugexe you could capture the output (assuming nothing else gets output but the debug info while parsing), and output what you captured conditionally
15:57 mr-foobar joined #perl6
15:57 kyan Ooh, that's a good idea.
15:57 kyan Thanks!
15:57 ugexe IO::Capture::Simple is a module that can capture output
16:01 nadim joined #perl6
16:01 headcase joined #perl6
16:01 skids grondilu: If you want to compare your Int-bending endeavors to the way you specifically said you didn't want to do things, I drafted up https://github.com/skids/perl6-ArithFunctor last night.
16:03 mcmillhj joined #perl6
16:07 khw joined #perl6
16:20 mcmillhj joined #perl6
16:20 Zoffix m: -> Pair $p { dd $p }( :foo<bar>.Pair ) # also works, if you want to make distinction more obvious
16:20 camelia rakudo-moar 045ef4: OUTPUT: «:foo("bar")␤»
16:24 kyan Erm, I have another question...
16:24 kyan p6: use IO::Capture::Simple; sub a() { if ( capture_stdout { return True; }; ) { say "Hi!"; }; }; a; # should print Hi!
16:24 camelia rakudo-moar 045ef4: OUTPUT: «===SORRY!===␤Could not find IO::Capture::Simple at line 1 in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-1/share/perl6/site␤    /home/camelia/rakudo-m-inst-1/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-1/share/perl6␤    C…»
16:25 kyan ...oh. Well, anyway, it prints "True" instead of "Hi!".
16:27 Zoffix That module's code looks rather wrong. It only ever implements .print method so it'll fail to capture a lots of things
16:27 timotimo it's rather old, isn't it ...
16:27 Zoffix kyan: that line of code doesn't print anything for me...
16:28 timotimo perhaps kyan ran it in the repl?
16:28 Zoffix Yeah, it's from Oct, 2016. So it was last updated before 2 major IO refactors and assumes too much about IO::Handle implementation.
16:28 kyan Ah, I just discovered something:
16:28 kyan p6: sub a() { if ( { return True; } ) { say "Hi!"; }; }; a(); # should print Hi!
16:28 camelia rakudo-moar 045ef4: OUTPUT: «Hi!␤»
16:29 Zoffix I'd expect it not to print Hi
16:29 piojo joined #perl6
16:29 Zoffix Ah, never mind, it doesn't run the block with return at all
16:30 kyan p6: sub a() { if ( { return False; } ) { say "Hi!"; }; }; a(); # should print nothing
16:30 camelia rakudo-moar 045ef4: OUTPUT: «Hi!␤»
16:30 kyan That one prints Hi! too. Weird.
16:30 kyan I definitely don't understand something here
16:30 DerAlex joined #perl6
16:31 timotimo m: say so { say "hi" }
16:31 camelia rakudo-moar 045ef4: OUTPUT: «True␤»
16:31 Zoffix kyan: you're not executing the block with return, so it's just treated as a noud and it's always true
16:31 timotimo yup
16:31 Zoffix kyan: and even if it did execute, `return` returns from routines, not blocks, so it'd return from your sub
16:31 kyan Oh, I see.
16:31 Zoffix s/noud/noun/;
16:32 teatime dang, thought for sure I was about to learn another obscure perldev term/acronym.
16:32 Zoffix :)
16:32 kyan What's the right way to make a block exit with a failing status?
16:32 mcmillhj joined #perl6
16:32 * kyan had already googled "noud perl6"
16:32 teatime me too.
16:32 Zoffix lol
16:33 timotimo we can totally coin that for something useful
16:33 timotimo newcomers will love it
16:33 Cabanossi joined #perl6
16:33 Zoffix kyan: it'd just need to be the last statement. I think there's a plan to implement `leave` or something or other, but it's not done yet.
16:34 Zoffix kyan: or you could use just a sub instead.
16:34 Zoffix Also, you don't need parentheses around if's condition
16:34 Zoffix p6: sub a { if sub { return True; }() { say "Hi!" } }; a;
16:34 camelia rakudo-moar 045ef4: OUTPUT: «Hi!␤»
16:34 Zoffix p6: sub a { if sub { return False; }() { say "Hi!" } }; a;
16:34 camelia rakudo-moar 045ef4: ( no output )
16:34 headcase joined #perl6
16:34 kyan Ah, I see. Thanks!
16:35 * kyan is used to Bash, where: if (exit 1); then echo "Hi"; fi # prints nothing
16:37 Zoffix kyan: but going to your IO::Capture code. The code block you give to capture_stdout is meant to be the code that contains all the things you want to capture and its return value is ignored. So instead of `return True` you need something like `print "meows"` inside. And the routine returns the captured string, so your `if` will say "Hi" only if the block given to capture_stdout prints something
16:39 Zoffix kyan: and as I've said, it only captures .print method of IO::Handle, not a handful of other methods that can also generate output. There's IO::MiddleMan that captures all of them (I think), but it's too a bit out of date. The Right Method™ would be to override just the special methods but they're not yet part of the language and their names are contentious and might change
16:39 Zoffix buggable: eco middleman
16:39 buggable Zoffix, IO::MiddleMan 'hijack, capture, or mute writes to an IO::Handle': https://github.com/zoffixznet/perl6-IO-MiddleMan
16:40 Zoffix kyan: but.... IO::Capture::Simple will crash if a method it doesn't capture is called, so at least you have a reliable and known failure mode.
16:40 Zoffix $ perl6 -e 'use IO::Capture::Simple; sub a() { if ( capture_stdout { $*OUT.say: "meow" }; ) { say "Hi!"; }; }; a;'
16:40 Zoffix Cannot resolve caller say(<anon|32822880>: Str); none of these signatures match:
16:40 kyan Interesting. Thanks.
16:41 hankache joined #perl6
16:41 Zoffix $ perl6 -e 'use IO::Capture::Simple; sub a { if capture_stdout { say "meow" } { say "Hi! I captured $^captured_stuff" } }; a;'
16:41 Zoffix Hi! I captured meow
16:41 kyan Strangely, use IO::Capture::Simple; sub a { if sub { capture_stdout { return True; }; }() { say "Hi!" }; }; a; # prints Hi!
16:41 |oLa| joined #perl6
16:41 kyan use IO::Capture::Simple; sub a { if sub { capture_stdout { return False; }; }() { say "Hi!" }; }; a; # prints ()
16:44 kyan This conditional actually does what I want
16:44 kyan if sub { ! capture_stdout { if ! ( EM.parse($code, :$rule) ) { return False; }; else { return True; }; }; }() {
16:44 Aaronepower joined #perl6
16:44 kyan I can't say as I'm sure *why* it works, but it does.
16:45 kyan Thanks!
16:45 mcmillhj joined #perl6
16:45 Zoffix kyan: looks like there's a bug...
16:45 Zoffix m: sub foo (&code) { code }; foo {return True}
16:45 camelia rakudo-moar 045ef4: OUTPUT: «Attempt to return outside of any Routine␤  in block <unit> at <tmp> line 1␤␤»
16:46 Zoffix The control exception gets thrown from where the code is at, rather than where it's called.
16:46 Zoffix bisect: sub foo (&code) { dd "Got code"; code }; foo(-> {return True})
16:46 bisectable6 Zoffix, On both starting points (old=2015.12 new=045ef44) the exit code is 1 and the output is identical as well
16:46 bisectable6 Zoffix, Output on both points: «"Got code"␤Attempt to return outside of any Routine␤  in block <unit> at /tmp/xJdjY9Vub7 line 1␤»
16:47 grumble joined #perl6
16:47 jnthn return is lexical
16:48 Zoffix kyan: that code doesn't work. It relies on a bug. As I've said, capture_stdout ignores the return value of its block. It returns the captured string
16:48 jnthn So being in dynamic scope ain't enough
16:48 Zoffix s/bug/feature/;
16:49 kyan Right. I've got a program that does what I want at the moment, though....
16:49 kyan https://github.com/ethus3h/ember-information-technology-environment/blob/master/implementations/p6/em.p6#L35
16:49 kyan output: https://gist.github.com/ethus3h/1317b46fdc97c2be030370161a4a3338
16:50 kyan that's likely to break, once the bug is fixed?
16:50 Zoffix kyan: sounds all you want is not capture anything, but rather silence output while the method runs.
16:50 kyan Zoffix: yup
16:50 Zoffix kyan: ther's no bug. jnthn++ clarified that return is lexical.
16:51 kyan Oh. Ok. I guess I don't understand exactly (probably I just lack the requisite programming chops), but yay, thanks!
16:52 kyan Oh, I see! It's because the returns are returning from the enclosing sub, rather than from the brace-enclosed argument to capture_stdout.
16:52 Zoffix kyan: you don't need a module at all: sub noisy { "meow".say; True }; sub silenced (&code) { temp $*OUT = class { method print ($) {} }; code }; say silenced { noisy }
16:52 kyan Iiiinteresting. Thanks!
16:52 Zoffix m: sub noisy { "meow".say; 42 }; sub silenced (&code) { temp $*OUT = class { method print ($) {} }; code }; say silenced { noisy }
16:52 camelia rakudo-moar 045ef4: OUTPUT: «42␤»
16:53 kyan Cool, thanks!
16:55 kyan Cool, thanks!
16:56 kyan ...oops. Was trying to rerun the last command in the terminal. Got IRC instead.
16:56 Zoffix :)
16:56 kyan Sorry. Anyway, the silenced sub works great, and is much more elegant. Thanks! :)
16:56 Zoffix Any time.
16:58 domidumont joined #perl6
16:58 mr-foobar joined #perl6
16:59 tbrowder ref ecosystem:  i have a new module ready that generates a rudimentary man page from data in the META6.json file.  On *NIX machines it would be nice if zef could create and install the man page (assuming there is not another one in, say, the man dir of the module source).
17:01 domidumont joined #perl6
17:02 leont joined #perl6
17:02 Zoffix huggable: silence output :is: A sub to silence output: sub run-silenced (&code) { temp $*OUT = temp $*ERR = class { BEGIN { ::?CLASS.^add_method: $_, my method (*@) {} for qw/say put print print-nl/ } }.new; code }; say run-silenced { say "meow"; note "moo"; 42 }; say "look"; note "previous code got silenced"
17:02 huggable Zoffix, Added silence output as A sub to silence output: sub run-silenced (&code) { temp $*OUT = temp $*ERR = class { BEGIN { ::?CLASS.^add_method: $_, my method (*@) {} for qw/say put print print-nl/ } }.new; code }; say run-silenced { say "meow"; note "moo"; 42 }; say "look"; note "previous code got silenced"
17:02 tbrowder see the generated troff page at this gist: https://gist.github.com/tbrowder/9daa98b971d5c08dc36d32580906193d#file-meta6-to-man
17:03 Zoffix ^ a more generic silencing sub that'll work on more methods and silnce STDERR too
17:03 mcmillhj joined #perl6
17:03 Cabanossi joined #perl6
17:04 Zoffix Oh wait, missing a couple methods
17:04 tbrowder see the code at https://github.com/tbrowder/META6-To-Man-Perl6
17:05 Zoffix m: sub run-silenced (&code) { temp $*OUT = temp $*ERR = class { BEGIN { ::?CLASS.^add_method: $_, my method (*@) {} for qw/say put print print-nl printf write/ } }.new; code }; say run-silenced { say "meow"; note "moo"; 42 }; say "look"; note "previous code got silenced"
17:05 camelia rakudo-moar 045ef4: OUTPUT: «42␤previous code got silenced␤look␤»
17:05 wamba joined #perl6
17:05 tbrowder not in ecosystem yet but will be soon
17:05 Zoffix Un 6.d will just need to `class { method print-internal (*@) {} }` or whatever the bikeshedded name will be
17:06 jnthn write-internal, though note it does bytes :)
17:06 Zoffix Oh right :)
17:06 jnthn But of course, then you cover binary writes too :)
17:07 * jnthn wanders home after all day doing tricky supply guts stuff
17:10 stmuk joined #perl6
17:11 tbrowder also ref ecosystem: META6 shows only three keys that are required in the specs (name, version, description); seems to me that a module needs some more required keys to be accepted into the ecosystem, so the specs need updating.
17:14 Rawriful joined #perl6
17:14 preaction joined #perl6
17:19 Aaronepower joined #perl6
17:25 armin joined #perl6
17:25 mr-foobar joined #perl6
17:26 Aaronepower joined #perl6
17:28 Aaronepower joined #perl6
17:31 |oLa| joined #perl6
17:36 Aaronepower joined #perl6
17:37 headcase joined #perl6
17:43 headcase joined #perl6
17:46 itaipu joined #perl6
17:49 headcase joined #perl6
17:54 andrzejku_ joined #perl6
17:54 Aaronepower joined #perl6
18:10 AlexDaniel joined #perl6
18:20 jonas1 joined #perl6
18:23 Roab joined #perl6
18:24 ken1 joined #perl6
18:27 troys joined #perl6
18:30 |oLa| joined #perl6
18:30 Roab m: <foo>.comb.^methods
18:30 camelia rakudo-moar 045ef4: ( no output )
18:30 |oLa| joined #perl6
18:30 Roab m: say <foo>.comb.^methods
18:30 camelia rakudo-moar 045ef4: OUTPUT: «(new new-consumed iterator Capture elems Numeric Int Bool fmt join sink from-loop item hyper race cache lazy flat lazy-if is-lazy Method+{<anon|76960256>}.new Method+{<anon|76960256>}.new Method+{<anon|76960256>}.new Method+{<anon|76960256>}.new Method+{…»
18:31 Roab what's with the anon things there?
18:31 Roab is it Seq specific magic somehow?
18:33 mcmillhj joined #perl6
18:34 Zoffix m: say <foo>.comb.^methods».name
18:34 camelia rakudo-moar 045ef4: OUTPUT: «(new new-consumed iterator Capture elems Numeric Int Bool fmt join sink from-loop item hyper race cache lazy flat lazy-if is-lazy eager List Slip Array Seq Str Stringy gist perl AT-POS EXISTS-POS skip Bag MixHash Mix Set BagHash list SetHash)␤»
18:35 Zoffix s: say <foo>.comb, 'eager', \()
18:35 SourceBaby Zoffix, Something's wrong: (f o o)eager\()␤␤ERR: Cannot resolve caller sourcery(Bool); 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␤␤
18:35 Zoffix s: <foo>.comb, 'eager', \()
18:35 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/045ef448b/src/core/Seq.pm#L77
18:36 rngoodn joined #perl6
18:36 Zoffix s: my method {}, 'gist', \()
18:36 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/045ef448b/src/core/Method.pm#L4
18:37 timotimo Roab: these "anon" thingies in there are roles that have been mixed into the Method object
18:37 Zoffix timotimo: how come they were mixed?
18:37 Zoffix Also where's the name coming from, if Method's .gist is `.name` and `.name` above works fine
18:38 Roab is that something comb does?
18:38 timotimo no, just some methods on the Seq class i guess
18:38 timotimo m: say Seq.^methods
18:38 camelia rakudo-moar 045ef4: OUTPUT: «(new new-consumed iterator Capture elems Numeric Int Bool fmt join sink from-loop item hyper race cache lazy flat lazy-if is-lazy Method+{<anon|76960256>}.new Method+{<anon|76960256>}.new Method+{<anon|76960256>}.new Method+{<anon|76960256>}.new Method+{…»
18:38 timotimo same thing, but without comb
18:39 Roab ah so it is Seq magic :)
18:40 Zoffix Oh, it's nodality stuff
18:40 Roab ?
18:41 Zoffix m: class Foo { method bar {} }.^methods.say
18:41 camelia rakudo-moar 045ef4: OUTPUT: «(bar)␤»
18:41 Zoffix m: class Foo { method bar is nodal {} }.^methods.say
18:41 camelia rakudo-moar 045ef4: OUTPUT: «(bar)␤»
18:41 Zoffix bah
18:41 timotimo interesting, why don't we give the trait that gives things nodality a name, shall we
18:41 Zoffix timotimo: well, I don't get why it loses it at all
18:41 Roab what is nodality about anyway? :)
18:42 Zoffix Roab: whether hypered version of the method descends into iterables
18:42 Zoffix buggable: eco M
18:42 buggable Zoffix, Found 661 results: Bailador, p6doc, panda, 007, zef. See https://modules.perl6.org/s/M
18:42 Zoffix Oh, I deleted that module...
18:43 headcase joined #perl6
18:43 Zoffix m: (^3, [^4], "5")».elems.say; (^3, [^4], "5")».Numeric.say;
18:43 camelia rakudo-moar 045ef4: OUTPUT: «(3 4 1)␤((0 1 2) [0 1 2 3] 5)␤»
18:44 Zoffix Roab: ^ .Numeric descended into iterables and called .Numeric on elements, while .elems didn't
18:44 Zoffix One of them is nodal the other isn't (I forget which :))
18:44 Roab I'd guess the one that gets inflicted on the nodes :)
18:45 Roab so, .Numeric
18:45 Roab I think I get a grasp of that concept now, thank you. still unclear about how that leads to anon methods on Seq tho...
18:46 Aaronepower joined #perl6
18:46 Zoffix I'm still raking at it, trying to figure it out. I just traced the weird names to having the role from that trait mixed into them
18:46 Zoffix m: <foo>.comb.^methods[20].^roles[0].^methods.say
18:46 camelia rakudo-moar 045ef4: OUTPUT: «(nodal)␤»
18:46 Zoffix And its mixed here: https://github.com/rakudo/rakudo/blob/nom/src/core/traits.pm#L355-L359
18:46 bartolin pmurias: sorry, didn't spot your message yesterday. regarding the JVM backend, it's a combination of too few tuits and having no idea how to fix things. (though more tuits could help with the latter, too)
18:47 cdg joined #perl6
18:48 Zoffix m: multi sub trait_mod:<is>(Routine:D $r, :$meow!) { $r.^mixin: role { method nodal(--> True) { } } }; class Foo { method bar is meow {} }; Foo.^methods.say
18:48 camelia rakudo-moar 045ef4: OUTPUT: «(bar)␤»
18:48 Zoffix Doesn't happen here,s o perhaps it's something else....
18:49 Zoffix m: <foo>.comb.^methods[20].say; <foo>.comb.^methods[20].name.say
18:49 camelia rakudo-moar 045ef4: OUTPUT: «Method+{<anon|76960256>}.new␤eager␤»
18:49 Zoffix s: <foo>.comb.^methods[20], 'gist', \()
18:49 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/045ef448b/src/core/Method.pm#L4
18:50 Zoffix ^ just calls .name, yet .name returns a correct name. What's going on :/
18:50 Zoffix oh
18:50 Zoffix Ah :)
18:51 bartolin pmurias: the thing I'm really clueless about is what to do about the evalserver leaking memory. Also, i have no good idea about the new op (nativecallinvoke) -- apart from adding yet another '#?if jvm' conditional ...
18:52 Zoffix No, still don't get it.
18:54 kyan joined #perl6
18:55 Roab m: Seq.^roles.say
18:55 camelia rakudo-moar 045ef4: OUTPUT: «((PositionalBindFailover) (Iterable))␤»
18:56 kyan Hi! I'm back again, with another question :P In my grammar, I have: token parameterListItem { <parameter> <parameterListSeparator> }
18:57 Zoffix \o
18:58 kyan Then, I run some tests. 1. 'String qux?' matches 'parameter'. 2. ', ' matches 'parameterListSeparator'. 3. 'String qux?, ' does *not* match 'parameterListItem', despite being a simple concatenation of the previous two. Do I misunderstand the token syntax?
18:59 moritz kyan: it might help if you pasted (via gist.github.com or similar) the grammar, including paramater and parameterListSeparator, and the input strings you've tried
18:59 teatime kyan: read up on the difference between token and rule
18:59 teatime kyan: since you're using token, it's putting implicit <.ws> in
19:00 teatime wait, no, sorry, I have that backwards
19:00 teatime ignore me
19:00 moritz kyan: what you have observed can happen if <parameter> on its own matches more than just 'String qux?' (for example if it also matches the comma)
19:00 kyan Here's the grammar and tests: https://github.com/ethus3h/ember-information-technology-environment/blob/master/implementations/p6/em.p6
19:00 headcase joined #perl6
19:00 kyan Here is the output of that program: https://gist.github.com/ethus3h/fada06e1b0215014e3f286694963a3b8
19:02 kyan This doesn't match: runParserTest('String qux?,', 'parameter');
19:02 Geth ¦ doc: 23b693916f | (Brian Duggan)++ | doc/Language/py-nutshell.pod6
19:02 Geth ¦ doc: Replace =end with =end code in py-nutshell
19:02 Geth ¦ doc: review: https://github.com/perl6/doc/commit/23b693916f
19:04 moritz kyan: this is weird.
19:05 kyan Well, it mystifies me, anyway ¯\_(ツ)_/¯
19:06 Zoffix kyan: FWIW, `$fail === "f"` is better written as `$fail eq "f"`
19:06 kyan Zoffix: cool, thx.
19:07 Zoffix kyan: which test fails when it's supposed to succeed? Which line?
19:07 Zoffix Does it fail without Grammar::Tracer loaded?
19:07 moritz it does
19:07 Roab kyan, just a thought, maybe Grammar::Debugger or Grammar::Tracer could point something out
19:07 Roab ah nvm, sorry.
19:08 kyan This is the simplest case that fails: https://github.com/ethus3h/ember-information-technology-environment/blob/master/implementations/p6/em.p6#L125
19:08 kyan (you might need to refresh the page — it is: ok runParserTest('String qux?, ', 'parameterListItem');)
19:08 Zoffix moritz: which "it"? The runParserTest('String qux?,', 'parameter');  is meant to pass?
19:08 moritz kyan: oh, it's simpler than I thought
19:08 Zoffix Backtracking
19:08 moritz kyan: EM.subparse('String qux?, ', :rule<parameter>)
19:09 moritz parses 'String qux'
19:09 moritz but not the trailing question mark
19:09 kyan 'String qux?' does match 'parameter', though...
19:09 moritz Zoffix: I was about to turn it into a miniimal test for you, and found the error in the process :-)
19:10 AlexDaniel joined #perl6
19:10 Zoffix moritz: is it tho?
19:11 moritz Zoffix: I'm not sure anymore...
19:11 Zoffix :D
19:11 headcase joined #perl6
19:11 moritz Zoffix: http://perlpunks.de/paste/show/59c40ed5.5723.db
19:11 kyan Zoffix: (runParserTest('String qux?,', 'parameter'); shouldn't pass (and doesn't). runParserTest('String qux?, ', 'parameterListItem'); *should* pass, though, but it also doesn't.)
19:13 Zoffix If I change all `token` to `regex` all tests I green, so I'm going with my earlier wild guess: backtracking
19:13 Zoffix Or lack of it, that is
19:14 kyan I thought token did longest-possible-match selection?
19:15 kyan or, oh.... I think I see what you're saying...
19:15 moritz it does, but there are limits
19:16 Zoffix Well, moritz would know more about this. I don't know how this stuff works :)
19:16 moritz for example it stops at recursion, or at procedural elements
19:16 Aaronepower joined #perl6
19:16 nadim joined #perl6
19:16 moritz and bugs are possible too :-)
19:16 kyan Ok, so I need to write tokens in such a way that they don't need to backtrack, or else use regex. Thanks all. <3
19:17 moritz so, my understanding of the problem is as follows: on its own, if you let token parameter parse the string, it doesn't include the question mark
19:18 moritz but if you run EM.parse('String qux?', :rule<parameter>); the "parse" essentially anchors it to the end of the string, forcing the | to try a different branch
19:19 kyan I see. I'm surprised the rule for parameter doesn't choose the longest-possible, because between <type> | [ <declaration> \?? ] | <value>, the middle is longest
19:19 moritz but, since it's a token, it won't do that when the regex engine tries to backtrack into it, and fails instead
19:20 Zoffix If I make this change, moritz's codesample passes all tests, without requiring `regex`: token parameter { [ <declaration> \?? ] ||  [ <type> | <value> ] }
19:20 headcase joined #perl6
19:22 moritz kyan: I don't see why it takes the shorter path just by eyeballing the grammar
19:22 moritz and I'm too tired to do anything else :-)
19:23 moritz one thing I noticed is that there are several cases where you could factor out common prefixes
19:23 Zoffix moritz: you said it stops LTM at recursion?
19:23 moritz Zoffix: yes
19:23 Zoffix I see <parameter> eventually going for another <parameter> via <declaration> thing
19:24 moritz for example in token declaration, you could put <identifier> at the start, and only then start an alternation
19:24 moritz and identifier is <normalIdentifier> |
19:24 kyan I tried adding another option there, with the \? required, but it didn't prefer that one. [ <declaration> \? ]
19:24 moritz and identifier is <normalIdentifier> | <routineIdentifier>
19:24 moritz but <routineIdentifier> is <normalidentifier> and something else after it
19:25 moritz so just make it token identifier { <normalIdentifier> <parameterList>? }
19:25 moritz much easier to reason about, and probably also faster
19:25 Zoffix parameter -> declaration -> identifier -> routineIdentifier -> parameterList -> parameterListBody -> parameterListFilledBody -> parameter
19:25 Zoffix That's the recursion chain
19:26 moritz Zoffix++
19:26 geekosaur joined #perl6
19:26 moritz token simpleBlock { <line>*<finalLine>? }
19:26 moritz a simpleBlock can be an empty string. Is that desired?
19:27 kyan Thank you! That seems sensible.
19:27 moritz token block { [<simpleBlock>\nblock]|<simpleBlock> } # easier as  token block { <SimpleBlock> [\n <block>]? }
19:27 kyan moritz: I'm not sure, I'm still at the very beginning of this project
19:27 moritz kyan: ok, good luck
19:27 * kyan started really trying to learn Perl 6 yesterday :P
19:28 moritz kyan: I'm kinda writing a book about this stuff right now... want to beta-read a few chapters?
19:28 timotimo oh btw, you can always just put "& .+" at the end of your token or whatever to force the match to be at least one character :)
19:28 kyan moritz: Oh, that change to block makes a lot of sense
19:29 kyan Sure! I'd love to :)
19:29 moritz timotimo: that is... kinda neat and evil :-)
19:30 moritz kyan: https://perlgeek.de/chapter00.pdf that's the table of contents. Pick up to 3 chapters, and tell me your email address (in private message if you want)
19:31 perigrin /w 53
19:31 buggable perigrin, Thank you for entering Accidental /win Lottery! The next draw will happen in 1 week, 2 days, 4 hours, 28 minutes, and 49 seconds
19:31 perigrin yay!
19:31 perigrin I'm a /winner!
19:31 Zoffix :)
19:31 moritz /lose everything
19:31 kyan moritz: Oh, wow, this looks really useful. When's it coming out?
19:32 moritz kyan: with a bit of luck at the of the year
19:32 moritz if not, early Q1 2018
19:32 jdv79 moritz: is the mb4 thing fully implemented yet?
19:32 moritz and on https://perl6book.com/ you can sign up for a mailing list that informs you when it's out
19:33 perlpilot joined #perl6
19:33 moritz jdv79: what mb4 thing?
19:33 jdv79 the irc log utf8mb4 stuff
19:34 kyan moritz: Sweet, chapters 9 through 11 look like they'd be my top picks to read for what I'm working on — I'm at elliot@futuramerlin.com. Thank you!
19:35 perlpilot futura merlin ?
19:35 kyan (No space, but yup.)
19:36 perlpilot The space was needed because it was triggering my "futurama" neurons  :)
19:37 * kyan has a vague impression that that's a television show
19:38 Zoffix science fiction comedy cartoon
19:40 ChoHag joined #perl6
19:41 headcase joined #perl6
19:43 student joined #perl6
19:51 Zoffix OK. Finally reproed the wrong-.gist-on-Method object with my own method.
19:51 * Zoffix will poke at it more after relocation
19:54 student Anyone know anything about the "Learning Pearl 6" book? I saw that it was crowd funded and raised $40k, but was due out at the end of last year.
19:54 Geth ¦ doc: f9d994e8ae | (Robert Lemmen)++ (committed using GitHub Web editor) | doc/Language/regexes.pod6
19:54 Geth ¦ doc: Document :Perl5 adverb (#1571)
19:54 Geth ¦ doc: review: https://github.com/perl6/doc/commit/f9d994e8ae
19:55 moritz student: https://www.kickstarter.com/projects/1422827986/learning-perl-6/updates has some updates
19:56 Zoffix student: it's taking longer than expected. Last update to preview PDF was in august and last updates to changelog mentioned some more recent additions
19:56 moritz student: and https://perl6book.com/ lists some alternatives :-)
19:56 Zoffix student: there are other books available: perl6book.com
19:56 robertle joined #perl6
20:00 student Thanks for the links. Which book(s) that are currently out would you most highly recommend?
20:00 moritz student: what's your starting point?
20:00 moritz student: do you know other programming languages?
20:00 moritz do you know Perl 5?
20:01 timotimo the best books are the one moritz wrote :)
20:01 timotimo also the other books are also the best books
20:01 Zoffix student: I heard good things about Think Perl 6 and its digital version is free, so you could give it a go without risk
20:03 student I do not know perl 5. I know some common lisp, java, python, and c++ but are not an expert in any. I basically use what I am required to use at school/work, but am constantly trying out "new" languages for one that I will really enjoy using.
20:03 perlpilot student: very cool.
20:03 Cabanossi joined #perl6
20:03 moritz then Think Perl 6 might bore you a bit
20:03 AlexDaniel joined #perl6
20:04 Zoffix It's good :) I found knowing Perl 5 a hindrance when learning
20:04 student moritz: really?
20:04 moritz if you like a very example-driven approach, i'd recommend my own book, "Perl 6 Fundamentals". If you prefer a more feature-oriented approach, "Perl 6 Deep Dive"
20:05 perlpilot student: yeah TP6 is more like "this is a variable.  this is a loop." etc.
20:05 moritz student: it's for absolute beginners. It teaches programming, and uses Perl 6 as a tool. It doesn't aim to teach Perl 6 directly
20:05 moritz what's a variable? what's a conditional? what's a scope? What's a string?
20:06 student oh wait... I read your comment wrong.... I read "then I think Perl 6 might bore you a bit."   .... not "Think Perl 6" as a book title haha
20:06 moritz student: :-)
20:06 Zoffix :)
20:07 student I will give "Perl 6 Fundamentals" a google and check it out. Thanks for the recommendation.
20:07 moritz ebook on https://www.apress.com/us/book/9781484228982 print on amazon
20:08 moritz if you do read it, please give me feedback afterwards :-)
20:08 student will do
20:08 AlexDaniel joined #perl6
20:09 perlpilot student: another language you might want to try for fun is Haskell.
20:09 cdg joined #perl6
20:09 student I have tried haskell... I think 3 times... haha
20:09 * moritz tried twice, without much success
20:10 moritz though I got to the point where I thought that I invested a good chunk of time, I'd push through
20:11 student Each time I start I think it is the greatest thing on earth and then get really frustrated when I try to make somthing from scratch and can't do something that is so incredibly simple in another language.
20:11 mcmillhj joined #perl6
20:11 perlpilot student: well, at least with Perl 6 you'll learn all of the concepts that other languages have to offer, so after P6 the others will be easier  ;)
20:11 moritz like, reading lines from a file, doing something to them, and writing them back to another file
20:11 moritz perlpilot: except monads and overzealous type cherks :-)
20:14 perlpilot he already mentioned that he knows Java, so one of those is already taken care of.
20:14 TEttinger joined #perl6
20:15 perlpilot Isn't there a "monads in perl" thing somewhere?  Maybe it could be adapted to Perl 6?
20:15 perlpilot moritz: I mean ... you could write a book about it!  ;)
20:16 student Why do you think Kotlin, Scala, Crystal, Julia, Go, Rust.... etc are always being talked about and Perl 6 is not... I stubled across perl 6 looking into perl 5, but wouldn't have really known about it if I wasn't so into looking at what was out there and wanting to try everything...
20:16 perlpilot student: they have better marketing?  (though I've never heard of Kotlin)
20:17 Zoffix student: because the word on the street is "Perl is dead" and "Perl 6" sounds like just another version of it. No one wants to try dead thinga
20:17 moritz student: many factors... for one, they are younger, so they have the inherent coolness factor attached
20:17 moritz student: Rust as a very radical approach *and* has huge first user (Service) *and* comes from Mozilla
20:18 moritz Go has obvious reasons (Google, and two C programing giants)
20:18 perlpilot yep, and everyone is always talking about goroutines.
20:18 moritz many of these languages have one or two selling points
20:19 moritz there's a heap corruption somewhere? Rust to the rescue!
20:19 student If I end up likeing perl 6 and want to really dive into it.... are there many job oppertunities or is it too new and mainly used by hobbiests and those developing it?
20:19 Zoffix student: also, it was being designed and re-designed for 15 years, with the first release being just 2 years ago. And it was a rocky release, with people being able to properly "use" it for just over a year.... So in that perspective, it's just a baby language
20:19 moritz Perl 6 lacks an obvious tagline
20:19 Zoffix student: not many jobs; too new
20:20 Zoffix student: note that Perl 6 is the last language you'll learn. Tread lightly.
20:20 Zoffix :)
20:20 student haha
20:22 cdg_ joined #perl6
20:23 mcmillhj joined #perl6
20:23 perlpilot I guess Perl 6's biggest hooks are grammars and the asynchronous stuff.   But ... other languages have very similar things too.
20:24 moritz I'm toying with the idea of learning a high-performance language (maybe Julia?) and explore astronomy data analysis
20:24 moritz perlpilot: and Unicode and roles... :-)
20:24 Zoffix To me biggest hook is how consice it is.
20:24 Zoffix And yeah, definitely sane Unicode support
20:25 perlpilot I'm not sure how much the rest of the world really cares about Unicode.
20:26 Zoffix huggable: concise
20:26 huggable Zoffix, Rakudo Concise: https://raw.githubusercontent.com/perl6/marketing/master/TablePosters/Rakudo-Concise/Rakudo-Concise-300ppi.png
20:26 TEttinger examine that sentence, perlpilot
20:26 TEttinger "the rest of the world" as in not USA?
20:26 perlpilot moritz: PDL came to Perl 5 for astronomy data analysis.  It would be nice if Perl 6 could have performant vectors/matrices/tensors
20:26 Zoffix As the poster says it :)
20:27 perlpilot TEttinger: as in "not the denizens of #perl6"
20:27 TEttinger well if world means Earth, then yes the rest of the world cares
20:28 Zoffix I'd say they care a lot. I see people complain all the time about glitches in Unicode support; problems that don't exist for us
20:28 TEttinger I hit one in Java a few weeks ago
20:28 Zoffix like trying to match e with a ' on top of it
20:29 * Zoffix has no idea how to type Unicode fancy things on the phone :)
20:29 * moritz -> sleep
20:29 moritz good * everybody
20:29 Zoffix \o
20:29 * Zoffix & too
20:31 perlpilot Zoffix: if you have an iPhone, you just hold the key down to get a bunch of alternatives.  Dunno about the other phones.
20:35 student Ok... I just purchased the ebook of Perl 6 Fundamentals... time to have some fun...
20:36 mcmillhj joined #perl6
20:40 tony-o get it
20:41 Ven`` joined #perl6
20:42 cpage_ joined #perl6
20:43 vike joined #perl6
20:48 Cabanossi joined #perl6
20:54 mcmillhj joined #perl6
20:59 |oLa| joined #perl6
21:07 Geth ¦ ecosystem: 0c9d4fc131 | (Tom Browder)++ (committed using GitHub Web editor) | META.list
21:07 Geth ¦ ecosystem: add new module META6::To::Man
21:07 Geth ¦ ecosystem:
21:07 Geth ¦ ecosystem: generates a rudimentary UNIX man page from data in a META6.json file
21:07 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/0c9d4fc131
21:08 mcmillhj joined #perl6
21:10 rindolf joined #perl6
21:19 Zoffix Nah, I'm not hip enough for Apple products.
21:26 ChoHag joined #perl6
21:41 [Coke] (other languages better marketing). Perl is also an oddball in that we aren't some company's project (5 or 6)
21:42 pompomcrab joined #perl6
21:43 pompomcrab i am trying to figure out the cleanest idiom for passing a block to a sub as the last param, but can't quite get it
21:44 pompomcrab i.e. sub bash( %args (:$cmd, *%), Block $block?) is export { ... }
21:44 pompomcrab i wish i could mix named params with a positional final param
21:44 pmurias if Perl 6 keeps improving marketing it will become easier
21:45 pompomcrab maybe there is a way using the obscure rarely used "<--" to reverse the execution flow direction ala Haskell's bind?
21:46 rkitover joined #perl6
21:46 pierrot joined #perl6
21:46 jnthn m: sub foo(&block, *%options) { say %options; block() }; foo :bar, :baz, { say 42 }
21:46 camelia rakudo-moar 045ef4: OUTPUT: «{bar => True, baz => True}␤42␤»
21:47 jnthn Dunno if it helps, but the constraint on positionals having to come first only applies on the parameters side, not on the arguments side (where positional and named can be freely intermixed)
21:48 olinkl joined #perl6
21:50 rindolf joined #perl6
21:51 peteretep joined #perl6
21:51 pompomcrab jnthn: thx. i still wish i could put the inline block as the last param, because it's a bit cleaner to not put the rest of the args after a big lambda, but that works for me
21:51 skaji joined #perl6
21:52 Technaton joined #perl6
21:52 karthyk joined #perl6
21:54 S007 joined #perl6
21:54 ccakes joined #perl6
21:57 Ven`` joined #perl6
22:00 Bucciarati joined #perl6
22:00 rodarmor joined #perl6
22:01 sacomo joined #perl6
22:03 Cabanossi joined #perl6
22:05 timotimo pompomcrab: but you can do that
22:06 timotimo m: sub foo-the-block(&block, *%options) { for %options { say "fooing the block $_.key()ishly" }; block() }; foo-the-block :freak, :greed, :green, { say "woop woop the block!" }
22:06 camelia rakudo-moar 045ef4: OUTPUT: «fooing the block greedishly␤fooing the block freakishly␤fooing the block greenishly␤woop woop the block!␤»
22:17 pompomcrab timotimo: woa i didn't realize it worked that way, awesome
22:18 pompomcrab ha ha everytime i get stuck on some little thing it turns out p6 was designed to DWIM. well done, well done
22:18 timotimo yeah, like jnthn said, you can freely mix positionals and nameds on the caller's side
22:18 pompomcrab i just got confused on the difference between the difference between defining the params in the callee and passing args in the caller. d'oh
22:35 okl joined #perl6
22:49 Cabanossi joined #perl6
22:54 headcase joined #perl6
22:54 BenGoldberg joined #perl6
22:59 skids joined #perl6
23:13 lizmat joined #perl6
23:29 mcmillhj joined #perl6
23:33 Cabanossi joined #perl6
23:39 headcase joined #perl6
23:45 mcmillhj joined #perl6
23:53 AlexDaniel squashable6: status
23:53 squashable6 AlexDaniel, Next SQUASHathon in 14 days and ≈10 hours (2017-10-07 UTC-12⌁UTC+14)
23:56 AlexDaniel https://github.com/perl6/whateverable/issues/237
23:57 AlexDaniel holy shit 170 issues… :-S
23:59 mcmillhj joined #perl6
23:59 Juerd AlexDaniel: Maybe you should have a talk with this AlexDaniel person, because they seem to keep opening new ones.

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

Perl 6 | Reference Documentation | Rakudo