Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-07-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:02 ugexe my $p = Proc::Async.new: "perl6", "-e", "exit 255"; my ($stdout, $stderr) = "", ""; $p.stdout.tap: $stdout ~= *; $p.stderr.tap: $stderr ~= *; try { CATCH { default { say "Caught: {$_.perl}" }}; await $p.start; $p.result }; put "OUT: `$stdout`\n\nERR: `$stderr`";
00:02 ugexe Zoffix:
00:03 Zoffix m: try X::AdHoc.new.throw; say 42
00:03 camelia rakudo-moar 8cfd34: OUTPUT«42␤»
00:04 Zoffix ugexe, how come this is catchable but in Proc::Async's case you need the CATCH/default stufF?
00:05 ugexe you really only need `try { await $p.start; $p.result; };`
00:06 Zoffix m: try await start die; say 42
00:06 camelia rakudo-moar 8cfd34: OUTPUT«42␤»
00:06 ugexe otherwise the exception may not be sunk yet
00:07 Zoffix Seems to work fine above, with die
00:07 Zoffix Which looks to me the same as this version with Proc::Async: https://rt.perl.org/Ticket/Display.html?id=128674
00:10 cyphase joined #perl6
00:13 khw joined #perl6
00:21 gfldex that's pretty steady grown: http://redditmetrics.com/r/perl6
00:31 ugexe my $p = Proc::Async.new: "perl6", "-e", "exit 255"; my $foo = await $p.start; say "still here"; say $foo.exitcode; # this works without the try. probably a clue
00:39 Zoffix Ahhh
00:40 Zoffix So it gives try a Proc and that's all fine, but then that Proc sinks and explodes: https://github.com/rakudo/rakudo/blob/nom/src/core/Proc.pm#L129
00:41 Zoffix ugexe++
00:55 dalek doc: 7f007f5 | (Zoffix Znet)++ | doc/Type/Proc (2 files):
00:55 dalek doc: Document behaviour and caveats due to sunk unsuccessful Proc
00:55 dalek doc: review: https://github.com/perl6/doc/commit/7f007f5f51
00:57 dvinciguerra_ joined #perl6
00:58 araujo_ joined #perl6
01:00 araujo_ joined #perl6
01:00 BenGoldberg joined #perl6
01:16 gfldex lolibloggedtwicetoday https://gfldex.wordpress.com/2016/07/20/sneaky-methods/
01:27 dalek doc: ed4d87e | (Wenzel P. P. Peppmeyer)++ | doc/Type/Method.pod6:
01:27 dalek doc: improve free floating methods
01:27 dalek doc: review: https://github.com/perl6/doc/commit/ed4d87eb05
01:27 dalek doc: 3354008 | (Wenzel P. P. Peppmeyer)++ | doc/HomePage.pod6:
01:27 dalek doc: better strict then sorry
01:27 dalek doc: review: https://github.com/perl6/doc/commit/33540087ef
01:31 cdg joined #perl6
01:36 Zoffix m: <a b c>.&({dd $^a; $^a}).say;
01:36 camelia rakudo-moar 58dc8c: OUTPUT«List $a = $("a", "b", "c")␤(a b c)␤»
01:37 Zoffix m: <a b c>.&(my method ::(List:D){dd self; self}).say;
01:37 camelia rakudo-moar 58dc8c: OUTPUT«("a", "b", "c")␤(a b c)␤»
01:37 Zoffix m: my method foo {dd self; self}; <a b c>.&foo.say;
01:37 camelia rakudo-moar 58dc8c: OUTPUT«("a", "b", "c")␤(a b c)␤»
01:37 Zoffix Neat. gfldex++
01:47 ilbot3 joined #perl6
01:47 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:49 kalkin- joined #perl6
01:58 molaf joined #perl6
02:07 Zoffix m: <a b c>.&(my method {dd self; self}).say;
02:07 camelia rakudo-moar 58dc8c: OUTPUT«("a", "b", "c")␤(a b c)␤»
02:07 Zoffix m: <a b c>.&(my method (List:D:) {dd self; self}).say;
02:07 camelia rakudo-moar 58dc8c: OUTPUT«("a", "b", "c")␤(a b c)␤»
02:12 CoconutCrab joined #perl6
02:14 rindolf joined #perl6
02:15 silug joined #perl6
02:26 lucs I just did 「use Foo:From<Perl5>」, and got 「===SORRY!=== Could not find Foo.pm in … CompUnit::Repository::Perl5<-122…>」, which makes sense, because I forgot that I hadn't installed Foo in my Perl5.
02:26 lucs So I installed it, and yet I still get the same error.
02:27 lucs Do I need to force something somewhere?
02:28 lucs (I don't have a very recent Perl 6 by the way)
02:33 kyclark joined #perl6
02:34 Zoffix lucs, it's :from, not :From.
02:35 Zoffix Do you still get the same error when that is fixed?
02:36 Zoffix I can't reproduce that error with either spelling. What's your Perl 6's version?
02:36 Zoffix Oh, yeah, it's the :From bit.
02:38 lucs 'from' appears to fix it. Thanks.
02:38 Zoffix No problem.
02:39 Zoffix We should probably cry about it.
02:39 Zoffix m: use Foo:form<Perl5>
02:39 camelia rakudo-moar 58dc8c: OUTPUT«===SORRY!===␤Could not find Foo at line 1 in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-2/share/perl6/site␤    /home/camelia/rakudo-m-inst-2/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-2/share/perl6␤    CompUnit::Repositor…»
02:39 noganex_ joined #perl6
03:02 Senj joined #perl6
03:03 araujo__ joined #perl6
03:11 cdg joined #perl6
03:12 kyclark joined #perl6
03:13 BenGoldberg joined #perl6
03:13 labster joined #perl6
03:14 lucs A difficulty with Inline::Perl5: https://gist.github.com/lucs/95aa2da8f383f75ccb3525cdd97b301e
03:15 TimToady joined #perl6
03:17 AlexDaniel joined #perl6
03:20 geekosaur the fails is correct. "use Bar;" in perl5 also will not look for Foo.pm, but Bar.pm.
03:21 geekosaur the other... it does look like it's making an unwarranted assumption. then again I don't think it can get that right...
03:22 geekosaur not without e.g. snapshotting the whole package hierarchy before and after the load to see what it actually loaded
03:24 lucs I'm thinking that it must be relatively frequent for a Foo.pm to have a 「package Bar」 within it though (both times I've tried Inline::Perl5, both times it appears to have happened).
03:30 dj_goku any nativecall hackers in here?
03:33 geekosaur it's not uncommon when there's a parent class and small stub subclasses that the subclasses are defined in the same module as the parent
03:42 avalokite joined #perl6
03:47 kyclark joined #perl6
03:49 TreyHarr1 joined #perl6
03:54 parabolize :m <a b c>.&(-> \o {dd o; o}).say
03:55 parabolize m: <a b c>.&(-> \o {dd o; o}).say
03:55 camelia rakudo-moar 58dc8c: OUTPUT«("a", "b", "c")␤(a b c)␤»
04:03 kyclark joined #perl6
04:08 petercommand joined #perl6
04:17 zakharyas joined #perl6
04:39 TreyHarr1 joined #perl6
04:39 holyghost joined #perl6
04:50 labster joined #perl6
04:58 Cabanossi joined #perl6
04:59 jack_rabbit joined #perl6
05:11 zakharyas joined #perl6
05:14 [particle] joined #perl6
05:15 Actualeyes joined #perl6
05:25 remmie joined #perl6
05:25 kentnl joined #perl6
05:38 TreyHarr1 joined #perl6
06:11 rindolf joined #perl6
06:15 andrzejku joined #perl6
06:16 andrzejku hi
06:16 rindolf andrzejku: hello
06:17 andrzejku rindolf, looking for Perl6 coder for work sharing with funny project (I am beginner)
06:17 rindolf andrzejku: a funny project or a fun project?
06:17 andrzejku rindolf, funny
06:18 rindolf andrzejku: a funny project sounds bad.
06:18 andrzejku rindolf, why?
06:18 andrzejku rindolf, are you kind of sad man?
06:18 rindolf andrzejku: no.
06:19 nine geekosaur: yes there is this assumption in Inline::Perl5. And I also snapshot the main:: namespace to find out which subs were imported. So I may as well use the same mechanism for finding out which packages were created.
06:19 nine lucs: ^^^
06:23 cyphase joined #perl6
06:24 ddelony joined #perl6
06:25 firstdayonthejob joined #perl6
06:29 wamba joined #perl6
06:43 TreyHarr1 joined #perl6
06:48 domidumont joined #perl6
06:53 domidumont joined #perl6
06:55 labster joined #perl6
07:00 darutoko joined #perl6
07:05 masak aww -- seems we missed an opportunity to guide andrzejku towards something he might've liked :/
07:13 CIAvash joined #perl6
07:22 TreyHarr1 joined #perl6
07:28 telex joined #perl6
07:34 sno joined #perl6
07:38 nine ~/win 15
07:48 RabidGravy joined #perl6
07:54 TreyHarr1 joined #perl6
07:56 brrt joined #perl6
08:09 Woodi nine: 10 isn't enought ??
08:13 nine Woodi: appears so :)
08:21 * moritz works hard to keep is window list limited to about 20
08:23 Woodi btw. while reading TimToady answers I started thinking we are starving camelia... becouse there is no list of 10% subset of features "for noobs and kids", at least I didn't saw it. so we are a bit like C++ on that matter :)
08:24 brrt joined #perl6
08:25 konobi jnthn: morning
08:26 Woodi incidentally I had opened 5to6 intro and, IMO, it looks like good prototype for such 10% list. some FP-for-kids and other things and it is done
08:27 cyphase joined #perl6
08:39 TreyHarr1 joined #perl6
09:02 gregf_ joined #perl6
09:02 TreyHarr1 joined #perl6
09:04 tadzik joined #perl6
09:24 aries_liuxueyang joined #perl6
09:27 Matthew[m] joined #perl6
09:27 M-Illandan joined #perl6
09:30 zakharyas joined #perl6
09:35 [particle] joined #perl6
09:48 wamba joined #perl6
09:49 pmurias joined #perl6
09:51 TreyHarr1 joined #perl6
09:54 Actualeyes joined #perl6
10:03 LeCamarade joined #perl6
10:04 LeCamarade joined #perl6
10:06 LeCamarade joined #perl6
10:09 dLeCamarae joined #perl6
10:09 LeCamarade joined #perl6
10:10 LeCamarade joined #perl6
10:10 LeCamarade Hello, guys; is there is a Mersenne Twister module anywhere for Perl 6 as yet?
10:10 LeCamarade It seems that srand/rand are not implemented as MT.
10:14 psch LeCamarade: fwiw, the MoarVM backends calls a C function called 'tinymt_generate_double' for nqp::rand_n
10:14 psch LeCamarade: the jvm backend uses Javas Random class
10:14 LeCamarade No, I am on Moar. So that looks good, any TinyMT should suffice.
10:15 LeCamarade Problem is, the numbers do not seem to agree with MT proper. :-(
10:15 psch i'm no number theoretician
10:15 psch how are you testing that?
10:16 LeCamarade Against Ruby's MT. :-/
10:17 timotimo if you have a C implementation handy, you can use that via NativeCall
10:17 LeCamarade Of course, the assumption here is that Ruby is Japanese enough to have an accurate MT. It is accurate; it gives the expected series when I seed it with a constant and then run for a constant number of ints. The Perl 6 one, apparently not. I may be using the Perl 6 one all wrong.
10:17 timotimo so you don't have to implement it yourself
10:17 LeCamarade Isn't NativeCall the best thing since make world?
10:18 timotimo it's pretty great :)
10:18 timotimo the performance is not as good as it could be, but making it better will require a re-write of how nativecall works on moarvm
10:19 psch m: use NativeCall; sub srandom(uint32 $s) is native {*}; sub random is native returns Int { }; srandom(10); say random; say random
10:19 camelia rakudo-moar 58dc8c: OUTPUT«1215069295␤1311962008␤»
10:19 psch that's stdlib, fwiw
10:19 timotimo but once that rewrite has happened, you will hardly be able to tell the difference between calling C from perl6 and calling C from C :P
10:20 psch but that's not MT, says the manpage
10:20 parabolize LeCamarade: Does this do what you want? https://github.com/bluebear94/Math-Random/blob/master/lib/Math/Random/MT.pm6
10:20 psch ...i think
10:22 parabolize There is a synopsis in the README
10:22 psch hm, one thing i can see that might throw off the series is marshalling of a double to a Num
10:23 psch like, http://create.stephan-brumme.com/mersenne-twister/ doesn't generate doubles, but signed ints
10:23 psch ...do we have rand_I?
10:23 LeCamarade parabolize may have found excatly  what I need.
10:24 psch m: use nqp; srand(1); say nqp::rand_i; say nqp::rand_i
10:24 camelia rakudo-moar 58dc8c: OUTPUT«5687185841269489465␤-6099459382516868944␤»
10:24 xiaomiao joined #perl6
10:24 psch oh hm, the side i found to get that for C++, C and JS is 32bit i think
10:24 psch well, nvm
10:26 gregf_ wow, NativeCall++
10:26 gregf_ does that call c functions directly?
10:26 psch ...FSDO "directly"
10:26 psch i mean, we have to wrap stuff around and all
10:27 LeCamarade Okay, now that I have rememebered to panda search, which I should have done first-thing, I have found the Math::Random that parabolize mentioned, and even a Crypto::Random which I will use later.
10:28 gregf_ psch: ok. in Ruby i can use something called Fiddle to invoke c functions. like so, libc = Fiddle.dlopen("/lib/x86_64-linux-gnu/libc.so.6"); @alarm = Fiddle::Function.new(libc["alarm"], [Fiddle::TYPE_INT], Fiddle::TYPE_INT)
10:29 gregf_ anyways
10:29 Actualeyes joined #perl6
10:29 rindolf joined #perl6
10:31 kurahaupo joined #perl6
10:31 bbkr joined #perl6
10:35 bbkr hi. is it possible to create self-contained, movable build with rakudobrew? I'l looking for something like -Duserelocatableinc switch in perlbrew. So every dependency (moar) and libraries are in relative path.
10:36 DrForr gregf_: NativeCall is the equivalent to Fiddle there.
10:36 gregf_ yeah, i though so :)
10:37 gregf_ s/though/thought/
10:52 LeCamarade It worked!
10:52 LeCamarade For posterity, and .away log files ...:
10:53 LeCamarade panda install Math::Random
10:53 LeCamarade use v6.c;
10:53 LeCamarade use Math::Random::MT;
10:53 Zoffix LeCamarade, we have an ecosystem website BTW: http://modules.perl6.org/
10:53 LeCamarade my $rng = Math::Random::MT.mt19937;
10:54 Zoffix and modules.zef.pm if I got the url right (same ecosystem)
10:54 LeCamarade After something like $rng.setSeed(27);, the result of the next $rng.nextInt is like the grosser Ruby equivalent that requires an unpack of binary bytes.
10:55 TreyHarr1 joined #perl6
10:55 DrForr Mersenne twister, I assume?
10:55 LeCamarade Zoffix Thanks. I have only been using Perl 6 for two weeks or so ... Worth the wait!
10:55 timotimo that's right, DrForr
10:55 LeCamarade DrForr yes, MT.
11:00 DrForr Party on, it's great to see new blood!
11:01 parabolize bbkr: by default everything rakudobrew installs is under one directory. you clone rakudobrew's source where you want it and add its bin directory to your path
11:05 bbkr parabolize: what I need is to build rakudo on one machine, let's say in /home/x/rakudobrew and then copy  /home/x/rakudobrew/moar-2016.07/install to N production machines to /home/x/myproductionperl6
11:07 moritz bbkr: no, iirc rakudo doesn't support any kind of relation
11:08 moritz *relocation
11:08 bbkr parabolize: so I don't want to have rakudobrew on production machines (they even don't have make utils installed) and I need to get rid of original absolute path where build was made
11:08 moritz the best you can do is to use fakeroot to build with the same absolute path that you want on the production machines
11:08 moritz or patch rakudo and nqp, which would be highly appreciated as well
11:09 bbkr moritz: thanks. I'll try fakeroot.
11:10 nine bbkr: rakudobrew is absolutely the wrong tool for the job and unnecessary
11:10 nine bbkr: rakudobrew is solely for when you really want multiple rakudos with each their own installed modules on the same machine
11:10 El_Che just parachuting here: use docker
11:11 moritz or a native package for your OS
11:11 nine bbkr: what's keeping you from installing to /home/x/rakudo on your build machine and copy that directory to your production machines?
11:12 El_Che imho is docker or native packaging the only proper ways for production
11:13 pmurias joined #perl6
11:13 kyclark joined #perl6
11:13 nine El_Che: so if Perl 6 is used for a maintenance cronjob on those production machines, you'd use docker for installing rakudo?
11:14 El_Che yes
11:14 bbkr nine: path is not relative. so I cannot for example install on production /home/x/rakudo-experiment, run code with this version and then simply rename it to /home/x/rakudo to replace previous one.
11:14 El_Che docker run --rm
11:15 El_Che rakudo is a moving target, if  you have more than one program running off the same physical install you get tricky upgrades
11:15 nine El_Che: actually we promise backwards compatibility
11:15 El_Che i run something in production with cron  and docker (runs once a day)
11:16 El_Che nine: think of modules etc
11:16 El_Che do you want aplications to share modules? etc
11:16 moritz it really depends on the infrastructure you already have
11:16 El_Che it's a choice with overhaed
11:16 nine El_Che: we do support versioning of modules :)
11:16 El_Che but worth it in my case
11:17 El_Che i like to test apps in isolation
11:17 moritz if you have infrastructure for the whole docker zoo, then building rakudo in a docker container is likely the most sensible thing
11:18 moritz if you do everything with native packages, you could either have a package for rakudo, or fat-package your application with a copy of rakudo (like dh-virtualenv does for python)
11:18 El_Che docker gives me that
11:18 El_Che crapu wifi sorry
11:18 konobi well, that was a packed chat... but really informative... thanks jnthn !
11:19 El_Che moritz: we have the docker zoo (jenkins and co) but the cron example is one without the infra, not on our typical docker hosts
11:23 moritz El_Che: do you use jenkins to build the containers/images?
11:23 moritz and then test them, I guess
11:25 El_Che yes
11:25 El_Che locally and jenkins
11:26 El_Che through a makefile that the jenkins host calls and can be tun locally as well
11:27 El_Che sorry, terrible wifi
11:27 El_Che bbl
11:28 avenj joined #perl6
11:28 avenj joined #perl6
11:32 cyphase joined #perl6
11:37 konobi is there a reference lexer/tokenizer for NQP in perl5 at all ?
11:37 DrForr There's one out there but it's badly code-rotted.
11:37 TreyHarr1 joined #perl6
11:38 konobi even that'd be okay i think
11:39 DrForr It's on github, something like nqp-perl5, I don't remember the exact name unfortunately.
11:53 canopus joined #perl6
12:15 TreyHarr1 joined #perl6
12:24 scovit joined #perl6
12:24 scovit m: given ("ciao") { say $^s;}   # Is it documented anywhere?
12:24 camelia rakudo-moar 58dc8c: OUTPUT«ciao␤»
12:25 timotimo m: given "ciao" { say $^s } # no need for the parenthesis
12:25 camelia rakudo-moar 58dc8c: OUTPUT«ciao␤»
12:25 moritz scovit: probably not explicitly
12:25 scovit what does the $^ mean?
12:25 moritz scovit: given just calls the block with the object as an argument
12:25 moritz that's an implicit parameter
12:25 moritz let me search some docs for you...
12:26 scovit Ok thanks
12:26 scovit I found something in sort documentation
12:27 kid51 joined #perl6
12:28 R[DaneelOlivaw] scovit: it's the ^ twigil: https://docs.perl6.org/language/variables#The_^_Twigil
12:28 dalek doc: 7b35964 | (Wenzel P. P. Peppmeyer)++ | doc/ (5 files):
12:28 dalek doc: the parsed does not .trim
12:28 dalek doc: review: https://github.com/perl6/doc/commit/7b3596447c
12:29 brrt joined #perl6
12:29 moritz ah, R[DaneelOlivaw]++ was faster
12:30 R[DaneelOlivaw] m: given "ciao" { say $^ʕ }
12:30 camelia rakudo-moar 58dc8c: OUTPUT«ciao␤»
12:31 scovit m: { say "$^ʕ $_" given "hello" } given "ciao"    # it was not easy to understand this
12:31 camelia rakudo-moar 58dc8c: OUTPUT«ciao hello␤»
12:33 scovit m: { { say "$^a $_" given "bella" } given "ciao" } given "hello"    # A pity nesting three given is not as straightforward ;)
12:33 camelia rakudo-moar 58dc8c: OUTPUT«ciao bella␤»
12:34 R[DaneelOlivaw] Well, it is. Both "ciao" and "hello" use $_, so naturally you get the "ciao" in it
12:34 R[DaneelOlivaw] *bella and hello
12:35 scovit yeah but there is no easy way to get hello from there
12:35 R[DaneelOlivaw] Dammit! I guess I proved self wrong :)
12:35 R[DaneelOlivaw] m: given "hello" -> $h { { say "$h $^a $_" given "bella" } given "ciao" }
12:35 camelia rakudo-moar 58dc8c: OUTPUT«hello ciao bella␤»
12:36 AlexDaniel joined #perl6
12:36 gregf_ is that like 3 (if defined)'s ?
12:37 R[DaneelOlivaw] 0. if defined is `with`
12:37 scovit -> $h { { say "$h $^a $_" given "bella" } given "ciao" } given "hello"    # Do you know why this does not work ?
12:37 scovit m: -> $h { { say "$h $^a $_" given "bella" } given "ciao" } given "hello"    # Do you know why this does not work ?
12:37 camelia rakudo-moar 58dc8c: ( no output )
12:37 R[DaneelOlivaw] scovit: I think because the point block doesn't get executed. It just gets sunk
12:38 R[DaneelOlivaw] *pointy
12:38 R[DaneelOlivaw] m: -> $h { { say "$h $^a $_" given "bella" } given "ciao" }($_) given "hello"
12:38 camelia rakudo-moar 58dc8c: OUTPUT«hello ciao bella␤»
12:38 R[DaneelOlivaw] yup
12:39 scovit m: -> $h { { say "$h $^a $_" given "bella" } given "ciao" }("hello")          # This is enough
12:39 camelia rakudo-moar 58dc8c: OUTPUT«hello ciao bella␤»
12:40 ptolemarch joined #perl6
12:40 scovit m: -> $h { { { say "$h $^a $_" }("bella") }("ciao") }("hello")   # to me it looks funny
12:40 camelia rakudo-moar 58dc8c: OUTPUT«hello bella ciao␤»
12:40 R[DaneelOlivaw] :)
12:40 perlpilot scovit: I agree.   Why would you write that?  ;)
12:41 R[DaneelOlivaw] m: -> $h { { (("$h $^a" ~ *).say)("bella") }("ciao") }("hello")
12:41 camelia rakudo-moar 58dc8c: OUTPUT«hello ciaobella␤»
12:42 pmurias joined #perl6
12:45 R[DaneelOlivaw] m: (*, *, *)(<bella ciao hello>).say
12:45 camelia rakudo-moar 58dc8c: OUTPUT«Invocant requires a type object of type List, but an object instance was passed.  Did you forget a 'multi'?␤  in block <unit> at <tmp> line 1␤␤»
12:45 R[DaneelOlivaw] I wonder what that error is about...
12:45 moritz R[DaneelOlivaw]: you'r trying to invoke a List object
12:45 R[DaneelOlivaw] Ah
12:46 moritz m: say [,] <bella ciao hello>
12:46 camelia rakudo-moar 58dc8c: OUTPUT«(bella ciao hello)␤»
12:46 moritz infix:<,> does not auto-curry with the Whatever star
12:49 dalek doc: ef2afea | (Wenzel P. P. Peppmeyer)++ | doc/Language/variables.pod6:
12:49 dalek doc: add complete twigils to index
12:49 dalek doc: review: https://github.com/perl6/doc/commit/ef2afeac86
12:49 gfldex scovit++ # for asking the right question
12:49 scovit thanks
12:57 mcmillhj joined #perl6
13:01 kyclark joined #perl6
13:06 dvinciguerra_ joined #perl6
13:10 adrusi joined #perl6
13:11 brrt joined #perl6
13:13 skids joined #perl6
13:14 Psy-Q atom-perl6-editor-tools say that perl6 isn't on the PATH (or it can't find it for other reasons). i've installed it using rakudobrew and it is on the path. what could be the issue?
13:14 Psy-Q i'll probably be using mostly vim anyway, but would be fun to find out
13:15 moritz Psy-Q: compare the PATH in atom-perl6-editor-tools and in your shell
13:15 Psy-Q moritz: oh, ok, didn't know it had its own
13:15 R[DaneelOlivaw] I had the same issue :/
13:15 moritz Psy-Q: every process has a copy of its environment variables
13:16 Psy-Q moritz: i thought it was perhaps inherited from the spawning shell
13:17 Psy-Q but i'm looking through the atom-perl6-editor-tools source now
13:17 moritz Psy-Q: it usually is
13:17 moritz Psy-Q: but there are lots of ways to screw up, like applications setting their own PATH, or accidentally spawning the program before PATH is set, or some other fun
13:18 moritz like, launching it from a desktop launcher that doesn't start a login shell
13:18 Psy-Q ah, interesting. if started from alt-f2 (in xfce) it does not grab a PATH, but if started from a bash, it does inherit the PATH that includes rakudobrew
13:18 Psy-Q moritz: i think that was the issue indeed
13:18 Psy-Q i'll have to find out if xfce's launchers can use login shells
13:19 moritz bash -l -c 'atom-perl6-editor-tools'
13:19 moritz as the launch command
13:19 moritz maybe
13:19 Psy-Q hm. with bash -l -c 'atom' it doesn't get it
13:20 Psy-Q but from a true interactive shell it does
13:21 Psy-Q ah, i see. /usr/bin/atom is a wrapper script. it does things before actually invoking the binary
13:22 nine Psy-Q: When an interactive shell that is not a login shell is started, bash reads and executes commands from /etc/bash.bashrc then ~/.bashrc when those files exist and are readable.
13:22 nine from man bash
13:22 moritz Psy-Q: you might need to include .bashrc from .bash_profile (or vice versa, can't ever remember that)
13:22 Psy-Q maybe i set the paths in the wrong bash config files
13:22 moritz or you could try bash -i instead of bash -l
13:23 Psy-Q ah! yes, bash -i -c does it
13:23 Psy-Q thanks
13:23 Psy-Q i will have to clean up my bash configs and put all my rakudobrew stuff in the correct places
13:25 cdg joined #perl6
13:26 TreyHarr1 joined #perl6
13:29 CIAvash m: { { put [OUTER::OUTER::<$_>, $_, OUTER::<$_>] given "bella" } given "ciao" } given "hello"
13:29 camelia rakudo-moar 58dc8c: OUTPUT«hello bella ciao␤»
13:29 dj_goku I am working on documentation but would like some input: https://github.com/djgoku/p6-Net-Utils
13:33 * [Coke] wakes up
13:34 perlpilot dj_goku: the description is a little light  ;)
13:38 [Coke] http://xkcd.com/1709/ is relevant. I especially like the mouseover.
13:40 dj_goku perlpilot: yeah I am doing that now. Other than code and tests I didn't make changes to the generated bits.
13:47 perlpilot dj_goku: were you also going to change the module name to Net::Utils ?
13:51 araujo joined #perl6
13:56 scovit m: { say &?BLOCK.signature }()   # Where can I find the documentation for ";;" (if it means something)?
13:56 camelia rakudo-moar 58dc8c: OUTPUT«(;; $_? is raw)␤»
13:56 R[DaneelOlivaw] scovit: https://docs.perl6.org/type/Signature
13:57 R[DaneelOlivaw] scovit: it excludes the stuff from being considered in multi dispatch
13:57 scovit ok, found
13:57 R[DaneelOlivaw] https://docs.perl6.org/type/Signature#Long_Names more speficication
13:57 scovit thanks
13:57 R[DaneelOlivaw] *specifically
13:58 scovit m: { my $x = 4; -> ;; $x? is raw { say $x, " and ", &?BLOCK.signature }() }   # there is something that a bit magic about the standard signature
13:58 camelia rakudo-moar 58dc8c: OUTPUT«(Mu) and (;; $x? is raw)␤»
13:58 scovit m: { $_ = 4; { say $_, " and ", &?BLOCK.signature }() }
13:58 camelia rakudo-moar 58dc8c: OUTPUT«4 and (;; $_? is raw)␤»
13:58 TreyHarr1 joined #perl6
13:59 R[DaneelOlivaw] What's the magic bit? :)
13:59 psch m: { my $x = 4; -> ;; $x? is raw { say $x, " and ", &?BLOCK.signature }($x) }
13:59 camelia rakudo-moar 58dc8c: OUTPUT«4 and (;; $x? is raw)␤»
13:59 psch that's just normal $_ behavior
13:59 psch actually, lexical lookup rather
13:59 psch m: { my $x = 4;  { say $x, " and ", &?BLOCK.signature }($x) }
13:59 camelia rakudo-moar 58dc8c: OUTPUT«4 and (;; $_? is raw)␤»
13:59 psch m: { my $x = 4;  { say $x, " and ", &?BLOCK.signature }() }
13:59 camelia rakudo-moar 58dc8c: OUTPUT«4 and (;; $_? is raw)␤»
14:00 scovit $x? overrides $x, while $_? does not
14:00 scovit I like that it does not
14:00 scovit but it seems magic
14:00 scovit cannot be easily exchanged with another signature
14:01 psch right, that is a bit specific for $_
14:01 jnthn I think it may actually be lying a bit
14:01 psch the signature?
14:01 jnthn .perl of the Signature
14:01 Autopilot joined #perl6
14:01 jnthn Well, or Parameter :)
14:01 jnthn But iirc there's a flag which is "grab default from outer" or so
14:02 jnthn Which can be expressed in Perl 6 proper as $_ = OUTER::<$_>
14:02 R[DaneelOlivaw] m: { my $_ = 4; -> ;; $_? is raw { say $_, " and ", &?BLOCK.signature }() }
14:02 camelia rakudo-moar 58dc8c: OUTPUT«Potential difficulties:␤    Redeclaration of symbol $_␤    at <tmp>:1␤    ------> 3{ my $_7⏏5 = 4; -> ;; $_? is raw { say $_, " and "␤(Mu) and (;; $_? is raw)␤»
14:02 jnthn Except it's so common if we really impelemtned it like that we'd hose performance, so it's got a special flag.
14:02 scovit m: { $_ = 4; -> ;; $_? is raw { say $_, " and ", &?BLOCK.signature }() }
14:02 camelia rakudo-moar 58dc8c: OUTPUT«(Mu) and (;; $_? is raw)␤»
14:02 jnthn So we may want to fix the .perl of it :)
14:02 psch isn't it just implicit $_ falling outwards..?
14:03 psch i mean, it is a Block thing
14:03 psch m: sub f { .say }; $_ = "foo"; &f.signature.perl.say; f
14:03 camelia rakudo-moar 58dc8c: OUTPUT«:()␤(Any)␤»
14:03 jnthn https://github.com/rakudo/rakudo/blob/cd42657477a18fc4d01680ab1cd83344af0b6b08/src/Perl6/World.nqp#L1849
14:04 jnthn There is an implicit "take it from the outer" *too*, but that's for bare blocks
14:04 jnthn Or immediate blocks like in an if
14:04 jnthn Not for closure blocks
14:04 jnthn Those do it the signature way so you can pass 'em a topic, but otherwise they get $_ from outer
14:05 psch i see
14:10 ugexe m: (1..5).map({ say $_; once &?BLOCK(); }) # should &?BLOCK count for explicit blocks only? (i.e. not implied as once { &?BLOCK() })
14:10 camelia rakudo-moar 58dc8c: OUTPUT«1␤Memory allocation failed; could not allocate 131072 bytes␤»
14:11 jnthn ugexe: I think so. I guess maybe once's thunking doesn't mark things up properly or something.
14:14 ugexe i think something similar affects state vars but i forget the incantation
14:16 cdg joined #perl6
14:18 khw joined #perl6
14:21 ribasushi joined #perl6
14:29 TreyHarr1 joined #perl6
14:31 tbrowder joined #perl6
14:34 LeCamarade jnthn Thanks for the work you do on Perl 6 implementation, in general, and on Rakudo, in particular.
14:35 kyclark joined #perl6
14:36 kyclark \
14:39 gregf_ oh - so World.pm is where the entire container magic exists :)
14:40 psch i think it's more where it's used and elevated?  as in, containers belong to sixmodel, don't they?
14:41 gregf_ sixmodel? - *wonders what that even is* :| #pass
14:42 psch well, Moar is "Metamodel On A Runtime"
14:42 psch and sixmodel is that metamodel
14:42 psch which we use to bootstrap the nqp metamodel, which we use to bootstrap the perl6 metamodel
14:43 kurahaupo joined #perl6
14:44 kurahaupo joined #perl6
14:47 user9 joined #perl6
14:47 dj_goku perlpilot: so I used App::Mi6 to create a skeleton module. It seems to remove pluralism
14:48 dj_goku perlpilot: good catch. Wonder if that is a feature or a bug in Mi6
14:49 wamba1 joined #perl6
14:54 dj_goku oh looks like I messed up I did: mi6 new Net::Util :D
15:07 acrussell joined #perl6
15:14 CoconutC1ab joined #perl6
15:21 Amnez777 joined #perl6
15:25 bbkr ugexe: is there any way to use zef if perl6 is not in PATH? for example from zef directory: ../someperlbuild/bin/perl6 -I lib zef install ...
15:27 R[DaneelOlivaw] m: "bc" ~~ /||@(<b bc>) >>/ or say "Failed"
15:27 camelia rakudo-moar 58dc8c: OUTPUT«Failed␤»
15:27 R[DaneelOlivaw] That's a bug, right?
15:27 R[DaneelOlivaw] m: "bc" ~~ /|@(<b bc>) >>/ or say "Failed"
15:27 camelia rakudo-moar 58dc8c: ( no output )
15:27 R[DaneelOlivaw] m: "bc" ~~ /||@(<b bc>)/ or say "Failed"
15:27 camelia rakudo-moar 58dc8c: ( no output )
15:28 kyclark joined #perl6
15:28 kyclark I would appreciate comments on how to improve this binary search:
15:28 kyclark http://pastie.org/10913220
15:29 Tonik joined #perl6
15:38 moritz kyclark: what kind of improvements are you looking for?
15:39 kyclark Just generally using the power of Perl6. I just repasted with a version that handles both strings and numbers and uses a "given" which I'm still learning.
15:40 kyclark Sorry, I should have said that I'm just practising with a binary search.  I also showed my son and challenged him to do it in Python which he's learning.
15:40 Possum joined #perl6
15:40 cyphase joined #perl6
15:40 moritz kyclark: you could replace those recursive search calls with callsame(args)
15:41 moritz or even nextsame, which iirc eliminates the current stack frame
15:41 kyclark That is a performance advantage?
15:42 hahainternet reducing the number or depth of stack frames can have performance advantages
15:42 kyclark I'm also trying to figure how to indicate failure. In Haskell I might use a Maybe Int so that I could return Nothing when not found and Just x when found.
15:42 hahainternet but it also prevents performance downgrades
15:42 hahainternet kyclark: the type you're looking for there is Failure
15:42 hahainternet it's not an Exception, but it can become one if you try to use it
15:43 jferrero m: say 「Hola」
15:43 camelia rakudo-moar 58dc8c: OUTPUT«5===SORRY!5===␤Argument to "say" seems to be malformed␤at <tmp>:1␤------> 3say7⏏5 「Hola」␤Bogus postfix␤at <tmp>:1␤------> 3say 7⏏5「Hola」␤    expecting any of:␤        infix␤        infix stopper␤        postfix…»
15:43 hahainternet you can also rely on the 'definedness' of 'Int' vs '0'
15:43 hahainternet jferrero: wrong square brackets i think
15:43 hahainternet jferrero: you want the japanese quotes
15:43 R[DaneelOlivaw] m: say q「Hola」
15:43 camelia rakudo-moar 58dc8c: OUTPUT«Hola␤»
15:43 R[DaneelOlivaw] :)
15:44 * hahainternet shrugs
15:44 jferrero What is the diference for LEFT CORNER BRACKET and HALFWIDTH LEFT CORNER BRACKET?
15:45 R[DaneelOlivaw] m: say 「meow」
15:45 camelia rakudo-moar 58dc8c: OUTPUT«meow␤»
15:45 R[DaneelOlivaw] .u LEFT CORNER BRACKET
15:45 yoleaux U+300C LEFT CORNER BRACKET [Ps] (「)
15:45 R[DaneelOlivaw] .u HALFWIDTH LEFT CORNER BRACKET
15:45 yoleaux U+FF62 HALFWIDTH LEFT CORNER BRACKET [Ps] (「)
15:45 moritz jferrero: HALFWIDTH :-)
15:45 hahainternet i don't know why one works and the other doesn't though
15:45 hahainternet i just found the same when i tried them
15:46 R[DaneelOlivaw] A better question is why both of them should work :)
15:46 hahainternet why not? quotes are quotes are quotes
15:46 hahainternet if they are semantically equivalent to ' or " or similar, then that's all that's required to me, but i am not an implementor
15:47 R[DaneelOlivaw] Why not is a poor argument for increasing: code to maintain, code to debug, and usage to document :)
15:47 R[DaneelOlivaw] .u bracket
15:47 yoleaux U+005B LEFT SQUARE BRACKET [Ps] ([)
15:47 yoleaux U+005D RIGHT SQUARE BRACKET [Pe] (])
15:47 yoleaux U+007B LEFT CURLY BRACKET [Ps] ({)
15:47 jferrero both are in category Unicode Punctuaction, open.
15:48 hahainternet R[DaneelOlivaw]: this is #perl6 though, it's more 'why not' vs 'why'
15:48 R[DaneelOlivaw] m: say ^0xFFFFF .grep({.uniname ~~ /BRACKET/})».chr
15:48 camelia rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing « or »␤at <tmp>:1␤------> 0xFFFFF .grep({.uniname ~~ /BRACKET/})».7⏏5chr␤»
15:48 R[DaneelOlivaw] m: say ^0xFFFFF .grep({.uniname ~~ /BRACKET/}).map({.chr})
15:48 camelia rakudo-moar 58dc8c: OUTPUT«([ ] { } ⁅ ⁆ 〈 〉 ⎡ ⎢ ⎣ ⎤ ⎥ ⎦ ⎧ ⎨ ⎩ ⎪ ⎫ ⎬ ⎭ ⎰ ⎱ ⎴ ⎵ ⎶ ⏞ ⏟ ⏠ ⏡ ❬ ❭ ❰ ❱ ❲ ❳ ❴ ❵ ⟦ ⟧ ⟨ ⟩ ⟪ ⟫ ⟬ ⟭ ⦃ ⦄ ⦇ ⦈ ⦉ ⦊ ⦋ ⦌ ⦍ ⦎ ⦏ ⦐ ⦑ ⦒ ⦓ ⦔ ⦕ ⦖ ⦗ ⦘…»
15:49 R[DaneelOlivaw] hahainternet: then why not all of those ^? :)
15:49 psch m: say ^0xFFFFF .grep({.uniname ~~ /LEFT BRACKET/}).elems
15:49 hahainternet R[DaneelOlivaw]: many of them probably work
15:49 camelia rakudo-moar 58dc8c: OUTPUT«Potential difficulties:␤    Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)␤    at <tmp>:1␤    ------> 3say ^0xFFFFF .grep({.uniname ~~ /LEFT…»
15:49 R[DaneelOlivaw] Nope.
15:49 psch m: say ^0xFFFFF .grep({.uniname ~~ /LEFT' 'BRACKET/}).elems
15:49 camelia rakudo-moar 58dc8c: OUTPUT«0␤»
15:49 R[DaneelOlivaw] hahainternet: you can see the full list on https://docs.perl6.org/language/unicode_texas.html
15:50 psch m: say ^0xFFFFF .grep({.uniname ~~ /LEFT.+BRACKET/}).elems
15:50 camelia rakudo-moar 58dc8c: OUTPUT«64␤»
15:50 psch m: say ^0xFFFFF .grep({.uniname ~~ /RIGHT.+BRACKET/}).elems
15:50 camelia rakudo-moar 58dc8c: OUTPUT«63␤»
15:51 psch that's just great
15:51 R[DaneelOlivaw] hahaha
15:51 R[DaneelOlivaw] m: say ^0xFFFFFF .grep({.uniname ~~ /RIGHT.+BRACKET/}).elems
15:52 camelia rakudo-moar 58dc8c: OUTPUT«(timeout)»
15:55 kyclark How does one return Failure from a method, and how does one pattern match on it/catch it?
15:56 R[DaneelOlivaw] kyclark: fail 'meow'
15:56 moritz and you can check with .defined or a type check for Failure
15:56 R[DaneelOlivaw] m: sub meow { fail 'meow' }; unless meow { "something is wrong"; }; if meow ~~ Failure { "oh yeah, def a failure" }
15:56 camelia rakudo-moar 58dc8c: OUTPUT«5===SORRY!5===␤Function 'meow' needs parens to avoid gobbling block␤at <tmp>:1␤------> 3}; unless meow { "something is wrong"; }7⏏5; if meow ~~ Failure { "oh yeah, def a f␤Missing block (apparently claimed by 'meow')␤at <tmp>:1␤------…»
15:57 R[DaneelOlivaw] m: sub meow { fail 'meow' }; unless meow() { "something is wrong"; }; if meow ~~ Failure { "oh yeah, def a failure" }
15:57 camelia rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Expected a term, but found either infix ~~ or redundant prefix ~␤  (to suppress this message, please use a space like ~ ~)␤at <tmp>:1␤------> 3() { "something is wrong"; }; if meow ~~7⏏5 Failure {…»
15:57 R[DaneelOlivaw] Well... something like that :)
15:57 psch m: sub meow { fail 'meow' }; unless meow() { "something is wrong"; }; if meow() ~~ Failure { "oh yeah, def a failure" }
15:57 camelia rakudo-moar 58dc8c: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant string "something is wrong" in sink context (line 1)␤Useless use of constant string "oh yeah, def a failure" in sink context (line 1)␤»
15:57 psch m: sub meow { fail 'meow' }; say do unless meow() { "something is wrong"; }; say do if meow() ~~ Failure { "oh yeah, def a failure" }
15:57 camelia rakudo-moar 58dc8c: OUTPUT«something is wrong␤oh yeah, def a failure␤»
15:58 R[DaneelOlivaw] psch++ :)
15:58 AlexDaniel joined #perl6
15:59 ugexe bbkr: yes zef will work without perl6 being in PATH. Note that you need git/wget/curl or something in the PATH unless you are installing from a local path (or you create/add a pure-perl6 plugin to the config)
16:00 kyclark OK, did I do this right?
16:00 kyclark http://pastie.org/10913254
16:01 dj_goku perlpilot: thanks btw. I'll be updating more tonight when I get home.
16:02 kyclark Oh, I didn't incorporate callsame ... Not sure how that would work.
16:02 johanholmberg joined #perl6
16:02 R[DaneelOlivaw] m: given my $foo = 42 { when 42 { say "meow" } }
16:02 camelia rakudo-moar 58dc8c: OUTPUT«meow␤»
16:02 R[DaneelOlivaw] huh, TIL
16:02 finanalyst joined #perl6
16:03 finanalyst @search chima shattered realms
16:03 finanalyst disregard
16:03 finanalyst pls
16:03 ovibos lol
16:03 finanalyst left #perl6
16:04 R[DaneelOlivaw] What's the point of the default {} block in kyclark's construct?
16:04 R[DaneelOlivaw] I see it documented in the same form in our docs, but to my eye it looks utterly pointless.
16:05 perlpilot m: say chr(65048).uniname
16:05 camelia rakudo-moar 58dc8c: OUTPUT«PRESENTATION FORM FOR VERTICAL RIGHT WHITE LENTICULAR BRAKCET␤»
16:05 R[DaneelOlivaw] m: say chr(65048)
16:05 camelia rakudo-moar 58dc8c: OUTPUT«︘␤»
16:06 perlpilot just note the spelling of that last word
16:06 R[DaneelOlivaw] Oh, LMAO!
16:06 R[DaneelOlivaw] m: say 65048.base: 16
16:06 camelia rakudo-moar 58dc8c: OUTPUT«FE18␤»
16:07 R[DaneelOlivaw] For a second I feared it was just Rakudo, but no: http://www.fileformat.info/info/unicode/char/fe18/index.htm
16:07 perlpilot yep
16:07 perlpilot How do you submit bug reports to unicode? :)
16:07 R[DaneelOlivaw] funny
16:08 R[DaneelOlivaw] They probably already know: https://en.wikipedia.org/wiki/Unicode_anomaly
16:08 ugexe https://docs.perl6.org/language/control#default_and_when
16:09 gfldex so the fix is to say: "we know, we know"
16:09 psch j: say chr(65048).uniname
16:09 camelia rakudo-jvm cd19db: OUTPUT«PRESENTATION FORM FOR VERTICAL RIGHT WHITE LENTICULAR BRAKCET␤»
16:09 kyclark Why do both of these unpackings work?
16:09 kyclark m: for ((1,2), (3,4)) -> [$x, $y] { put "x ($x) y ($y)" }
16:09 camelia rakudo-moar 58dc8c: OUTPUT«x (1) y (2)␤x (3) y (4)␤»
16:09 kyclark m: for ((1,2), (3,4)) -> ($x, $y) { put "x ($x) y ($y)" }
16:09 camelia rakudo-moar 58dc8c: OUTPUT«x (1) y (2)␤x (3) y (4)␤»
16:10 perlpilot kyclark: what would you have rakudo do otherwise?
16:10 R[DaneelOlivaw] ugexe: well, yeah, that's the section I referenced in my question. The three code examples after the first seem to have default {} for no reason.
16:10 kyclark Are [] and () eqv?
16:10 R[DaneelOlivaw] no
16:11 R[DaneelOlivaw] m: (1,).WHAT.say; [1,].WHAT.say
16:11 camelia rakudo-moar 58dc8c: OUTPUT«(List)␤(Array)␤»
16:11 psch m: die "foo"; CATCH { default { } }
16:11 camelia rakudo-moar 58dc8c: ( no output )
16:11 perlpilot m: say so (1,2,3) eqv [1,2,3]
16:11 camelia rakudo-moar 58dc8c: OUTPUT«False␤»
16:11 perlpilot ;)
16:12 kyclark I'm fairly confused by List and Array in Perl6, mostly because I can't seem to come up with function sigs that handle them well.
16:12 kyclark e.g., sub foo(Int @list) {...}
16:12 R[DaneelOlivaw] psch: but is there a reason to use it in for {} or given {} ? That the examples show?
16:12 gfldex my $a = Array[Int]; dd $a;
16:12 gfldex m: my $a = Array[Int]; dd $a;
16:12 camelia rakudo-moar 58dc8c: OUTPUT«Cannot look up attributes in a type object␤  in block <unit> at <tmp> line 1␤␤»
16:12 R[DaneelOlivaw] kyclark: lists are immutable, arrays are mutable
16:13 kyclark m: sub foo (Int @list) { dd @list }; foo 1..10
16:13 camelia rakudo-moar 58dc8c: OUTPUT«Type check failed in binding @list; expected Positional[Int] but got Range (1..10)␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
16:13 gfldex m: my  Array[Int] $a; dd $a;
16:13 camelia rakudo-moar 58dc8c: OUTPUT«Cannot look up attributes in a type object␤  in block <unit> at <tmp> line 1␤␤»
16:13 R[DaneelOlivaw] m: sub foo (@list of Int) { dd @list }; foo 1..10
16:13 camelia rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot resolve caller trait_mod:<of>(Parameter, Int); none of these signatures match:␤    (Mu:U $target, Mu:U $type)␤    (Routine:D $target, Mu:U $type)␤at <tmp>:1␤»
16:13 psch R[DaneelOlivaw]: uh, yeah?  'default { }' is kinda 'when * { }'
16:13 R[DaneelOlivaw] m: sub foo (@list where .all ~~ Int) { dd @list }; foo 1..10
16:13 camelia rakudo-moar 58dc8c: OUTPUT«1..10␤»
16:13 psch kyclark: types are nominal, if you're not passing a Positional[Int] it won't match
16:14 gfldex kyclark: `Int @list` does not mean: a list that happens to have Ints in it
16:14 psch m: say (1,2,3).WHAT; say (my Int @ = 1,2,3).WHAT
16:14 camelia rakudo-moar 58dc8c: OUTPUT«(List)␤(Array[Int])␤»
16:14 R[DaneelOlivaw] psch: but it's a last statement :/
16:14 R[DaneelOlivaw] when * {} is just as useless
16:14 psch R[DaneelOlivaw]: what exactly is the example you're refering to?
16:14 araujo joined #perl6
16:14 R[DaneelOlivaw] psch: the three examples here in the docs, sans the first one: https://docs.perl6.org/language/control#default_and_when
16:15 R[DaneelOlivaw] +1 that kyclark is using :)
16:15 gfldex kyclark: you man want to re-read: https://docs.perl6.org/language/list#Typing
16:15 R[DaneelOlivaw] m: given 5 { when 42 { say 42 }; default { say "huh?" }; }; given 5 { when 42 { say 42 }; say "huh?"; }
16:15 camelia rakudo-moar 58dc8c: OUTPUT«huh?␤huh?␤»
16:15 psch m: given "foo" { when Int { say "Int" }; when Num { say "num" }; default { say "something else" } }
16:15 camelia rakudo-moar 58dc8c: OUTPUT«something else␤»
16:16 psch i don't get the confusion?  given/when is a smart-match powered switch/case, and default is the same default as in switch/case
16:16 CIAvash kyclark: https://docs.perl6.org/language/traps#Typed_Array_parameters
16:17 psch R[DaneelOlivaw]: oh, you're saying you could just put it as last statement in the given block
16:17 R[DaneelOlivaw] Yes.
16:17 gfldex kyclark: also, if you want a sub to iterate over stuff, assume what it gets to be an iterator (we don't expose iterators explicitely in Perl 6)
16:17 R[DaneelOlivaw] m: given "foo" { when Int { say "Int" }; when Num { say "num" }; say "something else" }
16:17 camelia rakudo-moar 58dc8c: OUTPUT«something else␤»
16:17 psch yeah, i suppose you could, but you can't rearrange that
16:17 R[DaneelOlivaw] The `when`s will bail out if they match.
16:17 psch m: given 5 { when 5 { say "cool"; proceed }; say "something else" } # you can also proceed into the block
16:17 camelia rakudo-moar 58dc8c: OUTPUT«cool␤something else␤»
16:17 psch well, or into default
16:18 R[DaneelOlivaw] m: given 5 { when 5 { say "cool"; proceed }; default { say "something else" } }
16:18 camelia rakudo-moar 58dc8c: OUTPUT«cool␤something else␤»
16:18 psch m: given 5 { default { say "default" }; when 5 { say 5 } }
16:18 camelia rakudo-moar 58dc8c: OUTPUT«default␤»
16:18 psch oh right
16:18 psch it *is* sequential
16:18 psch m: given 5 { default { say "default"; proceed; }; when 6 { }; when 5 { say 5 } }
16:18 camelia rakudo-moar 58dc8c: OUTPUT«default␤5␤»
16:18 gfldex kyclark: typed arrays are useful if you did some input validation already and don't want to repeat the validation later on for each value. At the other hand, it specialises your subs. Having a multi can help in that case.
16:19 R[DaneelOlivaw] huh
16:19 kyclark OK, still processing this.  Thanks.
16:19 R[DaneelOlivaw] Why did that print `default`?
16:19 psch because 5 ~~ *
16:19 R[DaneelOlivaw] Oh
16:20 R[DaneelOlivaw] So it *is* useless then? :P
16:20 R[DaneelOlivaw] I don't know what proceeds is /me looks up
16:20 psch yeah, the same way that the first statement in a Block is useless because we have ENTER :P
16:21 psch ...or the other way around for ENTER and the first statement in a Block
16:21 psch just like statement_mod:<if> is useless because we have the block form
16:21 R[DaneelOlivaw] I don't see the parallel
16:21 R[DaneelOlivaw] m: { say "one"; ENTER { say "two" } }
16:21 camelia rakudo-moar 58dc8c: OUTPUT«two␤one␤»
16:21 R[DaneelOlivaw] But with the default, it matches first if you put it first
16:21 psch right, it's not really a parellel in anything but TIMTOWTDI :)
16:22 R[DaneelOlivaw] ok
16:22 gfldex in a give block order matters, what makes default as a first statement questionable.
16:22 psch but not necessarily bad or wrong
16:23 R[DaneelOlivaw] Just more typing for no reason :trollface:
16:24 ugexe it lets you align the braces nicely and makes your ocd happy
16:25 cooper joined #perl6
16:26 hankache joined #perl6
16:26 girafe joined #perl6
16:27 gfldex m: sub f(@a where all(@a) ~~ Int){ dd @a }; f 1..10;
16:27 camelia rakudo-moar 58dc8c: OUTPUT«1..10␤»
16:27 gfldex kyclark: ^^^
16:29 R[DaneelOlivaw] I prefer my version, since it lets you avoid duplicating variable's name. Fewer sources of bugs.
16:30 canopus_ joined #perl6
16:30 hankache hola #perl6
16:30 yoleaux 10 Jul 2016 18:34Z <hoelzro> hankache: let me know if you want some guidance in improving the Perl 6 lexer; I haven't worked on it in a while, but it shouldn't be too hard to change
16:30 R[DaneelOlivaw] \o\
16:31 hankache m: my $a; my $b; $b := $a;
16:31 camelia rakudo-moar 58dc8c: ( no output )
16:31 R[DaneelOlivaw] You get a two-arm wave thanks to my buggy keyboard :(
16:31 hankache if you breakdown the above code to three lines (a statement per line) en use the repl it doesn't work any ideas why?
16:32 Actualeyes left #perl6
16:33 psch hankache: what does "doesn't work" mean?
16:33 R[DaneelOlivaw] psch: gives "Cannot use bind operator with this left-hand side"
16:33 hankache yes ^^
16:34 hankache if you put all three statements in one line it works fine.
16:34 psch does it?  as in, if you assign $a afterwards, does $b get the value?
16:34 psch 'cause iirc there was lots broken with binding in the repl
16:35 R[DaneelOlivaw] Yeah, works: https://gist.github.com/zoffixznet/46e1cc88d336de442e34e20ca5b56f15
16:36 psch right, that was #122914
16:36 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=122914
16:36 psch just found that fixed too
16:36 psch maybe the fix there has a hint
16:37 hankache psch it does
16:37 psch complaints about the LHS usually means that the parser didn't find anythat that looks container-y enough
16:37 hankache m: my $a; my $b; $b := $a; $a = 7; say $b;
16:37 camelia rakudo-moar 58dc8c: OUTPUT«7␤»
16:38 psch m: my $x = 5; say MY::<$x>; ::($x) := "foo";
16:38 camelia rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot use bind operator with this left-hand side␤at <tmp>:1␤------> 3my $x = 5; say MY::<$x>; ::($x) := "foo"7⏏5;␤»
16:38 domidumont joined #perl6
16:38 psch well, "containery enough" is badly worded i suppose
16:38 zacts joined #perl6
16:38 R[DaneelOlivaw] Ahh
16:38 psch so, yeah, i'd check if it parses everything correctly
16:38 gfldex m: f(Array[Int](Array) @a){}; my @a = 1,2,3; f(@a);
16:38 camelia rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' ␤at <tmp>:1␤------> 3f(Array[Int](Array)7⏏5 @a){}; my @a = 1,2,3; f(@a);␤    expecting any of:␤        infix␤        infix…»
16:38 psch if that's not it, i'd probably look into the lexpad-y stuff - the REPL cheats in a weird way there afaik
16:41 hankache thanks
16:43 furelypunctional joined #perl6
16:50 araujo joined #perl6
16:55 ribasushi joined #perl6
16:56 lambd0x joined #perl6
16:57 R[DaneelOlivaw] ... unless a powered up jet is on the ground :P
16:59 dvinciguerra_ joined #perl6
16:59 lambd0x Hi everyone! I'm currently having some trouble with I/O binary operations. I undestood that now instead of working with a regular str, it's done using a buf type, but how can I think I might be not knowing how to properly work with this type. Can someone what exactly a buf type holds and how to work back and forth with str?
17:00 R[DaneelOlivaw] encode/decode
17:00 R[DaneelOlivaw] m: say "foo".encode; say "foo".encode.decode
17:00 camelia rakudo-moar 58dc8c: OUTPUT«utf8:0x<66 6f 6f>␤foo␤»
17:00 moritz and a buf is just a sequence of integers
17:01 lambd0x would an @str work with .encode in the same way?
17:03 moritz what do you mean by @str?
17:03 lambd0x a string held in a variable of such.
17:04 moritz @str is an array variable
17:04 moritz so you can say @str[0].encode for example
17:04 moritz or $str.encode
17:04 lambd0x Because it wasn't working.... might be syntax error...
17:05 lambd0x Yes, I was iterating over its parts and calling it to a buf variable.
17:06 lambd0x Just clarifying, how is the right way of declaring a buf variable?
17:07 moritz my $buf
17:07 moritz or my Blob $buf
17:07 moritz or my Buf $buf if you really need a Buf, and a Blob isn't enough
17:08 noganex joined #perl6
17:08 lambd0x ok, will try again. Thanks for moritz
17:13 molaf joined #perl6
17:21 lambd0x m: {my @lines = "Test"; my Buf $buf = @lines[0].encode; say $buf}
17:21 camelia rakudo-moar 58dc8c: OUTPUT«Type check failed in assignment to $buf; expected Buf but got utf8 (utf8.new(84,101,115,116))␤  in block <unit> at <tmp> line 1␤␤»
17:22 psch m: say "Test".encode('ascii').WHAT
17:22 camelia rakudo-moar 58dc8c: OUTPUT«(Blob[uint8])␤»
17:22 psch m: say utf8.^mro; say Buf.^mro
17:22 camelia rakudo-moar 58dc8c: OUTPUT«((utf8) (Any) (Mu))␤Method 'mro' not found for invocant of class 'Perl6::Metamodel::ParametricRoleGroupHOW'␤  in block <unit> at <tmp> line 1␤␤»
17:22 psch m: say utf8.^mro; say Buf.new.^mro
17:22 camelia rakudo-moar 58dc8c: OUTPUT«((utf8) (Any) (Mu))␤((Buf) (Any) (Mu))␤»
17:22 psch m: say utf8.^roles; say Buf.new.^roles
17:22 camelia rakudo-moar 58dc8c: OUTPUT«Cannot unbox a type object␤  in block <unit> at <tmp> line 1␤␤»
17:23 psch ...anyway, my point is somewhere along the lines of "utf8 does Blob, Buf does Blob, but they're not really related"
17:23 psch in a liskov way that is
17:24 lambd0x psch: :)
17:30 FROGGS joined #perl6
17:45 zacts joined #perl6
17:53 lambd0x Ok undestood Buf, therefore I must confirm if I'm missing something while using spurt. Can it write binary just by adding as the third argument the adverb :bin?
17:54 lambd0x *while using buf. :P
17:55 araujo joined #perl6
17:57 lambd0x m: my $line = "Test"; my $buf = $line.encode; say $buf; spurt "file.bin", $buf, :bin;
17:57 camelia rakudo-moar 58dc8c: OUTPUT«utf8:0x<54 65 73 74>␤spurt is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in sub spurt at src/RESTRICTED.setting line 17␤  in block <unit> at <tmp> line 1␤␤»
17:57 gfldex lambd0x: you can use the same options then in method spurt, see https://docs.perl6.org/routine/spurt#class_IO%3A%3APath
17:57 gfldex the doc on sub spurt is missleading
17:57 araujo joined #perl6
17:58 R[DaneelOlivaw] lambd0x: that works fine. What issues are you experiencing?
17:58 lambd0x gfldex: Thanks.
17:59 lambd0x trying to print an array in lines binary basically.
17:59 lambd0x *binary lines... :P
18:00 lambd0x It's printing but as regular text. So I'm guessing something is wrong in my use of spurt
18:01 R[DaneelOlivaw] lambd0x: what are you printing?
18:01 R[DaneelOlivaw] spurt :bin, "foo", "Test".encode; would show up as 'Test' in the file
18:02 dalek doc: 574783c | (Wenzel P. P. Peppmeyer)++ | doc/Type/IO.pod6:
18:02 dalek doc: spurt got :bin
18:02 dalek doc: review: https://github.com/perl6/doc/commit/574783c5ca
18:02 lambd0x something like: $str = "text" to a buf variable after encoding it and passing as argument in the second area of spurt along with :bin adverb
18:03 lambd0x such as: spurt "file.bin", $buf, :bin ;
18:03 R[DaneelOlivaw] lambd0x: well, you're encoding it into utf-8 and then when you read the file (presumably also in utf-8) you'd see "test"
18:03 psch m: my $line = "Test"; my $buf = $line.encode; print $buf; # to illustrate
18:03 camelia rakudo-moar 58dc8c: OUTPUT«Test»
18:04 R[DaneelOlivaw] lambd0x: as compared to say, this: perl6 -e 'my @lines = "©" xx 4; spurt :bin, "file.bin", @lines.join("\n").encode: "latin1"'
18:04 lambd0x yes yes ...
18:04 psch a $buf is a per-"character" (FSDO) representation of a string
18:04 R[DaneelOlivaw] I get trash when I view that file with `less`
18:04 R[DaneelOlivaw] psch: what's "D" in FSDO?
18:04 psch definition
18:05 psch because "character", "grapheme" and whatelsehaveyou
18:05 psch and then there's ascii where "character" works
18:05 psch m: my $line = "Test"; .say for $line.NFKD # this might be what lambd0x wants..?
18:05 camelia rakudo-moar 58dc8c: OUTPUT«84␤101␤115␤116␤»
18:06 psch but yeah, as R[DaneelOlivaw] says, :bin-spurting means "write those bytes", and those bytes are valid utf8, so they stay text
18:07 sjoshi joined #perl6
18:08 lambd0x Now I get it.
18:08 R[DaneelOlivaw] :)
18:08 lambd0x Thanks everybody.
18:08 R[DaneelOlivaw] Any time
18:09 psch m: my $line = "Test"; my $buf = $line.encode; print $buf>>.Int;
18:09 camelia rakudo-moar 58dc8c: OUTPUT«84 101 115 116»
18:09 psch also works i suppose
18:09 psch but that gives you a List, which stringifies with spaces
18:11 domidumont joined #perl6
18:11 R[DaneelOlivaw] m:  my $buf = '♥'.encode; print $buf».Int;
18:11 camelia rakudo-moar 58dc8c: OUTPUT«226 153 165»
18:11 R[DaneelOlivaw] neat \o/
18:12 lambd0x Yeah, I was looking into this just to see how this works in binary. But the fist answers you guys gave me solved my doubts
18:12 lambd0x Another thing, does perl6 has modules for good encryption standards?
18:13 psch http://modules.perl6.org/#q=crypt looks pretty decent, but i don't really know crypto vOv
18:13 spider-mario joined #perl6
18:13 lambd0x pgp, aes, rsa...etc. I was looking for a way to encrypt files in perl
18:13 lambd0x psch: I looked at it, but seems to be a work in progress still.
18:14 R[DaneelOlivaw] We have decent interop with Perl 5. So you can use most modules on https://metacpan.org/
18:14 psch lambd0x: which "it"?
18:14 psch lambd0x: there's like 6 modules :)
18:16 lambd0x psch: RC4. sorry for the delay..
18:16 R[DaneelOlivaw] left #perl6
18:17 lambd0x R[DaneelOlivaw]: Is there some use flag to be declared in order to use those modules from perl5?
18:19 moritz lambd0x: you need Inline::Perl5 for that
18:20 psch lambd0x: ah, i see.  well, as i said, i don't really know crypto vOv
18:20 psch m/ &
18:20 * psch &
18:21 lambd0x psch: Thanks anyway :)
18:23 lambd0x moritz: nice :)
18:23 ___ joined #perl6
18:23 araujo_ joined #perl6
18:25 ___ lambd0x: once you have Inline::Perl5 installed. You can just use Foo:from<Perl5>; to load a Perl 5 module.
18:25 ___ Without having to `use Inline::Perl5` in your code.
18:27 lambd0x \o/ ___
18:31 timotimo the floor is talking o_O
18:33 ___ m: "{floor 0o0} is talking".say
18:33 camelia rakudo-moar 58dc8c: OUTPUT«0 is talking␤»
18:34 Guest66 joined #perl6
18:35 sjoshi joined #perl6
18:35 Guest66 p6: my @t = word1 word2
18:35 camelia rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routines:␤    word1 used at line 1. Did you mean 'words', 'ords'?␤    word2 used at line 1. Did you mean 'words', 'ords'?␤␤»
18:36 ___ m: say 0o9
18:36 camelia rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤'9' is not a valid number␤at <tmp>:1␤------> 3say 0o97⏏5<EOL>␤»
18:36 ___ Huh :/
18:36 Guest66 p6: my @t = "word1 word2"
18:36 camelia rakudo-moar 58dc8c: ( no output )
18:37 Guest66 p6: my @t = "word1 word2" ; say @t
18:37 camelia rakudo-moar 58dc8c: OUTPUT«[word1 word2]␤»
18:37 Guest66 p6: my @t = "word1 word2" ; say @t[0]
18:37 camelia rakudo-moar 58dc8c: OUTPUT«word1 word2␤»
18:38 Guest66 why say@t[0] is not word1 pls ?
18:38 Guest66 <__
18:38 mspo p6: my @t = "word1 word2".split; say @t[0]
18:38 camelia rakudo-moar 58dc8c: OUTPUT«Cannot resolve caller split(Str: ); none of these signatures match:␤    (Cool $: Regex:D $pat, $limit = Inf;; :$all, *%_)␤    (Cool $: Cool:D $pat, $limit = Inf;; :$all, *%_)␤    (Str:D $: Regex:D $pat, $limit is copy = Inf;; :$v is copy, :$k, :$kv, …»
18:38 mst because @t is an array of one element, containing 'word1 word2'
18:38 ___ Guest66: because @t contains just one element, the string "word 1 word2"
18:39 ___ p6: my @t = "word1 word2".words; say @t[0]
18:39 camelia rakudo-moar 58dc8c: OUTPUT«word1␤»
18:39 mst p6: my @t = <word1 word2>; say @t[0]
18:39 camelia rakudo-moar 58dc8c: OUTPUT«word1␤»
18:39 mspo p6: my @t = "word1 word2".split(\s+); say @t[0]
18:39 camelia rakudo-moar 58dc8c: OUTPUT«5===SORRY!5===␤Null regex not allowed␤at <tmp>:1␤------> 3my @t = "word1 word2".split(\s+7⏏5); say @t[0]␤Couldn't find terminator +␤at <tmp>:1␤------> 3my @t = "word1 word2".split(\s+7⏏5); say @t[0]␤    expecting any of:␤   …»
18:39 mspo anyway .words is better
18:39 lambd0x prob what u want is @t = "word1", "word2";
18:39 Guest66 yeah ! thanks mspo
18:39 mst or the <> form I showed
18:39 mspo yess <> is also good
18:39 kyclark @t = <word1 word2>
18:40 ___ m: say 0o8
18:40 camelia rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤'8' is not a valid number␤at <tmp>:1␤------> 3say 0o87⏏5<EOL>␤»
18:40 gfldex m: my sub term:<o.O> {Failure.new("Wut‽")}; say o.O;
18:40 camelia rakudo-moar 58dc8c: OUTPUT«Wut‽␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
18:40 lambd0x mst: \o/
18:40 Guest66 i'm french & love P6 but there is not many tutorial
18:40 ___ Guest66: there's http://perl6intro.com/ and http://perl6.party/
18:40 tbrowder please review roast PR 136 <https://github.com/perl6/roast/pull/136> and its spectest log at gist <https://gist.github.com/tbrowder/0a4e05800452221f5f6c00c5e51675f6>
18:41 kyclark FWIW, I'm trying P6 with the Rosalind problems if you want to look at what I'm doing (https://github.com/kyclark/rosalind.info)
18:41 ___ Guest66: oh, and of course: http://learnxinyminutes.com/docs/perl6/
18:41 huggable joined #perl6
18:41 tbrowder the added tests are for known bad (illegal) Perl 6 pod tables
18:41 mspo p6: my @t = "word1 word2".split(/\s+/); say @t[0]
18:41 camelia rakudo-moar 58dc8c: OUTPUT«word1␤»
18:42 perlpilot Guest66: also, feel free to ask questions here.   :)
18:42 lambd0x Guest66: Guess it's new and still changing, but there's already quite a few tutorials over the net I think.
18:42 girafe2 joined #perl6
18:42 Guest66_ joined #perl6
18:42 Guest66_ re
18:42 gfldex we didn't doc term:<> yet and I can't come up with a good example
18:43 ___ tbrowder: it would be nice to have some test description here. Including the file name: https://github.com/perl6/roast/pull/136/files#diff-a74d8b80f654708561ecc9d9442b15feR214
18:43 perlpilot lambd0x: it's not changing that much.
18:43 lambd0x Docs are awesome: https://docs.perl6.org/
18:43 ___ m: use Test; dies-ok {;}
18:43 camelia rakudo-moar 58dc8c: OUTPUT«not ok 1 - ␤␤# Failed test at <tmp> line 1␤»
18:43 gfldex in fact I can't come up with a bad example either
18:43 ___ tbrowder: ^ otherwise, the failures aren't obvious with regard to what test exactly failed.
18:44 lambd0x perlpilot: considering since it's start I think it did. but not much recently, yes.
18:44 Guest66_ gfldex <>  use prompt ? for capted the answer the users ?
18:45 cdg joined #perl6
18:46 ___ tbrowder: oh, another issue I spotted, you're shelling out to 'perl6' but that won't work.
18:46 perlpilot P6fr: looks like you're thinking of perl 5 there.
18:46 tbrowder the file modified was "t/spec/S26-documentation/07-tables.t" where a loop of 5 tests was added at the end, and files for those 5 tests are in a new sub-directory
18:47 P6fr yes perlpilot
18:47 ___ tbrowder: I'm pretty sure those tests are passing because it dies for the wrong reason, so it's best to test the output too.
18:47 ___ m: use Test; dies-ok { shell "zomfbufdfas" }
18:47 camelia rakudo-moar 58dc8c: OUTPUT«ok 1 - ␤»
18:49 perlpilot P6fr: <> in P6 is like qw() in P5.   thus  my @t = <word1 word2>;
18:49 tbrowder zoffix: if you can figure out how i can do that  i would appreciate it. I've tried capturing the output using Proc and :out, etc., but can't get anything to work--ideas appreciated!!
18:49 gfldex m: my sub term:<o.O> {Failure.new("Wut‽")}; say o.O.VAR;
18:49 camelia rakudo-moar 58dc8c: OUTPUT«Wut‽␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
18:49 gfldex m: my sub term:<o.O> {Failure.new("Wut‽")}; say &o.O.VAR;
18:49 camelia rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    o used at line 1␤␤»
18:50 gfldex m: my sub term:<o.O> {Failure.new("Wut‽")}; say &(o.O).VAR;
18:50 camelia rakudo-moar 58dc8c: OUTPUT«Wut‽␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
18:50 gfldex m: my sub term:<o.O> {Nil}; say &(o.O).VAR;
18:50 camelia rakudo-moar 58dc8c: OUTPUT«Nil␤»
18:51 tbrowder all is for nought if I can't call Perl6 in the shell
18:52 tbrowder s/
18:52 ___ tbrowder: you can, you just have to use $*EXECUTABLE.
18:53 ___ tbrowder: something like this: perl6 -e 'use Test; my $p = run $*EXECUTABLE, "0.pod", :out, :err; is $p.out.slurp-rest, "meow", "STDOUT looks good"; is $p.err.slurp-rest, "foo", "STDERR looks good";'
18:53 tbrowder ah!  just thought of something--back later, closing the PR for now
18:54 ___ tbrowder: actually, a better approach would be to use is_run() from Test::Util. Just slurp the file and give it as code: https://github.com/perl6/roast/blob/master/packages/Test/Util.pm
18:54 * perlpilot still finds slurp-rest annoyingly named
18:55 ___ (some examples of its usage: https://github.com/perl6/roast/search?utf8=%E2%9C%93&amp;q=is_run )
18:56 tbrowder zoffix: that looks like it may work--back later
18:57 gfldex m: my sub term:<o.O>{&?ROUTINE.signature.perl}; say o.O;
18:57 camelia rakudo-moar 58dc8c: OUTPUT«:()␤»
18:57 gfldex m: my sub term:<o.O>{say $_; &?ROUTINE.signature.perl}; say o.O;
18:57 camelia rakudo-moar 58dc8c: OUTPUT«(Any)␤:()␤»
18:59 harmil joined #perl6
19:01 harmil Couple minor nits with EVAL: 1) "MONKEY-SEE-NO-EVAL" is a really non-intuitive name and do we generally use all-caps for pragmas in P6? Would "use unsafe-eval" make more sense? 2) the error is ambiguous, and at first I thought it was saying "MONKEY-SEE-NO-EVAL" was the new function I had to use, not "use MONKEY-SEE-NO-EVAL" should go in my code...
19:02 ___ m: my $x; EVAL "$x"
19:02 camelia rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤EVAL is a very dangerous function!!! (use MONKEY-SEE-NO-EVAL to override,␤but only if you're VERY sure your data contains no injection attacks)␤at <tmp>:1␤------> 3my $x; EVAL "$x"7⏏5<EOL>␤»
19:02 harmil Perhaps as a clearer error message, "use the MONKEY-SEE-NO-EVAL pragma"...
19:04 ___ harmil: sure. I'll fix that right now. As for MONKEYs... there's a whole bunch of other MONKEY's so I don't think that will get changed :)
19:04 harmil "there's a whole bunch of other MONKEY's" -- story of my professional life
19:04 ___ lol
19:09 ___ For anyone curious about other MONKEYs (though many of them are just reserved for future use): https://gist.github.com/zoffixznet/166cc31c70ff4a4bcb4897a6319d7738
19:10 sufrostico joined #perl6
19:10 perlpilot harmil: the loudness and obnoxiousness of MONKEY-* is purposeful.
19:10 timotimo as is the upper-casing of EVAL
19:11 mst and then the fact it isn't MONKEY_SEE_NO_EVAL is because the perl6 developers hate you and want you to fail to type it all the time
19:11 ___ :D
19:12 mst (the _ to - rename for caps things was incredibly user hostile and I've still never managed to get anybody to justify it)
19:12 ___ To make it harder to type :)
19:13 Tonik joined #perl6
19:14 harmil I like snake-case, now. It took a while. I understand my Lisp friends a bit more every day I use Perl 6
19:14 ___ CAPSLOCK... IT'S CRUISE CONTROL FOR MONKEY-SEE-NO-EVAL :)
19:14 harmil m: my &smap = &say ∘ &map; my &smapcrement = &smap.assuming({$_+1}); smapcrement 1,2,3
19:14 camelia rakudo-moar 58dc8c: OUTPUT«234␤»
19:14 harmil m: say map {$_+1}, 1,2,3
19:14 camelia rakudo-moar 58dc8c: OUTPUT«(2 3 4)␤»
19:15 harmil Why are those two different output?
19:17 timotimo perhaps the assuming is losing ta slurpy positional argument or something?
19:18 ___ gfldex: what's term:<> ?
19:19 acrussell joined #perl6
19:19 * ___ is reminded of http://perl6.party/post/Anguish--Invisible-Programming-Language-and-Invisible-Data-Theft
19:21 ___ m: my $x = 'use NativeCall; sub system (Str) is native {}; system "ls"'; EVAL "$x"
19:21 camelia rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤EVAL is a very dangerous function!!! (use MONKEY-SEE-NO-EVAL to override,␤but only if you're VERY sure your data contains no injection attacks)␤at <tmp>:1␤------> 3r) is native {}; system "ls"'; EVAL …»
19:21 ___ m: my $x = 'use NativeCall; sub system (Str) is native {}; system "ls"'; "$x".EVAL
19:21 camelia rakudo-moar 58dc8c: OUTPUT«Perlito␤bar␤bin␤dalek-queue␤evalbot␤evalbot.log␤foo␤lib␤log␤mbox␤nqp-js␤p1␤p2␤p6eval-token␤perl5␤rakudo-j-1␤rakudo-j-2␤rakudo-j-inst␤rakudo-j-inst-1␤rakudo-j-inst-2␤rakudo-m-1␤rakudo-m-2␤rakudo-m-inst␤rakudo-m-…»
19:21 gfldex ___: it's the term declarator and that concludes my knowledge about term:<>
19:22 ___ Ah. Now I get it
19:22 wamba joined #perl6
19:23 pmqs_ joined #perl6
19:23 sno joined #perl6
19:23 arnsholt A term:<...> declares something that functions as a term in the syntax
19:23 arnsholt Numbers, strings, etc
19:24 arnsholt There are a few special terms though, now being the one that comes to mind right away
19:25 gfldex m: my \term:<o.O> = { sub {2*$^a} }; say o.O(42);
19:25 camelia rakudo-moar 58dc8c: OUTPUT«sub ($a) { #`(Sub|51211320) ... }␤»
19:25 mst harmil: I like foo-bar but would prefer FOO_BAR to FOO-BAR because it's easier to type
19:26 gfldex m: my \term:<o.O> = { sub {2*$^a} }; say o.O()(42);
19:26 camelia rakudo-moar 58dc8c: OUTPUT«84␤»
19:29 labster joined #perl6
19:29 gfldex it seams similar to constant but without restrictions on it's name
19:30 gfldex m: my \term:<.oO> = &note; .oO('This is rather odd.');
19:31 harmil timotimo: no, it seems as if it's the function compositing that's doing that, but yeah, that's the shape of it.
19:31 camelia rakudo-moar 59d808: OUTPUT«This is rather odd.␤»
19:31 harmil m: my &mapcrement = &map.assuming(*+1); say mapcrement 1,2,3
19:31 camelia rakudo-moar 59d808: OUTPUT«(2 3 4)␤»
19:31 ___ m: my $x; EVAL "$x"
19:31 camelia rakudo-moar 59d808: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤EVAL is a very dangerous function!!! (use the MONKEY-SEE-NO-EVAL pragma to override this error,␤but only if you're VERY sure your data contains no injection attacks)␤at <tmp>:1␤------> 3my $x; EVAL "$…»
19:31 ___ harmil: ^
19:31 bbkr joined #perl6
19:32 harmil ___: nice!
19:33 addison joined #perl6
19:34 avalokite joined #perl6
19:35 zacts joined #perl6
19:40 firstdayonthejob joined #perl6
19:48 harmil mst: Ah, I see the issue. I get that, but if we're going to prefer snake-case in general, it seems messy to switch for caps... dunno. I could make the case the other way, but I think it's slightly weaker.
19:54 addison joined #perl6
19:58 lambd0x ls
19:59 geekosaur .: No such file or directory
19:59 lambd0x geekosaur: rsrs. Why me?
19:59 lambd0x :)
20:00 El_Che good evening/other-time-of-the-day
20:01 AlexDaniel o/
20:08 ggoebel joined #perl6
20:11 Amnez777 joined #perl6
20:15 Ven joined #perl6
20:15 stanrifkin_ joined #perl6
20:16 stanrifkin_ what means the "nom" in moar-nom or moar-blead-nom?
20:16 hoelzro stanrifkin_: nom is the name of Rakudo's default branch
20:22 [Coke] it meant: "new object model"
20:22 AlexDaniel by the way, why not call it “master”?
20:22 [Coke] now it's just nom. hasn't been new in many years
20:23 [Coke] AlexDaniel: because we never switched it back. historical reasons.
20:23 [Coke] master is just the default default, so ours is nom. there was talk of changing it, but the inertia is real.
20:23 hoelzro if it bugs you... git symbolic-ref master nom
20:24 hoelzro disclaimer - I have no idea how badly that may break things like fetching and pushing >:)
20:27 addison joined #perl6
20:38 harmil Pretty sure nom came from the pugs repo days.
20:39 harmil Now I can't find a reference to that, and I'm doubting myself....
20:40 El_Che I am working on a Solaris perl5 package. It would be fun if I could make one for perl6. But no luck with libuv :(
20:40 timotimo no, "nom" isn't that old
20:41 timotimo nom was when what is now known as "sixmodel" appeared, it's the "New Object Model"
20:41 hoelzro judging from git, nom is at least 5 years old
20:41 jnthn I *think* it was probably around 2010 or 2011
20:41 hoelzro 0998d86
20:41 hoelzro 2011-02-12
20:41 jnthn It may well have been me who made the branch :)
20:42 hoelzro I think it was you jnthn: 317ff57
20:42 * hoelzro kind of wishes dalek would throw in links for commit hashes
20:43 jnthn nom was a huge architectural overhaul; Rakudo's present architecture is a pretty direct descendent of what was introduced then.
20:43 sufrostico joined #perl6
20:44 timotimo that's a testament to how good the architecture is, or how stubborn & boneheaded we are :)
20:44 jnthn In changing so much, it also caused a lot of upheavel (and a lot of whining, because darn humans :P). And so master was left as the "original" Rakudo.
20:45 jnthn Eventually it became rather clear that yes, nom decidedly was the way forward, and the master branch was deleted...leaving nom.
20:46 jnthn And because git really doesn't care, and everyone was used to this, it stayed that way :)
20:49 AlexDaniel I know that rocks are going to fly into my direction after I say this, but given that it serves no useful information *today*, there's no reason to keep something that only makes people ask questions like “wtf is nom?”
20:49 timotimo "come to rakudo, we have nom!"
20:50 hoelzro wasn't there talk last year or so about renaming nom to master
20:50 hoelzro ?
20:50 stanrifkin_ AlexDaniel: right :)
20:50 [Coke] yes, there was talk about it.
20:50 nine Yes. We came close to gaining momentum for a rename after the GLR but I guess the travels surrounding SPW and YAPC killed it off again.
20:51 [Coke] AlexDaniel: given that github lets you pick a default other than master, it's not really stopping anyone from using the repo
20:51 [Coke] And I'll write this convo today up into a wiki entry.
20:51 jnthn I'm quite curious how many folks have scripts that depend on the name nom. I've no idea if, for example, rakudobrew does :)
20:52 nine Nowadays I sometimes git checkout nom on projects where it's actually master ;)
20:52 AlexDaniel jnthn: what a nice opportunity to find out!
20:52 jnthn But yeah, I don't *think* anyone was strongly against it, it's just that nearly everyone has more useful things to be doing. :)
20:54 jnthn Uh, *had.
20:54 jnthn Last year, during the time of the GLR work and just about everything else. :)
20:54 hoelzro I think the rename is the easy part
20:54 jnthn The muscle memory is the hard part? :)
20:54 hoelzro not breaking scripts and getting every dev to switch to working on master is a bit harder =)
20:54 AlexDaniel [Coke]: … actually, I think that instead of documenting old warts it is better to work on removing them…
20:55 jnthn Yeah, it'll have a non-zero cost :)
20:55 jnthn otoh, people asking about it every few months does too, so :P
20:55 sufrostico joined #perl6
20:59 hoelzro we could start transitioning by having the core devs add some push refspecs that made master a mirror of nom
20:59 holyghost joined #perl6
21:00 hoelzro and then, once that's working, remove nom on GH and see what happens
21:00 kyclark joined #perl6
21:01 cpage_ joined #perl6
21:04 kurahaupo joined #perl6
21:07 harmil Doc issue: https://docs.perl6.org/type/Callable#infix:<∘>_ says that ∘ requires both args to have arity 1, and that's not true: my &mulneg = &prefix:<-> ∘ &infix:<*>;
21:07 bbkr joined #perl6
21:07 AlexDaniel huggable: doc issue
21:07 huggable AlexDaniel, https://github.com/perl6/doc/issues/new
21:08 AlexDaniel harmil: ↑ can you submit it there?
21:08 harmil Sure
21:08 AlexDaniel m: my &mulneg = &prefix:<-> ∘ &infix:<*>; say &mulneg(8, 3)
21:08 camelia rakudo-moar 59d808: OUTPUT«-24␤»
21:08 AlexDaniel m: my &mulneg = &prefix:<*> ∘ &infix:<->; say &mulneg(8, 3)
21:08 camelia rakudo-moar 59d808: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    prefix:<*> used at line 1. Did you mean 'prefix:<~>', 'prefix:<->', 'prefix:<+>', 'prefix:<!>', 'prefix:<|>'?␤␤»
21:09 dalek doc: 9a5d53b | (Jan-Olof Hendig)++ | doc/Type/Baggy.pod6:
21:09 dalek doc: Added docs for Baggy.classify-list
21:09 dalek doc: review: https://github.com/perl6/doc/commit/9a5d53b124
21:14 slurpy joined #perl6
21:18 harmil m: my sub prefix:<for>(&block) { block() }; &prefix:<for>({ say 1})
21:18 camelia rakudo-moar 59d808: OUTPUT«1␤»
21:18 harmil m: my sub prefix:<for>(&block) { block() }; for {say 1}
21:18 camelia rakudo-moar 59d808: OUTPUT«5===SORRY!5===␤Expression needs parens to avoid gobbling block␤at <tmp>:1␤------> 3x:<for>(&block) { block() }; for {say 1}7⏏5<EOL>␤Missing block (apparently claimed by expression)␤at <tmp>:1␤------> 3x:<for>(&block) { block() }; for…»
21:18 harmil I was sad, but not shocked ;-)
21:18 rindolf joined #perl6
21:21 holyghost joined #perl6
21:21 holyghost m: say "do" or "die"
21:21 camelia rakudo-moar 59d808: OUTPUT«do␤»
21:23 dalek doc: f0a5384 | (Jan-Olof Hendig)++ | doc/Type/Baggy.pod6:
21:23 dalek doc: Fixed typo
21:23 dalek doc: review: https://github.com/perl6/doc/commit/f0a53844e6
21:25 TEttinger joined #perl6
21:32 cpage_ joined #perl6
21:35 furelypunctional joined #perl6
21:38 cpage_ joined #perl6
21:39 TreyHarr1 joined #perl6
22:01 stmuk_ joined #perl6
22:03 holyghost joined #perl6
22:04 holyghost m: say dir "or" do
22:04 camelia rakudo-moar 59d808: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3say dir "or"7⏏5 do␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statement modifier␤  …»
22:06 vike joined #perl6
22:08 avenj joined #perl6
22:08 avenj joined #perl6
22:14 P6fr m: $date-of-birth = "21/07/2016".split("/")
22:15 camelia rakudo-moar 59d808: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$date-of-birth' is not declared␤at <tmp>:1␤------> 3<BOL>7⏏5$date-of-birth = "21/07/2016".split("/")␤»
22:15 P6fr m: my $date-of-birth = "21/07/2016".split("/")
22:15 camelia rakudo-moar 59d808: ( no output )
22:15 P6fr m: my $date-of-birth = "21/07/2016".split("/").say
22:15 camelia rakudo-moar 59d808: OUTPUT«(21 07 2016)␤»
22:16 kyclark joined #perl6
22:16 P6fr how to do to take $1 ?
22:16 P6fr (21)
22:16 P6fr pls
22:17 P6fr without passing by a array
22:17 gfldex m: my $date-of-birth = "21/07/2016".split("/")[0]; dd $date-of-birth;
22:17 camelia rakudo-moar 59d808: OUTPUT«Str $date-of-birth = "21"␤»
22:17 P6fr woooow
22:17 P6fr i love p6
22:17 P6fr <3
22:17 P6fr dd ??
22:18 skids joined #perl6
22:18 gfldex build in datadump function
22:18 bbkr_ joined #perl6
22:18 gfldex success! one page doc works with proper linkage now, preview: https://raw.githubusercontent.com/gfldex/pod-to-bigpage/master/tmp/html.xhtml
22:19 gfldex CSS needs quite some work
22:19 lizmat P6fr: dd is the Tiny Data Dumper: so tiny it lost the T
22:20 geekosaur much better that Data::Dumper->Dump :p
22:20 geekosaur *than
22:21 pmqs_ joined #perl6
22:24 TreyHarr1 joined #perl6
22:30 acrussell joined #perl6
22:41 dj_goku joined #perl6
22:41 huggable joined #perl6
22:41 jack_rabbit joined #perl6
22:48 tbrowder zoffix: i think i have a good solution based on your suggestions. however, my new tests are not valid with the current nom (hopefully soon to be renamed master) branch, so i will present them after i get my GTPR (Grand Table Pod Refactor project ready for a PR.
22:49 timotimo tbrowder: oh, cool. have you seen the code i built like 2 years ago for that purpose?
22:49 timotimo man, i wonder if i still have that
22:50 ugexe wheres my damn data dumper that outputs the Big O of a block?
22:50 timotimo tbrowder: https://gist.github.com/timo/6132249
22:51 timotimo m: https://gist.github.com/timo/6132249
22:51 camelia rakudo-moar 59d808: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Can only use 'is rw' on a scalar ('$' sigil) parameter␤at <tmp>:10␤»
22:51 timotimo oops
22:51 timotimo m: https://gist.github.com/timo/6132249
22:51 camelia rakudo-moar 59d808: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Can only use 'is rw' on a scalar ('$' sigil) parameter␤at <tmp>:38␤»
22:52 timotimo m: https://gist.github.com/timo/6132249
22:52 camelia rakudo-moar 59d808: OUTPUT«Superhero, 4␤Secret, 38␤Identity, 20␤Superpower, 38␤[["Superhero"], "Identity", ["Secret"]]␤2␤The Shoveller, 4␤[Any]␤0␤Eddie Stevens, 20␤[["The Shoveller"],]␤1␤King Arthur's, 38␤[["The Shoveller"], ["Eddie Stevens"]]␤2␤singing…»
22:52 timotimo \o/
22:53 timotimo hm, i thought i had code in there for handling multi-line formatting codes
22:53 timotimo i don't seem to, though
22:54 tbrowder timotimo: I don't think I had seen that, but I have seen ShimmerFairy's grammar project.  My effort is to mod the sub table in Pod.npq to do the right thing with the list of table rows that comes with the table match object--no change in grammar required.
22:55 timotimo OK
22:55 timotimo i'll go to bed now
22:56 tbrowder But the grammar change would be the best way to go someday i think, but not so easy IMHO.
22:59 * AlexDaniel prepares for another portion of rocks for https://github.com/perl6/doc/issues/728
23:01 Actualeyes joined #perl6
23:03 kyclark If I 'fail "foo"' out of a sub, how do I get the failure message (foo) from the caller?
23:03 kyclark m: sub t { fail 'foo' }; say t;
23:03 camelia rakudo-moar 59d808: OUTPUT«foo␤  in sub t at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
23:03 ugexe AlexDaniel: why not allow bisectable to be msg'd?
23:08 AlexDaniel ugexe: good question. Basically I'm scared of people trying to crap over my server (restricted setting is no help). It would've been better if I wasn't lazy and had an LXC container set up or something. Until then (or until I finally find enough time to move it to hack) you probably have to use #perl6-dev, I guess.
23:08 geekosaur m: sub t { fail 'foo' }; my $x = t; if $x ~~ Failure { say "whoops: {$x.exception.message}" } # kyclark
23:08 camelia rakudo-moar 59d808: OUTPUT«whoops: foo␤»
23:12 frew joined #perl6
23:13 TimToady joined #perl6
23:14 mspo AlexDaniel: isn't the search powered by a big static list of terms that gets generated somehow?
23:15 AlexDaniel mspo: yeah. Why would you ask?
23:17 gfldex it's generated for all but 2 entries
23:18 mspo == new glossary?
23:26 AlexDaniel This is funny: https://en.wikipedia.org/wiki/Talk:Larry_Wall#Canadian_Larry_Wall_is_different_from_the_Perl_creator
23:31 mspo I wonder if TimToady can satisfy the [citation needed] for his birthday
23:31 mspo https://en.wikipedia.org/wiki/Larry_Wall
23:37 kyclark joined #perl6
23:41 kurahaupo joined #perl6

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

Perl 6 | Reference Documentation | Rakudo