Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-10-26

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 ryn1x joined #perl6
00:05 Kyo91_ joined #perl6
00:08 ryn1x joined #perl6
00:09 Geth ¦ doc/master: 7 commits pushed by (Will "Coke" Coleda)++
00:09 Geth ¦ doc/master: abfd63b561 | Convert this check utility to a (failing) xt/ test
00:09 Geth ¦ doc/master: df01737877 | Add support for 'aka' in type-graph.txt
00:09 Geth ¦ doc/master: 9e98885e7d | Fixup many type graph issues
00:09 Geth ¦ doc/master: 1e4ad0cc02 | More correctly fake up role MROs
00:09 Geth ¦ doc/master: d7199d33a8 | avoid Failure sink issues
00:09 Geth ¦ doc/master: f1bfdf4130 | Remove CompUnit section
00:09 Geth ¦ doc/master: 4a15e49c2d | remove trailing whitespace
00:09 Geth ¦ doc/master: review: https://github.com/perl6/doc/compare/7679a0cef1...4a15e49c2d
00:10 [Coke] make xtest now also checks that the type-graph.txt file matches what's in rakudo.
00:13 john51 joined #perl6
00:33 evalable6 joined #perl6
00:41 ryn1x joined #perl6
00:46 aborazmeh joined #perl6
00:46 aborazmeh joined #perl6
00:48 ryn1x joined #perl6
00:49 gmichel joined #perl6
00:50 dj_goku joined #perl6
00:56 itaipu joined #perl6
01:00 pilne joined #perl6
01:00 Cabanossi joined #perl6
01:01 cdg joined #perl6
01:01 BenGoldberg joined #perl6
01:02 Kyo91_ joined #perl6
01:06 MasterDuke [Coke]++. gonna convert htmlify.p6 to hyper/race now they're working?
01:19 bitrauser joined #perl6
01:32 llfourn joined #perl6
01:38 cdg joined #perl6
01:41 mr-foobar joined #perl6
01:56 ilbot3 joined #perl6
01:56 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:57 raschipi joined #perl6
01:59 aborazmeh joined #perl6
01:59 aborazmeh joined #perl6
01:59 Cabanossi joined #perl6
02:13 ufobat_ joined #perl6
02:17 ryn1x joined #perl6
02:19 noganex_ joined #perl6
02:30 ivans joined #perl6
02:42 mr-foobar joined #perl6
02:45 cdg joined #perl6
02:59 Cabanossi joined #perl6
03:10 mr-foobar joined #perl6
03:21 wamba joined #perl6
03:25 lizmat joined #perl6
03:36 stux|RC joined #perl6
03:43 Cabanossi joined #perl6
03:43 mr-foobar joined #perl6
03:48 stux|RC joined #perl6
03:52 cdg joined #perl6
03:59 darkmorph joined #perl6
04:15 mr-foobar joined #perl6
04:28 cdg joined #perl6
04:29 Cabanossi joined #perl6
05:05 cdg joined #perl6
05:15 grumble joined #perl6
05:17 albastev joined #perl6
05:23 Exodist joined #perl6
05:23 ryn1x joined #perl6
05:29 Cabanossi joined #perl6
05:30 wamba joined #perl6
05:30 ryn1x joined #perl6
05:37 darutoko joined #perl6
05:39 sena_kun joined #perl6
05:43 mr-foobar joined #perl6
05:50 Actualeyes joined #perl6
05:59 Cabanossi joined #perl6
05:59 Piotr_ joined #perl6
06:01 ryn1x joined #perl6
06:10 Geth ¦ mu: albastev++ created pull request #26: Add to advent schedule
06:10 Geth ¦ mu: review: https://github.com/perl6/mu/pull/26
06:21 evalable6 joined #perl6
06:27 cdg joined #perl6
06:29 Cabanossi joined #perl6
06:37 nadim_ joined #perl6
06:40 domidumont joined #perl6
06:42 wamba joined #perl6
06:45 domidumont joined #perl6
06:47 domidumont joined #perl6
06:54 wamba joined #perl6
06:58 ryn1x joined #perl6
06:59 Cabanossi joined #perl6
07:01 jonas1 joined #perl6
07:02 ufobat joined #perl6
07:13 mr-foobar joined #perl6
07:15 plicease joined #perl6
07:17 astj joined #perl6
07:18 astj joined #perl6
07:28 napo1eon joined #perl6
07:31 dakkar joined #perl6
07:33 pmurias joined #perl6
07:34 ryn1x joined #perl6
07:36 cdg joined #perl6
07:50 zakharyas joined #perl6
07:55 zakharyas joined #perl6
08:00 cdg joined #perl6
08:00 wander joined #perl6
08:00 wander m: my $formatted-text = "Fourscore and seven years ago...".indent(8); say $formatted-text;
08:00 camelia rakudo-moar a85c8d486: OUTPUT: «        Fourscore and seven years ago...␤»
08:04 lowbro joined #perl6
08:04 lowbro joined #perl6
08:10 Ven joined #perl6
08:11 Geth ¦ mu: 4a24cb5e81 | albastev++ (committed using GitHub Web editor) | misc/perl6advent-2017/schedule
08:11 Geth ¦ mu: Add to advent schedule
08:11 Geth ¦ mu:
08:11 Geth ¦ mu: "Tackling a Big Grammar in Perl 6" would be a blog post about how Perl 6 allowed me to successfully build and test a modular Modelica Grammar.
08:11 Geth ¦ mu: review: https://github.com/perl6/mu/commit/4a24cb5e81
08:11 Geth ¦ mu: bd8945164d | lizmat++ (committed using GitHub Web editor) | misc/perl6advent-2017/schedule
08:11 Geth ¦ mu: Merge pull request #26 from albastev/master
08:11 Geth ¦ mu:
08:11 Geth ¦ mu: Add to advent schedule
08:11 Geth ¦ mu: review: https://github.com/perl6/mu/commit/bd8945164d
08:15 wander how does adverb work on pod6?
08:15 wander some like `=for code :allow<B L> :preamble<my $formatted-text;>'
08:15 knight__ joined #perl6
08:15 parv joined #perl6
08:16 wander what's the different between such a code block and just indent the code
08:17 wander and is `:preamble ' for passing tests?
08:19 cdg joined #perl6
08:19 DrForr {..} introduces a new scope. And though I'm not sure, I'm guessing :preamble has nothing to do with passing tests, it's just a comment to the effect that 'my $formatted-test;' appears before the start of some code.
08:28 Cabanossi joined #perl6
08:33 wander m: my uint64 $a = 42; say $a.^name; #
08:33 camelia rakudo-moar a85c8d486: OUTPUT: «Int␤»
08:36 lizmat m: my int64 $a = 42; dd $a.^mro
08:36 camelia rakudo-moar a85c8d486: OUTPUT: «(Int, Cool, Any, Mu)␤»
08:36 lizmat a native is not really an object: if you treat it like an object, it mimics its HLL counterpart
08:36 lizmat m: my str $a = "foo"; dd $a.^mro
08:36 camelia rakudo-moar a85c8d486: OUTPUT: «(Str, Cool, Any, Mu)␤»
08:36 wander no problem. just to get a rakudo-moar output
08:36 wander :P
08:37 lizmat m: say 42
08:37 camelia rakudo-moar a85c8d486: OUTPUT: «42␤»
08:37 lizmat :-)
08:40 grumble joined #perl6
08:44 mr-foobar joined #perl6
08:47 Aaronepower joined #perl6
08:47 ryn1x joined #perl6
08:47 AlexDaniel` uh. Just yesterday I was enjoying fallen leaves and stuff, and overnight we have like 20 cm of snow https://files.progarm.org/IMG_20171026_114002.jpg
08:48 AlexDaniel` the kids are sledging right in front of my house :)
09:07 wander joined #perl6
09:08 ufobat wow
09:08 ufobat cool
09:08 ufobat where are you from AlexDaniel?
09:08 AlexDaniel` Estonia
09:08 tadzik nice :D
09:09 DrForr Hoo boy, we're gonna get it here in Prague soon then.
09:10 Geth ¦ doc: 45af77b021 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/tables.pod6
09:10 Geth ¦ doc: fix spelling
09:10 Geth ¦ doc: review: https://github.com/perl6/doc/commit/45af77b021
09:10 synopsebot Link: https://doc.perl6.org/language/tables
09:13 wander DrForr, finally I find the explanation of :preamble at perl6/doc/EXAMPLES.md
09:13 wander it's about Writing Examples
09:15 DrForr Ah.
09:16 ufobat i wanted to go hicking with the kids this weekend, but the weatherforecast is not so good :/
09:22 cdg joined #perl6
09:27 ryn1x joined #perl6
09:28 Geth ¦ doc: 46e6c137ee | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/tables.pod6
09:28 Geth ¦ doc: clarify restrictions vs bad practice
09:28 Geth ¦ doc: review: https://github.com/perl6/doc/commit/46e6c137ee
09:28 synopsebot Link: https://doc.perl6.org/language/tables
09:30 Geth ¦ doc: 91eb48a83d | (Alex Chen)++ (committed using GitHub Web editor) | doc/Language/objects.pod6
09:30 Geth ¦ doc: Unified format of code block
09:30 Geth ¦ doc:
09:30 Geth ¦ doc: and delete redundant links
09:30 Geth ¦ doc: review: https://github.com/perl6/doc/commit/91eb48a83d
09:30 synopsebot Link: https://doc.perl6.org/language/objects
09:35 rindolf joined #perl6
09:44 mr-foobar joined #perl6
09:44 itaipu joined #perl6
09:48 piojo joined #perl6
09:48 wamba joined #perl6
09:50 piojo When I initialize DBIish in a module, I'm getting "SORRY! This type (NQPMu) does not support associative operations" when I include that module in other files
09:50 piojo DbConn.pm6 contains: use DBIish; DBIish.connect('Pg');
09:50 piojo Importer.pm6 contains: use DbConn;
09:50 piojo and I'm running: perl6 -I. -MImporter -e 'say 5'
09:51 piojo Does this seem like a DBIish problem, or rakudo?
09:53 piojo It seems like it's all about the depth of includes I have--if there is just one include, it works. But two levels (either the CLI version I pasted, or adding a .p6 script that includes Importer, so there are two levels of "using")
09:53 moritz does it work if you run DbConn.pm6 directly?
09:54 piojo moritz: yes
09:54 piojo Also fine to run code in Include.pm6 directly
09:56 piojo (It happens on both Linux and Windows, so I think it's not a personal problem)
09:57 Aaronepower joined #perl6
09:57 piojo If you test, please be sure to delete ./.precomp. Otherwise it may run even when the test case will normally fail
10:01 piojo Err, I meant it's fine to run "Import.pm6" directly. Didn't mean to introduce another class
10:03 piojo I'm rebooting, be back in a minute
10:05 piojo joined #perl6
10:05 aborazmeh joined #perl6
10:05 aborazmeh joined #perl6
10:18 ivans joined #perl6
10:20 piojo I'm also getting a "Missing serialize REPR function for REPR ConditionVariable (Lock::ConditionVariable)" when I come up with any workaround for the previous error
10:21 steeznson joined #perl6
10:23 piojo Though if I cram it all into one script, it works fine
10:25 Geth ¦ ecosystem: 5b7cf09a7e | (Alexey Melezhik)++ (committed using GitHub Web editor) | META.list
10:25 Geth ¦ ecosystem: Sparrowdo gets uploaded to CPAN
10:25 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/5b7cf09a7e
10:28 Cabanossi joined #perl6
10:36 buggable New CPAN upload: Sparrowdo-0.0.35.tar.gz by MELEZHIK https://cpan.metacpan.org/authors/id/M/ME/MELEZHIK/Perl6/Sparrowdo-0.0.35.tar.gz
10:40 ryn1x joined #perl6
10:45 margeas joined #perl6
10:48 Geth ¦ mu: JJ++ created pull request #27: Requesting a slot for the Advent Calendar
10:48 Geth ¦ mu: review: https://github.com/perl6/mu/pull/27
10:52 Geth ¦ mu: 2f74350439 | (JJ Merelo)++ | misc/perl6advent-2017/schedule
10:52 Geth ¦ mu: Requesting a slot for the Advent Calendar
10:52 Geth ¦ mu:
10:52 Geth ¦ mu: It can be moved up and down at will; I just greedily took the first
10:52 Geth ¦ mu: spot available. It will be about how I tried to make scripts to take
10:52 Geth ¦ mu: my Perl6 book to production easily and ended up working on the Perl 6
10:52 Geth ¦ mu: Text::Markdown module.
10:52 Geth ¦ mu: review: https://github.com/perl6/mu/commit/2f74350439
10:52 Geth ¦ mu: d173b3ffa9 | (Zoffix Znet)++ (committed using GitHub Web editor) | misc/perl6advent-2017/schedule
10:52 Geth ¦ mu: Merge pull request #27 from JJ/master
10:52 Geth ¦ mu:
10:52 Geth ¦ mu: Requesting a slot for the Advent Calendar
10:52 Geth ¦ mu: review: https://github.com/perl6/mu/commit/d173b3ffa9
10:54 lowbro joined #perl6
10:54 lowbro joined #perl6
11:05 piojo moritz: Can you tell whether DBIish only working in one file is a rakudo or DBIish bug?
11:14 Grimy joined #perl6
11:18 ryn1x joined #perl6
11:29 Cabanossi joined #perl6
11:29 Grimy The docs say “=== uses the WHICH method to obtain the object identity”, but what does this mean? Sometimes $a !== $b even though $a.WHICH eq $b.WHICH, so === must be doing something else.
11:31 Grimy Looking at rakudo’s source, it looks like there are many overloads of ===, but only infix:<===>(Any, Any) is documented.
11:36 AlexDaniel uh, !==? you mean !=== ?
11:37 raschipi joined #perl6
11:39 Grimy Uh, yes, that’s what I meant
11:42 raschipi Can you give an example?
11:44 Grimy m: my ($a, $b) = (1e0, 1e0 + 4e-15); $a === $b, $a.WHICH eq $b.WHICH
11:44 camelia rakudo-moar 5d4ca586b: ( no output )
11:44 Grimy m: my ($a, $b) = (1e0, 1e0 + 4e-15); say $a === $b, $a.WHICH eq $b.WHICH
11:44 camelia rakudo-moar 5d4ca586b: OUTPUT: «FalseTrue␤»
11:47 geekosaur Num is not using WHICH, it's using an overload to compare actual values. .WHICH is only needed for non-value types
11:47 sproctor joined #perl6
11:48 geekosaur and then the vagaries of IEEE floating point will get in the way and confuse things (and may well be confusing the .WHICH)
11:48 geekosaur m: dd (1e0+4e-15).WHICH
11:48 camelia rakudo-moar 5d4ca586b: OUTPUT: «ObjAt.new("Num|1")␤»
11:48 geekosaur uh
11:49 Grimy So the issue is just that WHICH on Nums isn’t using enough precision?
11:49 geekosaur apparently
11:49 geekosaur but again, for value types it doesn;t bother with .WHICH because it can compare the values
11:49 Grimy Well ideally both should give the same results
11:49 geekosaur there is no reason to build an ObjAt for a number, generally
11:56 eliasr joined #perl6
12:03 Geth ¦ mu: ac6b925c8b | (Jonathan Stowe)++ (committed using GitHub Web editor) | misc/perl6advent-2017/schedule
12:03 Geth ¦ mu: Update schedule
12:03 Geth ¦ mu:
12:03 Geth ¦ mu: I have some vague stuff about messaging patterns sketched out somewhere :)
12:03 Geth ¦ mu: review: https://github.com/perl6/mu/commit/ac6b925c8b
12:14 mr-foobar joined #perl6
12:21 ivans joined #perl6
12:26 wander It said "Unlike Subroutines, additional named arguments will not produce compile time or runtime errors."
12:27 wander I wonder how additional named arguments produce compile time or runtime errors on Subroutines
12:30 lizmat m: use nqp; dd nqp::unbox_n(1e0); dd nqp::unbox_n(1e0 + 4e-15)  # geekosaur: the source of the issue
12:30 camelia rakudo-moar 10e7af009: OUTPUT: «1e0␤1e0␤»
12:30 lizmat m: use nqp; dd nqp::unbox_n(1e0); dd nqp::unbox_n(1e0 + 4e-14)  # one order of magnitude larger and we're ok
12:30 camelia rakudo-moar 10e7af009: OUTPUT: «1e0␤1.00000000000004e0␤»
12:32 raschipi lizmat: Is this floating point error?
12:33 lizmat I'm not sure: I'm just saying that the problem is not in rakudo, but lies deeper, probably in MoarVM
12:33 lizmat as the JVM backend does not have this issue, I'm told
12:33 lizmat j: say 42
12:33 camelia rakudo-jvm a92950fb4: OUTPUT: «Error while reading '/home/camelia/p6eval-token': No such file or directory at /home/camelia/rakudo-j-inst/bin/eval-client.pl line 10.␤»
12:34 lizmat alas, we can't test that easily  :-(
12:34 [Coke] MasterDuke: (hyper/race) or something. :)
12:35 Ven joined #perl6
12:35 [Coke] (docs, preamble) https://github.com/perl6/doc/blob/master/EXAMPLES.md#preambles
12:36 Geth ¦ doc: aa93bc2a41 | (Alex Chen)++ (committed using GitHub Web editor) | doc/Language/objects.pod6
12:36 Geth ¦ doc: unified format
12:36 Geth ¦ doc:
12:36 Geth ¦ doc: and add note about default constructor
12:36 Geth ¦ doc: review: https://github.com/perl6/doc/commit/aa93bc2a41
12:36 synopsebot Link: https://doc.perl6.org/language/objects
12:39 [Coke] DrForr: it's *exactly* about making the code compile without having to show all the work (which is sometimes helpful from a teaching standpoint)
12:39 [Coke] (all the work has to be there, but the preamble isn't rendered, it's just used to make the code snippet compile.)
12:41 DrForr Oh, that. Hrm, that I could actually use.
12:42 wander m: my $x = 42; say "$x.^name"; say "$x.^name()";
12:42 camelia rakudo-moar 4b60df8f8: OUTPUT: «42.^name␤Int␤»
12:42 wander interesting..
12:42 Geth ¦ mu: e5615cbf29 | (Brian Duggan)++ | misc/perl6advent-2017/schedule
12:42 Geth ¦ mu: Advent calendar: Dec 10
12:42 Geth ¦ mu:
12:42 Geth ¦ mu: I propose to write an advent post involving
12:42 Geth ¦ mu: the use of Rats/fractions for measurement.
12:42 Geth ¦ mu: review: https://github.com/perl6/mu/commit/e5615cbf29
12:43 [Coke] wander: if you have a question about what'll get interpolated, use {}
12:43 wander I see
12:43 [Coke] m: my $x = 42; say "{$x.^name}hi
12:43 camelia rakudo-moar 4b60df8f8: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in double quotes; couldn't find final '"' (corresponding starter was at line 1)␤at <tmp>:1␤------> 3my $x = 42; say "{$x.^name}hi7⏏5<EOL>␤    expecting any of:␤ …»
12:43 [Coke] m: my $x = 42; say "{$x.^name}hi"
12:43 camelia rakudo-moar 4b60df8f8: OUTPUT: «Inthi␤»
12:44 Cabanossi joined #perl6
12:44 wander always I use {}, but how it actually works, I means without {}
12:45 [Coke] https://docs.perl6.org/language/quoting#Interpolation:_qq
12:47 itaipu joined #perl6
12:49 wander thank you
12:54 DrForr Specifically that sounds useful if I can get around to writing the pod => HTML + checker code.
12:55 Grimy m: dd all(1, 2) != 1, one(1, 2) != 1
12:55 camelia rakudo-moar 4b60df8f8: OUTPUT: «Bool::True␤Bool::False␤»
12:55 Grimy That’s the opposite of DWIM. Exactly one of (1, 2) is != 1.
12:57 ugexe Use a different operator
12:57 jonas1 joined #perl6
12:57 wander m: say 1 ~~ one(1, 2);
12:57 camelia rakudo-moar 4b60df8f8: OUTPUT: «True␤»
12:58 wander say 1 ~~ all(1, 2)
12:58 evalable6 wander, rakudo-moar 4b60df8f8: OUTPUT: «False»
12:58 Grimy m: say 1 ~~ one(1, 2)
12:58 camelia rakudo-moar 4b60df8f8: OUTPUT: «True␤»
12:58 Grimy m: say 1 !~ one(1, 2)
12:58 camelia rakudo-moar 4b60df8f8: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of !~ to do negated pattern matching; in Perl 6 please use !~~␤at <tmp>:1␤------> 3say 1 !~ 7⏏5one(1, 2)␤»
12:58 Grimy m: say 1 !~~ one(1, 2)
12:58 camelia rakudo-moar 4b60df8f8: OUTPUT: «False␤»
12:58 Grimy Same issue
12:59 Grimy 1 is !~~ exactly one of (1, 2), yet 1 !~~ one(1, 2) returns False.
12:59 raschipi As 1 ~~ one(1, 2) is true, the inverse of that is false
13:00 wander m: say one(1, 2) ~~ 1
13:00 camelia rakudo-moar 4b60df8f8: OUTPUT: «True␤»
13:00 [Coke] m: say ! (all(1,2) == 1)
13:00 camelia rakudo-moar 4b60df8f8: OUTPUT: «True␤»
13:01 [Coke] docs say this:
13:01 [Coke] "Negated operators are special-cased when it comes to autothreading. $a !op $b is rewritten internally as !($a op $b). The outer negation collapses any junctions, so the return value always a plain Bool.
13:01 [Coke] "
13:01 El_Che !release
13:01 El_Che !next
13:02 El_Che computer says no
13:02 [Coke] Not sure if != counts as a negated operator.
13:02 Grimy Yeah, it’s documented, but that doesn’t make it less counter-intuitive.
13:04 wander m: say ?all(map (* != 1), [1,2]);
13:04 camelia rakudo-moar 4b60df8f8: OUTPUT: «False␤»
13:05 ryn1x joined #perl6
13:05 Grimy m: say [&&] ([1, 2] «!=» 1)
13:05 camelia rakudo-moar 4b60df8f8: OUTPUT: «False␤»
13:07 cdg joined #perl6
13:07 bdmatatu joined #perl6
13:15 cdg_ joined #perl6
13:15 wander it makes Junctions work strangely
13:16 wander that $a !op $b converted into !($a op $b)
13:21 raschipi what would you expect?
13:24 Grimy I expect “1 != any(1, 2)” to be the same as “any(1 != 1, 1 != 2)”
13:24 Grimy That’s how most operators work with junctions
13:25 sena_kun joined #perl6
13:29 Cabanossi joined #perl6
13:33 raschipi But junctions collapse in boolean context
13:34 Grimy Well yeah. The problem is that it collapses to the negation of the value I’d expect.
13:41 number8 joined #perl6
13:41 El_Che when is the next releases planned (af the delay)? When it's ready or is there a target date?
13:41 raschipi m: say 1 == any(1, 2); say 1 != any(1, 2); say so any(True, False);
13:41 camelia rakudo-moar 4b60df8f8: OUTPUT: «any(True, False)␤False␤True␤»
13:43 number8 Hello, everybody! I'm only starting with Perl 6, and really enjoying it, however I'm kinda confused about IO objects and how to handle them... For example, if I list a directory's contents with dir()...
13:43 mson joined #perl6
13:44 number8 ...and want to rename a file (that may have spaces in it, for example), how do I treat the result, which is something like filename.jpg.IO?
13:45 number8 can I treat it as if it were just the filename as a string, ignoring the .IO?
13:45 raschipi m: say '.'.IO.dir
13:45 camelia rakudo-moar 4b60df8f8: OUTPUT: «(".cpanm".IO ".local".IO ".npm".IO ".perlbrew".IO ".rcc".IO ".ssh".IO "Perlito".IO "evalbot".IO "log".IO "nqp-js".IO "p1".IO "p2".IO "perl5".IO "std".IO ".bash_history".IO ".bashrc".IO "mbox".IO ".lesshst".IO "evalbot.log".IO ".cpan".IO "dalek-queue".…»
13:46 El_Che number8: "la la".IO.rename("lele")
13:47 jast and you can just directly use .rename on the elements you get from dir
13:48 number8 El_Che, thanks! So whenever I get a file or directory as a result with the .IO appended to it, I could just treat it as if it *didn't* have it as a suffix (i.e. as if it were a simple string)?
13:49 El_Che well, in practice yes. In reality you're getting an IO object you can use methods on
13:49 number8 Cool, thanks, jast!
13:49 raschipi No, you treat it as the IO object it is.
13:49 jast if you treated it as a string that would mean more effort. since it's an IO object you can use all the fancy IO methods on it
13:50 El_Che exactly
13:50 number8 Ok, I understand now, thanks you guys!
13:50 El_Che you're welcome
13:50 AlexDaniel El_Che: hello
13:51 AlexDaniel El_Che: it was delaying because we found some bugs that had to be fixed. Right now it looks good so the release will happen soon
13:51 AlexDaniel El_Che: fwiw you can ask releasable6, but it has a little bug and currently shows the wrong date :)
13:52 AlexDaniel delayed*
13:52 El_Che Thx AlexDaniel
13:53 AlexDaniel El_Che: if you're holding your breath, then in 24 hours is a reasonable estimation, but that's just an estimation, not a promise :)
13:53 El_Che AlexDaniel: I'll keep lurking so I can start the build
13:57 jdv79 m: say "*a" ~~ /(.*\*.*?)/
13:57 camelia rakudo-moar 4b60df8f8: OUTPUT: «「*」␤ 0 => 「*」␤»
13:58 jdv79 shouldn't that match the a there?
13:58 jast non-greedy matching matches as little as possible
13:59 jdv79 say "*a" ~~ /\*.*?/
13:59 evalable6 jdv79, rakudo-moar 4b60df8f8: OUTPUT: «「*」»
13:59 jast "as little as possible" means "nothing" here :)
13:59 jast if you anchor it to end of string it will match the 'a'
14:01 jdv79 i have other optional snippets before the anchor
14:01 cdg joined #perl6
14:01 jdv79 huh.  been a while since i regexed it seems
14:02 cdg joined #perl6
14:02 zakharyas joined #perl6
14:02 jdv79 ah, ok.  forgot the anchor.  duh.
14:02 jdv79 thanks
14:06 zakharyas joined #perl6
14:06 ryn1x_ joined #perl6
14:07 ryn1x_ Is Inline::Python compatible with windows? I can use it just fine on macOS and Ubuntu, but can not even install on windows...
14:10 ryn1x joined #perl6
14:14 Ven`` joined #perl6
14:15 khw joined #perl6
14:16 number8 Oh guys, one last quick question: I'm really interested in getting some modules in, particularly Damian's Form, but haven't been able to use zef successfully at all, any thoughts?
14:17 raschipi what error are you getting?
14:18 raschipi put in a gist and give us the link
14:20 COMBORICO joined #perl6
14:23 number8 I don't know if I just need to do some extra configuring, but I often get a message from zef as if it were searching in my local Rakudo directory for the module I'm trying to install, and then tells me it can't find it.
14:23 number8 That's after I do 'zef install <module>'
14:24 number8 I'm not on my main computer right now, so I can't get the exact error message :(
14:24 raschipi later then
14:25 number8 raschipi: Thanks. :)
14:41 timotimo it wouldn't surprise me if Form was already bitrotted beyond recognition, number8
14:42 timotimo okay, it got fixed up after the GLR at least, that was october 2015
14:42 timotimo oh, maybe that isn't what you're refering to; mathw made this one
14:43 timotimo but there is only one module named "Form"
14:44 Cabanossi joined #perl6
14:44 timotimo okay, it does pass its test suite on an up-to-date rakudo
14:46 Geth ¦ doc: b5a893922c | (Alex Chen)++ (committed using GitHub Web editor) | doc/Language/objects.pod6
14:46 Geth ¦ doc: Update objects.pod6
14:46 Geth ¦ doc:
14:46 Geth ¦ doc: Unify format and fix links
14:46 Geth ¦ doc: review: https://github.com/perl6/doc/commit/b5a893922c
14:46 synopsebot Link: https://doc.perl6.org/language/objects
14:46 timotimo so false alarm
14:51 st_elmo joined #perl6
14:52 ryn1x_ Submitted my install problem and the "--debug" output here: https://github.com/niner/Inline-Python/issues/27 . I know not many peole are using windows, but unfortunately many of the lab computers at my work have to be windows to run some commercial software.
14:53 darkmorph joined #perl6
14:55 Piotr_ joined #perl6
14:57 timotimo could you put ``` before and after the big pasted text?
14:58 timotimo oh
14:58 timotimo you're just missing the python2-dev stuff
14:58 piojo_ joined #perl6
15:01 timotimo aha, they don't offer python2-config on windows
15:02 timotimo but it looks like all you need is -L to the Python/libs folder and then -lpython27 or what version you have
15:02 timotimo ryn1x_: ^
15:04 nhywyll joined #perl6
15:07 zakharyas joined #perl6
15:08 cdg joined #perl6
15:09 itaipu joined #perl6
15:10 ryn1x_ timotimo: I was trying to do something like that, but have not suceeded yet.. should I try to modify config.pl6, make file, or just do it all manually in the terminal to accomplish this?
15:11 timotimo i have no clue how Inline::Python builds its stuff; i'd look for the earliest place to change how it does stuff
15:11 mr-foobar joined #perl6
15:11 timotimo maybe find where it fails to find python2-config and substitute the right values there
15:11 ryn1x_ ok. thanks for pointing me in the right direction.
15:11 timotimo good luck!
15:12 timotimo i'll be afk soon
15:14 ryn1x joined #perl6
15:16 cdg joined #perl6
15:30 callyalater joined #perl6
15:44 ChoHag joined #perl6
15:47 sproctor Been playing about with Cro again for a REST API Aggregation layer. Really liking it. Now looking at a very unwritten slide deck and trying to work out what to write.
15:47 sproctor Hmmmm.
15:49 ryn1x joined #perl6
15:56 pecastro joined #perl6
15:56 wander m: my %seen of Int = (0 but role :: { method Str() {'NULL'} }); say Int.new(%seen<not-there>);
15:56 camelia rakudo-moar 2aaa32c96: OUTPUT: «Odd number of elements found where hash initializer expected:␤Only saw 1 element␤  in block <unit> at <tmp> line 1␤␤»
15:57 wander m: my %seen of Int is default(0 but role :: { method Str() {'NULL'} }); say Int.new(%seen<not-there>);
15:57 camelia rakudo-moar 2aaa32c96: OUTPUT: «0␤»
15:57 troys joined #perl6
15:58 wander is ^^ a new feature?
15:58 wander on my env it says "NULL"
15:58 wander This is Rakudo version 2017.07 built on MoarVM version 2017.07 implementing Perl 6.c.
15:58 Cabanossi joined #perl6
16:00 ugexe bisect: old=2017.07 my %seen of Int is default(0 but role :: { method Str() {'NULL'} }); say Int.new(%seen<not-there>);
16:00 bisectable6 ugexe, Bisecting by output (old=2017.07 new=2aaa32c) because on both starting points the exit code is 0
16:00 bisectable6 ugexe, bisect log: https://gist.github.com/2db30cea7a543be4b8ab5512b4bfb154
16:00 bisectable6 ugexe, (2017-09-19) https://github.com/rakudo/rakudo/commit/0834036dd436ac7372c8c0fe2f49511a4f5186dd
16:01 wander k
16:04 Herby_ joined #perl6
16:04 Herby_ o/
16:05 ilmari m: say Int.new(0 but role :: { method Str() {'NULL'} })
16:05 camelia rakudo-moar 2aaa32c96: OUTPUT: «0␤»
16:09 ugexe don't create a new Int
16:09 ugexe m: my %seen of Int is default(0 but role :: { method Str() {"NULL"} }); say %seen<not-there>.Int;
16:09 camelia rakudo-moar 2aaa32c96: OUTPUT: «NULL␤»
16:11 Geth ¦ doc: 9518b15910 | (Alex Chen)++ (committed using GitHub Web editor) | doc/Language/objects.pod6
16:11 Geth ¦ doc: add example about Pecking order
16:11 Geth ¦ doc:
16:11 Geth ¦ doc: and unify format, fix typo
16:11 Geth ¦ doc: review: https://github.com/perl6/doc/commit/9518b15910
16:11 synopsebot Link: https://doc.perl6.org/language/objects
16:15 wamba joined #perl6
16:17 setty1 joined #perl6
16:24 ryn1x joined #perl6
16:28 Kyo91_ joined #perl6
16:28 Cabanossi joined #perl6
16:29 zakharyas joined #perl6
16:36 nhywyll joined #perl6
16:42 ryn1x_ I can get Inline::Python to compile on windows now by manually adding the -I -L and -l, but the tests fail. Anyone see anything obvious for me to try? https://github.com/niner/Inline-Python/issues/27#issuecomment-339723621
16:46 number8 joined #perl6
16:47 number8 guys, what should be the "type" in a sub signature for an object that is a (Path)?
16:47 Xliff joined #perl6
16:47 Xliff \o
16:47 Xliff Getting an error from DBDish:
16:48 Xliff ===SORRY!=== Error while compiling /home/cbwood/projects/p6-webservice-eveo     nline/data/site#sources/4AC2B2490C5004AC37B710EF9240DBA21B048857 (DBDish::m     ysql::Native)
16:48 Xliff Can't use unknown trait 'is native' in a method declaration.
16:48 number8 is it sub my_sub(Path $filename) {...}?
16:48 Xliff Tried to update using zef, but zef says latest is already installed.
16:57 itaipu joined #perl6
16:57 ryn1x joined #perl6
16:57 sena_kun sub my_sub($filename) {...} is fine too.
16:57 sena_kun but you can use sub my_sub(IO::Path) {...}
16:57 sena_kun number8, ^^
16:58 sena_kun if this is what you want.
17:00 number8 sena_kun: Thanks!
17:04 zakharyas joined #perl6
17:06 Xliff m: enum RM <GET PUT HEAD DELETE>; RM::HEAD.say;
17:06 camelia rakudo-moar 2aaa32c96: OUTPUT: «HEAD␤»
17:09 ilmari joined #perl6
17:10 Xliff Uhh... Is this supposed to happen?
17:10 Xliff Unhandled exception: getexpayload needs a VMException, got P6opaque (X::AdHoc)
17:10 Xliff at SETTING::src/core/Exception.pm:395  (/home/cbwood/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm:print_exception)
17:10 Xliff from SETTING::src/core/Exception.pm:452  (/home/cbwood/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm:<anon>)
17:12 Xliff ^^ Occurring in stage parse.
17:20 AlexDaniel Xliff: can you try again with a clean setup?
17:28 Xliff AlexDaniel: Define "clean setup"
17:28 Xliff Dost that mean completely blowing away all existing modules and starting over?
17:30 AlexDaniel Xliff: well, this is not supposed to happen, but at the same time I don't know what we can do
17:31 AlexDaniel Xliff: but I was just wondering if you can't compile at all or if there's something else at play
17:31 Xliff So what precisely do I need to obtain a "clean setup">
17:32 Xliff rm -rf moar-nom/install/share ?
17:32 AlexDaniel ok, what commands are you using exactly? Or is that with rakudobrew?
17:32 Xliff rakudobrew
17:32 Xliff Please don't tell me "rm -rf ~/.rakudobrew" -- I'd cry.
17:32 AlexDaniel I think with rakudobrew you can do “rakudobrew nuke moar-nom” and that will nuke the whole thing
17:32 Xliff *sob*
17:33 AlexDaniel :( sorry
17:33 AlexDaniel maybe someone else will have a better suggestion
17:33 domidumont joined #perl6
17:34 Xliff And I just rakudobrew'd this morning.
17:34 [Coke] have you been building "moar-nom" ?
17:34 Xliff "rakudobrew build moar"
17:34 Xliff And now I need to reinstall all dependent modules. *sigh*
17:35 [Coke] yes, known issues with using rakudobrew to deploy a different version into the same rakudobrew build.
17:35 Xliff Well, I never "build moar-nom", just "moar"
17:36 [Coke] you could build moar-<sha>, or kill the current version and install a new one. You can tell zef before you do this to list all the installed modules and then use that list to re-install.
17:36 [Coke] Xliff: I think that's functionally the same.
17:36 [Coke] if you're not saying you want "this released version", I think you get "latest dev commit"
17:37 Xliff And "latest dev commit" was what I intended.
17:38 Xliff Fun. Stage parse in the build is over 90 seconds.
17:38 ryn1x joined #perl6
17:38 Rawriful joined #perl6
17:38 [Coke] https://gist.github.com/coke/c13e55d56c17fdf18b441a0bf9dba0b4 - based on something from zoffix
17:39 ugexe i think people usually want moar-blead, which includes nqp/moar at latest dev commit as well
17:39 [Coke] that's what I run instead of 'rakudobrew build nom'. Some of that probably isn't necessary, but I've had almost no problems since I cut over to using that.
17:40 [Coke] ugexe: I typically want the latest commit, not nqp=master and moar=master. but YMMV.
17:40 [Coke] er, the latest sha in the rakudo config
17:40 [Coke] basically, *i* only bump when rakudo does.
17:41 setty1 joined #perl6
17:44 Ven joined #perl6
17:48 Zoffix joined #perl6
17:51 Zoffix number8, FWIW, the reason you thought it's object "(Path)" is because you used `say` to dump it, which only shows the short-name. The full name is IO::Path and you can get it by using .^name method instead; e.g.:  $obj.^name.say.  You can also just use `IO` as the type for this type. It's shorter to write and includes IO::Special type that kinda-like-IO::Path
17:52 Zoffix I don't use rakudobrew on anything but my home dev box.
17:52 Zoffix huggable: sauce
17:52 huggable Zoffix, Install untested latest development version of Rakudo from source: https://github.com/zoffixznet/r#table-of-contents
17:52 Zoffix ^ that script does the job for me and is much faster to upgrade rakudo than with rakudobrew setup 'cause you don't need to re-install modules (or nuke anything)
17:54 Zoffix Xliff: "etting an error from DBDish"  Is that on latest rakudo?
17:56 wamba joined #perl6
18:05 Zoffix Grimy: for every DWIM there's a WAT. It's a bit unwanted that `1 != one <1 1 3>` is True but there's a much more common case: `1 != 1|3` which without tweaked semantics would always be True and be both rather confusing and useless
18:05 mson joined #perl6
18:07 Zoffix m: sub foo {}; foo :meow
18:07 camelia rakudo-moar 2aaa32c96: OUTPUT: «Unexpected named argument 'meow' passed␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
18:07 Zoffix wander: ^ that's how they produce errors
18:07 Zoffix in contrast, methods ignore nameds they don't recognize
18:08 wander got it
18:09 eroux joined #perl6
18:10 Zoffix m: class One { method meow (:$foo) { say "foo is $foo" } }; class Two is One { method meow { nextsame } }.new.meow: :foo'
18:10 camelia rakudo-moar 2aaa32c96: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3ethod meow { nextsame } }.new.meow: :foo7⏏5'␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤…»
18:10 Zoffix m: class One { method meow (:$foo) { say "foo is $foo" } }; class Two is One { method meow { nextsame } }.new.meow: :foo
18:10 camelia rakudo-moar 2aaa32c96: OUTPUT: «foo is True␤»
18:11 Zoffix Ignored so you could do stuff like that ^ without having to care about extra args one class might be taking or having to shovel args around just to keep it from crashing from unknown args a subclass might be taking
18:12 Zoffix piojo: did you sort out the DBIish issue? If not, what rakudo version are you on?
18:13 COMBORICO joined #perl6
18:14 Xliff Zoffix / AlexDaniel: "clean install" fixed everything.
18:14 Xliff Thanks.
18:14 Zoffix great
18:16 El_Che Does someone know if the random failing test after a succesful build is fixed on the upcoming release?
18:16 Zoffix El_Che: which test?
18:16 El_Che let me check the logs
18:18 Zoffix m: '/tmp/z4211'.IO.mkdir.add('Foo.pm6').spurt: 'constant z = Lock.new.condition'; use lib </tmp/z4211>; use Foo
18:18 camelia rakudo-moar 2aaa32c96: OUTPUT: «===SORRY!===␤Missing serialize REPR function for REPR ConditionVariable (Lock::ConditionVariable)␤»
18:18 El_Che Zoffix: https://travis-ci.org/nxadm/rakudo-pkg/jobs/290387896#L1551
18:18 Zoffix piojo: ^ that's one of the errors. Don't know if it makes sense to serialize that variable or what.
18:18 Zoffix Like chaging it from constant to `my` would fix it
18:19 Zoffix m: '/tmp/z4211'.IO.mkdir.add('Foo.pm6').spurt: 'my \z = Lock.new.condition'; use lib </tmp/z4211>; use Foo
18:19 camelia rakudo-moar 2aaa32c96: OUTPUT: «===SORRY!===␤Missing serialize REPR function for REPR ConditionVariable (Lock::ConditionVariable)␤»
18:19 Zoffix m: '/tmp/z4211'.IO.mkdir.add('Foo.pm6').spurt: 'my \z = Lock.new.condition'; use lib </tmp/z4211>; use Foo
18:19 camelia rakudo-moar 2aaa32c96: OUTPUT: «===SORRY!===␤Missing serialize REPR function for REPR ConditionVariable (Lock::ConditionVariable)␤»
18:19 Zoffix ok then :P
18:20 Zoffix Well, I think it'd fix it and just my eval sucks
18:23 Zoffix El_Che: yeah, I think that's fixed. Haven't seen any floppers in make test recently
18:24 El_Che Zoffix: great to hear. I had someone send a PR, test failed so he thinked his PR is faulty :)
18:24 El_Che just rerun the test :)
18:25 Zoffix El_Che: looks like Oct 6 is the last time nativecall tests flopped: https://irclog.perlgeek.de/perl6-dev/search/?nick=buggable&amp;q=travis
18:26 El_Che I'll be happy to see the new release then :)
18:26 Zoffix Yeah, it's a good realease :) Lots of work
18:27 Zoffix m: use nqp; nqp::getcomp("perl6").version
18:27 camelia rakudo-moar 2aaa32c96: OUTPUT: «This is Rakudo version 2017.09-522-g2aaa32c96 built on MoarVM version 2017.09.1-621-g27f91344c␤implementing Perl 6.c.␤»
18:27 Zoffix c: 2017.09~1 nqp::getcomp("perl6").version
18:27 committable6 Zoffix, ¦2017.09~1: «===SORRY!=== Error while compiling /tmp/SzxKFCeEvM␤Could not find nqp::getcomp, did you forget 'use nqp;' ?␤at /tmp/SzxKFCeEvM:1␤------> nqp::getcomp("perl6")⏏.version «exit code = 1»»
18:27 Zoffix c: 2017.09~1 use nqp; nqp::getcomp("perl6").version
18:27 committable6 Zoffix, ¦2017.09~1: «This is Rakudo version 2017.08-174-gb4ba33af4 built on MoarVM version 2017.09.1␤implementing Perl 6.c.»
18:28 Zoffix ~174 commits in past reelease; 522 commits this release :) Even more on MoarVM; 2 years of work in the for of new JIT backened were merged
18:28 Ven_ joined #perl6
18:29 chakli joined #perl6
18:30 AlexDaniel everyone++
18:30 Herby_ \o
18:30 Zoffix \o
18:31 cdg_ joined #perl6
18:31 Khisanth joined #perl6
18:35 cdg joined #perl6
18:44 ryn1x joined #perl6
18:47 chakli_ joined #perl6
18:48 chakli left #perl6
18:49 chakli_ left #perl6
18:53 Aceeri joined #perl6
18:54 lowin I'm starting out with learning perl6, but many popular editors seem to be lacking perl6 support. Is there a recommended gui editor out there? Preferably with autocomplete support.
18:54 Zoffix huggable: atom ide
18:54 huggable Zoffix, https://github.com/perl6/Atom-as-a-Perl6-IDE
18:54 Zoffix lowin: unsure about autocompletion.
18:55 moritz vim!
18:55 moritz dunno about autocompletion as well :-)
18:55 moritz also: visual studio code with https://github.com/sergot/vscode-perl6
18:56 Aceeri Is there a way to get a better "backtrace/stacktrace" than this? https://pastebin.com/raw/cfErskyF
18:56 ChoHag joined #perl6
18:56 moritz Aceeri: this looks very much like a Perl 5 warning. Please try #perl
18:56 Aceeri Ah whoops, sorry
18:57 lowin Zoffix, moritz, Alright I'll give atom and vs code a try. Thank you.
18:57 AlexDaniel huggable: editors
18:57 huggable AlexDaniel, There is a list of editors and IDEs usable with perl6 here: https://perl6.org/whatever/
18:57 AlexDaniel lowin: ↑
19:15 Ven joined #perl6
19:17 Zoffix piojo: managed to repro your DBIish issue, but failing to golf it down for now. I get the "This type (NQPMu) does not support associative operations" when this condition is met: I call DBIish.connect with wrong args; then fix the error and try running the script again. And the mu error remains until you blow away the precomp
19:17 Zoffix |2h try DBIish golf: https://github.com/zoffixznet/debug/tree/master/dbiish https://irclog.perlgeek.de/perl6/2017-10-26#i_15355892
19:17 ZofBot Zoffix, Will remind you on 2017-10-26T17:17:35.340511-04:00 about try DBIish golf: https://github.com/zoffixznet/debug/tree/master/dbiish https://irclog.perlgeek.de/perl6/2017-10-26#i_15355892
19:17 * Zoffix &
19:17 Zoffix left #perl6
19:17 moritz sounds like a rakudo bug
19:17 timotimo are you perchance trying to precompile a db connection?
19:18 moritz that won't work
19:18 AlexDaniel wasn't it already explained in https://github.com/perl6/DBIish/issues/106 ?
19:19 rindolf hi all
19:19 AlexDaniel o/
19:19 rindolf i noticed i had fewer difficulties porting a py euler program to perl 6 this time around
19:20 Thrush joined #perl6
19:20 Herby_ \o
19:21 Thrush Hi!  I've got some questions for Perl 6.  Here's one:  If I have a string (say, "Hello"), how do I separate it into a list of characters?
19:21 Juerd Thrush: "Hello".comb
19:21 Herby_ m: "Hello".comb
19:21 camelia rakudo-moar 2aaa32c96: ( no output )
19:21 Herby_ m: say "Hello".comb
19:21 camelia rakudo-moar 2aaa32c96: OUTPUT: «(H e l l o)␤»
19:21 Thrush Excellent!  Thank you!
19:22 Thrush m: say 'Hello, World!'.comb
19:22 camelia rakudo-moar 2aaa32c96: OUTPUT: «(H e l l o ,   W o r l d !)␤»
19:22 Juerd Thrush: For inspiration: https://docs.perl6.org/type/Str
19:22 Thrush Here's another question:  If I have an object/class (like "Hello"), is there a way I can list all of its methods?  (Kind of like "Hello".methods.sort in Ruby.)
19:23 Herby_ m: "abcdefghijk".comb(3).perl
19:23 camelia rakudo-moar 2aaa32c96: ( no output )
19:23 Herby_ m: say "abcdefghijk".comb(3).perl
19:23 camelia rakudo-moar 2aaa32c96: OUTPUT: «("abc", "def", "ghi", "jk").Seq␤»
19:24 bdmatatu m: say "Hello".^methods
19:24 camelia rakudo-moar 2aaa32c96: OUTPUT: «(BUILD Capture Int Num chomp starts-with ends-with substr-eq contains indices index rindex pred succ comb match subst-mutate subst ords lines parse-base parse-names samecase samemark samespace word-by-word trim-leading trim-trailing trim words encode …»
19:24 Thrush Nice!  Thank you! .^methods works great!
19:24 El_Che I hope to make it easier to download the latest rakudo release by using github pages, next to the releases tab, eg. : https://nxadm.github.io/rakudo-pkg/latest-release.html?os=ubuntu&amp;version=17.04&amp;arch=amd64
19:24 Juerd Thrush: Getting a list of methods is mostly useful when you're learning the language. And I think the documentation is a better starting point than a bare list :)
19:26 Ven_ joined #perl6
19:26 Thrush Okay, another question:  Is there some sort of in-interpreter help system that I can get documentation at my fingertips?  Like help(String.comb) -- similar to what I can do in Python.
19:26 El_Che and the checksum as well: https://nxadm.github.io/rakudo-pkg/latest-release-checksum.html?os=ubuntu&amp;version=17.04&amp;arch=amd64
19:27 Juerd Thrush: No. But there's https://doc.perl6.org/
19:28 AlexDaniel m: say Str.WHY
19:28 camelia rakudo-moar 2aaa32c96: OUTPUT: «No documentation available for type 'Str'.␤Perhaps it can be found at https://docs.perl6.org/type/Str␤»
19:29 Juerd Thrush: Please reply in the channel instead of privately :)
19:29 Juerd Also, you're welcome :)
19:30 Thrush Another question:  I learned that I can do:  my @a = lazy 1 .. 10; to create a lazy list.  But once I do that, it's always hidden from me until I traverse it.  (That is, when I type "@a" I see "[...]".  My question is:  Can I "un-lazify" @a so that it shows the numbers from 1 to 10?  Sort of like this in Python:  a = list(a)
19:31 Thrush Oh, sorry about replying privately.  I thought you were talking to me in private, so I thought I was replying in kind.
19:31 Juerd Thrush: Nah, I'm just beginning lines with your name :)
19:31 AlexDaniel m: my @a = lazy 1 .. 10; say eager @a
19:31 camelia rakudo-moar 2aaa32c96: OUTPUT: «[1 2 3 4 5 6 7 8 9 10]␤»
19:31 AlexDaniel Thrush: maybe you want “eager”
19:32 Juerd Note that either @a.eager or eager @a will work
19:32 Juerd Or @a.eager() or eager(@a) if you like parentheses
19:32 Thrush That's great, AlexDaniel and Juerd.  That answers my question perfectly.
19:33 AlexDaniel Thrush: also, if that's just for debugging, maybe dd can give you better results
19:33 AlexDaniel m: my @a = lazy 1 .. 10; dd @a
19:33 camelia rakudo-moar 2aaa32c96: OUTPUT: «Array @a = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10... lazy list)␤»
19:33 Thrush I've been searching for a while for those answers, and I couldn't find it anywhere, not even on StackOverflow.
19:34 AlexDaniel Thrush: if there are any specific pages on https://docs.perl6.org/ where you expected this information, we can improve the docs
19:34 Thrush What's "dd", and where can I read about it?
19:34 Thrush "dd" is for debugging, I assume.
19:34 AlexDaniel Thrush: https://docs.perl6.org/programs/01-debugging#Dumper_function_dd
19:35 epony joined #perl6
19:37 setty1 joined #perl6
19:39 callyalater left #perl6
19:41 Herby_ are there any good examples or libraries that I can look at for functional programming in perl 6?
19:43 Thrush Okay, another question:  Is there native support to have a Perl6 program to detect a keyboard press without having to press ENTER?
19:44 Cabanossi joined #perl6
19:47 Thrush I searched on https://modules.perl6.org/ for "keypress", but I couldn't find anything.  Is there any way I can read a keypress (without hitting ENTER) using Perl 6?
19:48 darkmorph joined #perl6
19:50 Thrush As for https://docs.perl6.org , I wouldn't mind seeing mention of "eager" on the "lazy" page at https://docs.perl6.org/routine/lazy .  Even if it's just a footnote like 'See also "eager".'
19:51 perlpilot joined #perl6
19:51 Thrush And for that matter, it would be good if the "eager" page ( https://docs.perl6.org/routine/eager ) had a link to "lazy".  Just by reading the "eager" page, I would not make the connection that "eager" 'undoes' "lazy".
19:54 Thrush In Perl 6, are there functions/methods similar to Perl5's ucfirst() and lcfirst() ?  All I see is tclc(), which is nice, but not exactly like ucfirst() and lcfirst() .
19:57 thundergnat joined #perl6
19:57 AlexDaniel m: say ‘hello’.tc
19:57 camelia rakudo-moar 2aaa32c96: OUTPUT: «Hello␤»
19:58 thundergnat Thrush: re read from keyboard without enter, Term::termios may do what you need. See http://rosettacode.org/wiki/2048#Perl_6 for an example.
19:58 Ven joined #perl6
19:58 Thrush If I create a function that uses gather/take, I notice that the returned list won't be lazy unless it is called (by the caller code) with the lazy keyword.  My question is:  Is there any way to force the return value to be a lazy list, even if the caller does not use the "lazy" keyword?
20:00 Thrush Thanks, thundergnat.  According the Rosettacode page, it's only going to work on POSIX terminals.  Is there a way I can do it under Windows platforms as well?
20:01 jnthn Thrush: Can just make it lazy in the sub too
20:01 jnthn lazy gather { ... }
20:05 Thrush jnthn:  Huh... It never occurred to me to do that.  Thanks!
20:07 Thrush What's the best way to make a deep copy of something?  Like, say, a list of lists of lists.
20:11 Thrush How can I see the type/class of an object?  I'm looking for something like:  "hello".class() or (5).type()
20:11 sena_kun m: say 'boom'.^name
20:12 camelia rakudo-moar 2aaa32c96: OUTPUT: «Str␤»
20:12 sena_kun m: say 1.^name
20:12 camelia rakudo-moar 2aaa32c96: OUTPUT: «Int␤»
20:12 sena_kun Thrush, ^
20:14 Cabanossi joined #perl6
20:17 Herby_ whats a good Perl 6 way to count how many times the word "Sam" appears in $string?
20:17 Herby_ a functional way
20:17 Thrush sena_kun:  Thanks!  'hello'.^name works great.  I notice that there are a lot of methods that begin with "^", but they don't show up when I type "Hello".^methods .  Is there any way for me to see them?
20:19 Thrush Herby_:  Will this do?  'Hello, mellow fellow'.comb('llo').elems  # returns 3
20:19 Thrush m: 'Hello, mellow fellow'.comb('llo').elems
20:19 camelia rakudo-moar 2aaa32c96: ( no output )
20:20 Herby_ m: say "This is a Sam string, count the Sam".comb('Sam').elems
20:20 camelia rakudo-moar 2aaa32c96: OUTPUT: «2␤»
20:20 Herby_ that works. thanks!
20:20 Thrush m: 'Hello, mellow fellow'.comb('llo').elems.say
20:20 camelia rakudo-moar 2aaa32c96: OUTPUT: «3␤»
20:21 sena_kun Thrush, well, these methods are related to meta-object protocol, so I am not the best person to ask, but you can refer to https://docs.perl6.org/language/mop.html for general knowledge. As for methods, you can refer to https://docs.perl6.org/type/Metamodel::ClassHOW
20:21 Thrush Thanks, sena_kun
20:21 sena_kun about showing on on tab completion, if you asked about it, it probably wants(or not) an issue.
20:22 sena_kun s/on on/it on/
20:22 ryn1x joined #perl6
20:23 cdg joined #perl6
20:24 jnthn Thrush: $obj.^foo is actually $obj.HOW.foo($obj) - that is, shorthand for doing a call on the meta-object. So the methods you call with .^ are not on the object itself, but on the meta-object
20:25 TEttinger joined #perl6
20:31 cdg joined #perl6
20:37 Geth ¦ doc: 7ojo++ created pull request #1633: Added Dockerfile and instructions to CONTRIBUTING.md
20:37 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1633
20:38 El_Che in bash, there is a -o pipefail option. Does the perl 6 shell function have something similar? (pipefail: error exit status of command before a pipe not overwriiten by later success)
20:39 El_Che (workaround would be bash -c ...
20:49 Geth ¦ doc/master: 5 commits pushed by (Jarkko Haapalainen)++
20:49 Geth ¦ doc/master: 5a49f8b0e6 | IO::Socket::Async server example using heredoc
20:49 Geth ¦ doc/master: 51d9ff54d4 | IO::Socket::Async client example tweaks
20:49 Geth ¦ doc/master: e3783e4cba | Merge remote-tracking branch 'upstream/master'
20:49 Geth ¦ doc/master: 512f572f61 | Added Dockerfile and instructions to CONTRIBUTING.md
20:49 Geth ¦ doc/master: c41ff477ac | Merge pull request #1633 from 7ojo/master
20:49 Geth ¦ doc/master: review: https://github.com/perl6/doc/compare/9518b15910...c41ff477ac
20:57 obra joined #perl6
21:03 ryn1x joined #perl6
21:07 tojo joined #perl6
21:14 Cabanossi joined #perl6
21:14 Geth ¦ mu: 59567e2d49 | (Zoffix Znet)++ (committed using GitHub Web editor) | misc/perl6advent-2017/schedule
21:14 Geth ¦ mu: Change post I'm gonna write
21:14 Geth ¦ mu:
21:14 Geth ¦ mu: Thought about it and don't think I'd write anything that's
21:14 Geth ¦ mu: actually interesting to read for the original article idea.
21:14 Geth ¦ mu: review: https://github.com/perl6/mu/commit/59567e2d49
21:18 Thrush Question:  How can I type the "∈" character (in: say so 'bar' ∈ @a;) on a keyboard that doesn't have that character?  I tried "say so 'bar' elem @a;" but that's giving me an error.
21:21 ryn1x joined #perl6
21:21 Thrush m: say so 'bar' ∈ @a;
21:21 camelia rakudo-moar 2aaa32c96: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '@a' is not declared␤at <tmp>:1␤------> 3say so 'bar' ∈ 7⏏5@a;␤»
21:21 geekosaur m: my @a = <a b c d>; say so 'c' (elem) @a
21:21 camelia rakudo-moar 2aaa32c96: OUTPUT: «True␤»
21:21 espadrine joined #perl6
21:21 geekosaur the parens are part of the operator name
21:21 Thrush m: @a = <foo bar>; say so 'bar' ∈ @a;
21:21 camelia rakudo-moar 2aaa32c96: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '@a' is not declared␤at <tmp>:1␤------> 3<BOL>7⏏5@a = <foo bar>; say so 'bar' ∈ @a;␤»
21:22 margeas joined #perl6
21:23 geekosaur how you'd type in the Unicode one depends on OS (and on Linux may depend on your windowing/desktop environment)
21:23 geekosaur https://docs.perl6.org/language/unicode_entry
21:25 Thrush The page https://docs.perl6.org/language/unicode_entry says that the ascii equivalent of "∈" is "elem", but I substitute "elem" and I see it doesn't work.
21:25 geekosaur it says the equivalent is (elem)
21:25 geekosaur the parens are *part of the name*
21:25 Thrush Oh!  I gotta use the parentheses!
21:25 geekosaur (in general perl 6 uses operators wrappedin parens for 'set-like' operators)
21:26 geekosaur I even showed it earlier
21:26 geekosaur [26 21:21:26] <geekosaur> m: my @a = <a b c d>; say so 'c' (elem) @a
21:27 Thrush I'm surprised (and embarrassed) that I didn't realize that they (the parentheses) were needed (for the ∈ operator).  Wow!  (Thanks for your help, geekosaur!)
21:27 ryn1x joined #perl6
21:27 geekosaur it could stand being made more obvious
21:28 geekosaur but I'm not sure how you;d do that; perl 6's flexibility means it allows thinngs like that, but unles syou already know how perl 6 'works' you are likely to miss the point
21:28 geekosaur especially if you;re coming to it from a lnaguage like Haskell where () around an operator means you re talking about it as a function, or etc.
21:29 geekosaur maybe a column for a short example
21:30 Thrush Well, there are examples that use the '∈' operator.  It wouldn't hurt to have the exact same example by each one, with the only difference being that (elem) is used.
21:31 [Coke] in general, we don't want to list every way to do it on every example.
21:32 AlexDaniel any ideas for the next squashathon?
21:33 AlexDaniel no repo was chosen yet
21:33 evalable6 joined #perl6
21:33 AlexDaniel squashable6: next
21:33 squashable6 AlexDaniel, Next SQUASHathon in 7 days and ≈12 hours (2017-11-04 UTC-12⌁UTC+14). See https://github.com/rakudo/rakudo/wiki/Monthly-Bug-Squash-Day
21:33 Thrush Is there a way to force a string to an int?  Like maybe "123".int()
21:33 AlexDaniel m: say "123".Int
21:33 camelia rakudo-moar 2aaa32c96: OUTPUT: «123␤»
21:33 Thrush Also, is there a way to test a string to see if it looks like an int or a float?
21:33 [Coke] m: say +"123"
21:33 camelia rakudo-moar 2aaa32c96: OUTPUT: «123␤»
21:34 [Coke] m: say (+"123").^name
21:34 camelia rakudo-moar 2aaa32c96: OUTPUT: «Int␤»
21:34 AlexDaniel [Coke]: that's not guaranteed to be an Int tho
21:34 niceperl joined #perl6
21:34 geekosaur m: say ?"123a".Int
21:34 camelia rakudo-moar 2aaa32c96: OUTPUT: «False␤»
21:34 [Coke] m: +"borf"
21:34 camelia rakudo-moar 2aaa32c96: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "+" in expression "+\"borf\"" in sink context (line 1)␤Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5borf' (indicated by ⏏)␤  in block <unit> at <tmp> line 1…»
21:34 geekosaur m: say ?"123".Int
21:34 camelia rakudo-moar 2aaa32c96: OUTPUT: «True␤»
21:35 [Coke] AlexDaniel: no, but there's what he's asking and what he needs. Yes, + gives you a numeric value back, not necessarily an Int.
21:35 AlexDaniel :)
21:35 Thrush m: say ?"123.4".Int
21:35 camelia rakudo-moar 2aaa32c96: OUTPUT: «True␤»
21:35 [Coke] s/he/they/ oops
21:35 [Coke] the ? is checking if the numeric value is true
21:36 [Coke] m: say ?"0".Int
21:36 camelia rakudo-moar 2aaa32c96: OUTPUT: «False␤»
21:36 geekosaur hm, point, it goes further than just translating the Failure
21:36 Thrush m: ?"0.0".Int()
21:36 camelia rakudo-moar 2aaa32c96: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "?" in expression "?\"0.0\".Int()" in sink context (line 1)␤»
21:36 AlexDaniel m: .say with "0".Int
21:36 camelia rakudo-moar 2aaa32c96: OUTPUT: «0␤»
21:36 Thrush m: say ?"0.0".Int()
21:36 camelia rakudo-moar 2aaa32c96: OUTPUT: «False␤»
21:36 AlexDaniel m: .say with "abc".Int
21:36 camelia rakudo-moar 2aaa32c96: ( no output )
21:37 ryn1x joined #perl6
21:40 Thrush "abc".Int throws an exception, I think.  Is there a way I can have it just return Nil?
21:40 AlexDaniel m: say try "abc".Int
21:40 camelia rakudo-moar 2aaa32c96: OUTPUT: «Nil␤»
21:41 Thrush I know in Ruby I can say:  n = Integer('4') rescue nil
21:42 Thrush Okay, 'try "abc".Int' seems to work.  But it also works for 'try "4.75".Int' (which evaluates to 4).  Is there anyway I can detect that '4.75' is not an Int?
21:43 AlexDaniel m: say try +"abc"
21:43 camelia rakudo-moar 2aaa32c96: OUTPUT: «Nil␤»
21:43 AlexDaniel m: my $x = try +"4.75"; say $x.WHAT
21:43 camelia rakudo-moar 2aaa32c96: OUTPUT: «(Rat)␤»
21:43 AlexDaniel m: my $x = try +"4.75"; say $x ~~ Int
21:43 camelia rakudo-moar 2aaa32c96: OUTPUT: «False␤»
21:43 AlexDaniel m: my $x = try +"4.0"; say $x ~~ Int
21:43 camelia rakudo-moar 2aaa32c96: OUTPUT: «False␤»
21:43 AlexDaniel m: my $x = try +"4"; say $x ~~ Int
21:43 camelia rakudo-moar 2aaa32c96: OUTPUT: «True␤»
21:44 ryn1x joined #perl6
21:46 Thrush That works, AlexDaniel.  Thanks.
21:51 setty1 joined #perl6
21:55 Thrush m: 'hello'.say ; 'hello'.put  # What's the difference between .put() and .say() ?
21:55 camelia rakudo-moar 2aaa32c96: OUTPUT: «hello␤hello␤»
21:56 geekosaur .put invokes .Str, .say invokes .gist
21:56 Thrush Thanks, geekosaur.
21:58 Cabanossi joined #perl6
21:59 cdg joined #perl6
21:59 Thrush I like the "once" block (as documented in https://docs.perl6.org/language/control#once ).  Is there a convenient way to do the opposite, as in do something everytime EXCEPT for the first time?
22:00 ugexe m: sub foo { if $++ { say 42 } }; foo(); foo(); foo()
22:00 camelia rakudo-moar 2aaa32c96: OUTPUT: «42␤42␤»
22:00 Geth ¦ doc: db2e07bfb7 | (Jarkko Haapalainen)++ | doc/Type/Proc/Async.pod6
22:00 Geth ¦ doc: Added example on piping with Proc::Async (refs #1580)
22:00 Geth ¦ doc:
22:00 Geth ¦ doc: Note that methods .bind-stdin, .bind-stdout and .bind-stderr still needs
22:00 Geth ¦ doc: documentation.
22:00 synopsebot Link: https://doc.perl6.org/type/Proc/Async
22:00 Geth ¦ doc: review: https://github.com/perl6/doc/commit/db2e07bfb7
22:02 ugexe m: sub foo { if (state $foo += 1) > 1 { say 42 } }; foo(); foo(); foo(); # expanded to show you what its doing
22:02 camelia rakudo-moar 2aaa32c96: OUTPUT: «42␤42␤»
22:03 ryn1x joined #perl6
22:05 Thrush I don't think a state variable is what I'm looking for.  I'm looking for something more like an else-part of a once-statement.
22:06 geekosaur 'once is actually a bit hacky and has enough gotchas that it's often not what you want; state variables are more likely to give you the expected behavior
22:07 geekosaur if $++ { #`{ first time } } else { #`{ other times } }
22:08 Thrush Sure, but I want them to reset the next time I call the code they're in.
22:08 ugexe its a state var, you can control that with whatever level of closure clone
22:09 Thrush I want to do something like this:  for 1 .. 5 { my $sep = ' '; once {$sep=''}; print $sep; .print }; say ''
22:09 Thrush m: for 1 .. 5 { my $sep = ' '; once {$sep=''}; print $sep; .print }; say ''
22:09 camelia rakudo-moar 2aaa32c96: OUTPUT: «1 2 3 4 5␤»
22:09 ugexe well for a loop i would use FIRST to do that
22:10 Thrush So many coders do it like this instead:  for 1 .. 5 { .print; print ' ' }; say ''
22:10 Thrush m: for 1 .. 5 { .print; print ' ' }; say ''
22:10 camelia rakudo-moar 2aaa32c96: OUTPUT: «1 2 3 4 5 ␤»
22:10 Thrush Note the space after the 5.
22:10 AlexDaniel why not .join ?
22:11 ugexe m: for 1..5 { KEEP " ".print; .print; }
22:11 camelia rakudo-moar 2aaa32c96: OUTPUT: «12345»
22:11 ugexe hm
22:11 Thrush No .join, because it's in a loop that's reporting info by printing.
22:12 AlexDaniel I see
22:12 ugexe i expected .print; to fire the KEEP
22:13 AlexDaniel m: for 1 .. 5 { print ' ' if $++; .print };
22:13 camelia rakudo-moar 2aaa32c96: OUTPUT: «1 2 3 4 5»
22:13 ugexe m: for 1..5 { KEEP " ".print; .print; 0; }
22:13 camelia rakudo-moar 2aaa32c96: OUTPUT: «WARNINGS for <tmp>:␤1 2 3 4 5 Useless use of constant integer 0 in sink context (line 1)␤»
22:13 Thrush Basically, I want something like:  for 1 .. 5 { not_the_first_time {print ' '}; .print }; say ''
22:15 Thrush Where can I read about FIRST ?
22:15 AlexDaniel https://docs.perl6.org/language/phasers
22:16 Thrush Ah!  Found it here:  https://docs.perl6.org/language/phasers#phasers_FIRST
22:16 ugexe m: sub foo { for 1..5 { if $++ { say $_ } } }; foo(); foo(); foo(); # $++ works like you want
22:16 camelia rakudo-moar 2aaa32c96: OUTPUT: «2␤3␤4␤5␤2␤3␤4␤5␤2␤3␤4␤5␤»
22:19 Thrush ugexe:  Apparently you're right.  But if $ is a state variable, shouldn't we have to decrement it (back to 0) for it to work the next time?
22:20 ugexe its state is per closure clone
22:20 Thrush That is, shouldn't $ keep its state across calls to foo() ?
22:21 Thrush I guess I don't know what a closure clone is.
22:21 ugexe its a state variable of for { }, not foo { } essentially
22:27 Thrush Well, thanks.  It appears to work for what I need:  for 1 .. 5 { print ' ' if $++; .print }; say ''
22:27 Thrush m: for 1 .. 5 { print ' ' if $++; .print }; say ''
22:27 camelia rakudo-moar 2aaa32c96: OUTPUT: «1 2 3 4 5␤»
22:29 itaipu joined #perl6
22:30 Thrush When I do "[].^methods", I'd like to see the methods in sorted order.  But this doesn't work:  say [].^methods.sort
22:30 Thrush m: say [].^methods.sort
22:30 camelia rakudo-moar 2aaa32c96: OUTPUT: «Method object coerced to string (please use .gist or .perl to do that)␤  in block <unit> at <tmp> line 1␤Method object coerced to string (please use .gist or .perl to do that)␤  in block <unit> at <tmp> line 1␤Method object coerced to string (…»
22:31 MasterDuke m: say [].^methods.sort(*.name)
22:31 camelia rakudo-moar 2aaa32c96: OUTPUT: «(ACCEPTS Method+{is-nodal}.new Method+{is-nodal}.new Method+{is-nodal}.new Method+{is-nodal}.new BIND-POS BIND-POS BUILDALL BUILDALL Method+{is-nodal}.new Method+{is-nodal}.new Bool CALL-ME Capture Method+{is-nodal}.new Method+{is-nodal}.new FLATTENAB…»
22:32 AlexDaniel m: say [].^methods.sort(*.name.fc)
22:32 camelia rakudo-moar 2aaa32c96: OUTPUT: «(ACCEPTS Method+{is-nodal}.new Method+{is-nodal}.new append Method+{is-nodal}.new Method+{is-nodal}.new Method+{is-nodal}.new Method+{is-nodal}.new Method+{is-nodal}.new Method+{is-nodal}.new BIND-POS BIND-POS Bool BUILDALL BUILDALL CALL-ME Capture cl…»
22:33 AlexDaniel there's a ticket for that actually
22:33 AlexDaniel RT#132290
22:33 synopsebot RT#132290 [new]: https://rt.perl.org/Ticket/Display.html?id=132290 [LTA] .gist of a Method does not always show the its .name  (.say for <a b c>.^methods)
22:34 jnthn m: say [].^methods.sort(*.name.fc).map(*.name)
22:34 camelia rakudo-moar 2aaa32c96: OUTPUT: «(ACCEPTS antipairs append append Array ASSIGN-POS AT-POS AT-POS Bag BagHash BIND-POS BIND-POS Bool BUILDALL BUILDALL CALL-ME Capture clone combinations default DELETE-POS dynamic eager elems end EXISTS-POS flat flat FLATTENABLE_HASH FLATTENABLE_LIST F…»
22:37 ryn1x joined #perl6
22:48 Zoffix joined #perl6
22:49 Zoffix There should be anotehr ticket for it too. I remember debugging this
22:49 Thrush Is there a Perl6 way to iterate through a list and apply some code to each element, in a non-map way?  Kind of like this in Ruby:  (1..5).each {|n| puts n}
22:49 Thrush I can do this:  (1..5).map: {.say}
22:50 Thrush m: (1..5).map: {.say}
22:50 camelia rakudo-moar 2aaa32c96: OUTPUT: «1␤2␤3␤4␤5␤»
22:50 Thrush but it uses map() instead of each()
22:50 Zoffix m: .put for 1..5
22:50 jnthn Why do you need a non-map way?
22:50 camelia rakudo-moar 2aaa32c96: OUTPUT: «1␤2␤3␤4␤5␤»
22:50 Thrush It sort of does what I want, but I'd rather not map() it, if I can get away with just each()ing each element.
22:51 Thrush Doesn't map() construct a new Array/List?
22:51 jnthn Not in sink (void) context, no
22:51 jnthn Now I understand why you were asking though :)
22:52 AlexDaniel El_Che: :)
22:52 Zoffix Ah RT#132149
22:52 synopsebot RT#132149 [new]: https://rt.perl.org/Ticket/Display.html?id=132149 [BUG] Some Method objects use wrong .gist method
22:52 Thrush Thanks, jnthn.
22:53 Thrush Is there a way to grep() through a list, knowing each element's index in the list?  Kind of like Ruby's each_with_index, or map.with_index
22:53 mson joined #perl6
22:54 AlexDaniel m: say <a b c d>.grep(‘c’, :kv)
22:54 camelia rakudo-moar e6c6ed2b5: OUTPUT: «(2 c)␤»
22:54 AlexDaniel m: say <a b c d c z>.grep(‘c’, :kv)
22:54 camelia rakudo-moar e6c6ed2b5: OUTPUT: «(2 c 4 c)␤»
22:54 AlexDaniel or
22:54 AlexDaniel m: say <a b c d c z>.grep(‘c’, :p)
22:54 camelia rakudo-moar e6c6ed2b5: OUTPUT: «(2 => c 4 => c)␤»
22:54 AlexDaniel or just :k also
22:56 AlexDaniel m: say (for 1..5 { $_ * 100 })
22:56 camelia rakudo-moar e6c6ed2b5: OUTPUT: «(100 200 300 400 500)␤»
22:56 Zoffix m: <a b c d>.kv.grep: { $^v eq "c" or next; say "Got $v at index $^i" }
22:56 camelia rakudo-moar e6c6ed2b5: OUTPUT: «Got c at index 2␤»
22:56 Zoffix left #perl6
22:56 jnthn Or if you want the index inside of the map, then:
22:56 jnthn m: ('a'..'g').kv.map: -> $idx, $val { say "$val is at $idx" }
22:56 camelia rakudo-moar e6c6ed2b5: OUTPUT: «a is at 0␤b is at 1␤c is at 2␤d is at 3␤e is at 4␤f is at 5␤g is at 6␤»
22:59 Thrush Say I have a list of strings, and I want to .grep/.map them so that I return only the strings at even-numbered indeces.  How would I do that?
22:59 Thrush I tried:  say <a b c d>.kv.grep: -> $k,$v {$k %% 2} .map: {$_[1]}
22:59 Thrush m: say <a b c d>.kv.grep: -> $k,$v {$k %% 2} .map: {$_[1]}
22:59 camelia rakudo-moar e6c6ed2b5: OUTPUT: «()␤»
23:00 Thrush but for some reason it's returning an empty list.
23:00 ugexe m: say <a b c d>.kv.grep(-> $k,$v {$k %% 2}).map: {$_}
23:00 camelia rakudo-moar e6c6ed2b5: OUTPUT: «((0 a) (2 c))␤»
23:01 jnthn tbh, I'd just use the $++ %% 2 anon state-var trick for that
23:02 jnthn But to do it the .kv way would be something like .map: -> $, $v { $v } to discard the indexes
23:02 Thrush "say <a b c d>.kv.grep(-> $k,$v {$k %% 2}).map: {$_}" looks good, but I don't want the index, just the element.
23:02 jnthn May be neater to do .pairs.grep(*.key %% 2).map(*.value)
23:02 ugexe you can do $_[1] still, it wasn't working before because of the grep missing ( )
23:02 jnthn Sleep time for me. o/
23:03 Thrush m: say <a b c d>.kv.grep(-> $k,$v {$k %% 2}).map: {$_[1]}
23:03 camelia rakudo-moar e6c6ed2b5: OUTPUT: «(a c)␤»
23:03 Thrush Okay, I think that worked.  Apparently I had to use the () form for the grep (instead of the : form).
23:04 ugexe it fixes what .map gets called on
23:04 BenGoldberg joined #perl6
23:08 ryn1x joined #perl6
23:13 Kyo91_ joined #perl6
23:20 timotimo m: .say for <a b c d e f g>.rotor(1 => 1)
23:20 camelia rakudo-moar b07e7b1d0: OUTPUT: «(a)␤(c)␤(e)␤(g)␤»
23:21 timotimo Thrush: with : it'll put everything until the end of the line as the arguments to what you put the : in front of, so if you wanted to do something more with the result you'll either have to put () around the whole thing (so you can still use the : form) or use .method(foo) form instead
23:25 ryn1x joined #perl6
23:33 cpage_ joined #perl6
23:47 ryn1x joined #perl6
23:49 Geth ¦ evalbot: b74b19f122 | (Aleks-Daniel Jakimenko-Aleksejev)++ | 4 files
23:49 Geth ¦ evalbot: “nom” → “master” tweak
23:49 Geth ¦ evalbot:
23:49 Geth ¦ evalbot: Removes mentions of “nom”. Basically, this was not needed because it
23:49 Geth ¦ evalbot: is using the default branch anyway. But we will not need “nom”
23:49 Geth ¦ evalbot: shortcut anymore so it can be named “master” instead.
23:49 Geth ¦ evalbot:
23:49 Geth ¦ evalbot: This commit also removes two parrot scripts.
23:49 Geth ¦ evalbot: review: https://github.com/perl6/evalbot/commit/b74b19f122
23:52 darkmorph joined #perl6
23:56 ryn1x joined #perl6

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

Perl 6 | Reference Documentation | Rakudo