Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-09-23

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:08 Zoffix .oO( ? ? ohhh teeeelll me whyyyy ? ? do some Methods don't their .gists from Method.gist ? ? )
00:09 Zoffix m: [].^methods.grep(*.name eq 'eager').say
00:09 camelia rakudo-moar ffd179: OUTPUT: «(eager)␤»
00:09 Zoffix m: "x'.comb.^methods.grep(*.name eq 'eager').say
00:09 camelia rakudo-moar ffd179: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in double quotes; couldn't find final '"'␤at <tmp>:1␤------> 3omb.^methods.grep(*.name eq 'eager').say7⏏5<EOL>␤    expecting any of:␤        double quotes␤       …»
00:09 Zoffix m: 'x'.comb.^methods.grep(*.name eq 'eager').say
00:09 camelia rakudo-moar ffd179: OUTPUT: «(Method+{<anon|63462480>}.new)␤»
00:09 Zoffix like this one
00:10 Zoffix I can repro by compiling an `is nodal` method in src/core/Any.pm but can't repro outside core :/
00:11 Zoffix And if I change Mu.gist to prepend string "From Mu: " to its normal output, the above includes it
00:11 Zoffix And `is nodal` mixes in a role into the method. And NOT all `is nodal` methods have this problem :/
00:15 Zoffix ZofBot: any ideas?
00:31 Zoffix Even if I change Method.gist to be the `only` method instead of multi, still Mu.gist gets called :\
00:31 * Zoffix guesses something about composition.... If only I knew how it works!
00:41 aborazmeh joined #perl6
00:41 aborazmeh joined #perl6
00:44 HoboWithAShotgun joined #perl6
00:46 kyan joined #perl6
00:47 Cabanossi joined #perl6
01:10 vendethiel- joined #perl6
01:15 geekosaur joined #perl6
01:33 raschipi joined #perl6
01:34 skids m: #|(abc) role A { method foo { ... } }; class B does A { method foo { "OK" } }; say B.foo
01:34 camelia rakudo-moar 7af339: OUTPUT: «OK␤»
01:34 skids commit: #|(abc) role A { method foo { ... } }; class B does A { method foo { "OK" } }; say B.foo
01:34 committable6 skids, ¦#|(abc): «Cannot find this revision (did you mean “acbbc87”?)»
01:34 skids commit: releases #|(abc) role A { method foo { ... } }; class B does A { method foo { "OK" } }; say B.foo
01:35 committable6 skids, https://gist.github.com/1d01aeddcf5402935b5b580c53c5ec44
01:55 ilbot3 joined #perl6
01:55 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!
02:22 Ven`` joined #perl6
02:47 * Zoffix gives up on chasing Method.gist bug
02:47 Zoffix Filed the ticket with all the info I managed to sprunge up: https://rt.perl.org/Ticket/Display.html?id=132149
02:48 Zoffix I bet the fix is something totally easy and I'll feel stupid when someone else fixes it :)
02:56 noganex_ joined #perl6
03:03 llfourn joined #perl6
03:06 geekosaur joined #perl6
03:16 zakharyas joined #perl6
03:22 cpage_ joined #perl6
03:26 Xal joined #perl6
03:31 Cabanossi joined #perl6
03:32 AlexDaniel squashable6: when?
03:32 squashable6 AlexDaniel, I cannot recognize this command. See wiki for some examples: https://github.com/perl6/whateverable/wiki/Squashable
03:32 AlexDaniel squashable6: status
03:32 squashable6 AlexDaniel, Next SQUASHathon in 13 days and ≈6 hours (2017-10-07 UTC-12⌁UTC+14)
03:57 kyan Hi! I'm trying to do this: https://gist.github.com/ethus3h/96fae446569bd9a91f815526c3ccd082 But, because I'm parsing using a specific rule, the code in TOP is never run. What's the right syntax for making the :my $*ST = St.new(); run at the beginning of the grammar? Thanks!
03:58 * kyan tried the "has St $.ST;" and "has St $.ST = St.new();" forms, but it didn't seem to like that
04:14 bjz joined #perl6
04:15 Todd joined #perl6
04:17 Todd Hi All, on two computers I have two modules: Pause.pm (perl 5) and Pause.pl6 (perl 6).  The first computer has no problems with `use Pause; # qw[ Pause ];` (perl 6), but the second computer gives me
04:17 Todd ===SORRY!=== Error while compiling /home/linuxutil/Pause.pm (Pause) This appears to be Perl 5 code.
04:18 Todd Pause.pm is indeed Perl5.  How do I tell the senond machine that my perl6 moduels end in pl6?
04:24 Todd https://docs.perl6.org/language/modules.html
04:24 Todd Source files generally use the standard .pm extension, and scripts or executables use .pl. However, if you wish to highlight that the file is written in Perl 6 you can use the .pm6 extension for modules, and .p6 or .pl6 extension for scripts
04:25 skids Hrm so you have both files on both machines?
04:26 Todd 100% identical.  I copied and pasted
04:26 skids Same rakudo version?
04:27 Todd Good machine: $ perl6 -v This is Rakudo version 2017.07 built on MoarVM version 2017.07 implementing Perl 6.c.
04:27 Todd Bad machine: # perl6 -v This is Rakudo version 2017.06 built on MoarVM version 2017.06 implementing Perl 6.c.
04:28 Todd I am u pgrading right now
04:29 skids yeah probably commit e1e9091f7484ee124 fixd that in July.
04:29 Todd That did the trick!  Thank you!  I was really scratching my head on that one!  And I was following directions (for once) too.
04:30 skids timo++ he fixed it :-)
04:30 Todd fix was: dnf upgrade rakudo
04:35 skids good n8 p6... sleep time.
04:45 kyan Bed time for me, too, upon further reflection. Gn all! :)
05:01 Cabanossi joined #perl6
05:08 Todd joined #perl6
05:09 Todd Hi All.  Question.  Can I chain these two subsitutions together?  ` perl6 -e 'my $x="    State : abc     "; $x ~~ s/.*?" : "//; $x ~~ s/" ".*//; say "<$x>";'`
05:10 jargan joined #perl6
05:11 john51_ joined #perl6
05:21 lizmat joined #perl6
05:24 [ptc] joined #perl6
05:27 Todd I will ask on the mailing list.  Bye bye
05:31 moritz joined #perl6
05:32 Cabanossi joined #perl6
05:36 [ptc] joined #perl6
06:08 geekosaur joined #perl6
06:31 labster m: my $x="    State : abc     "; $x.subst-mutate(/.*?" : "/, "").subst-mutate(/" ".*/, "");
06:31 yoleaux 14 May 2017 18:20Z <Zoffix> labster: what's the difference between IO::Spec::*.join and .catpath? Seems the only dif is .join has an extra check that dir and file are both not "/"; but what usecase does that cover that there are two methods for it?
06:31 camelia rakudo-moar 7af339: OUTPUT: «Parameter '$self' expected a writable container, but got Match value␤  in block <unit> at <tmp> line 1␤␤»
06:31 yoleaux 14 May 2017 18:33Z <Zoffix> labster: and another special case in join is with `dirname` = '.' and `file` = 'anything'; with .catpath putting a space between, but .join just returning the filename. How should this stuff be documented??
06:31 yoleaux 15 May 2017 16:00Z <Zoffix> labster: and another question is about '.' in Unix and Win32 IO::SPECs. I see Unix changes empty path parts to '.' and if PATH is not set, returns an empty list; On Windows, empty bits are removed and '.' is always shoved to the head of the list. Was all that done on purpose?
06:31 yoleaux 15 May 2017 16:08Z <Zoffix> labster: never mind about the '.' in SPECs; figured it all out; still wondering about .join/.catpath tho
06:31 yoleaux 28 May 2017 22:03Z <Zoffix> labster: sent you a PR fixing a handle leak in File::Directory::Tree (it's the module recommended by docs.perl6.org): https://github.com/labster/p6-file-directory-tree/pull/9
06:31 yoleaux 5 Jul 2017 11:39Z <lizmat> labster: do you have any thoughts on deprecating (<+) in favour of baggy semantics of (<) and (<=) ?
06:31 labster hi yoleaux
06:32 labster I guess I haven't been in-channel for a while.
06:35 labster Zoffix: I couldn't remember the logic between catpath and join, but I guess I did document it in http://design.perl6.org/S32/IO.html#.join
06:37 labster m: my $x="foo"; $x.subst-mutate(/f/, "").subst-mutate(/f/, "");
06:37 camelia rakudo-moar 7af339: OUTPUT: «Parameter '$self' expected a writable container, but got Match value␤  in block <unit> at <tmp> line 1␤␤»
06:37 labster m: my $x="foo"; $x.subst-mutate(/x/, "").subst-mutate(/f/, "");  # change one letter
06:37 camelia rakudo-moar 7af339: OUTPUT: «Invocant of method 'subst-mutate' must be an object instance of type 'Cool', not a type object of type 'Nil'.  Did you forget a '.new'?␤  in block <unit> at <tmp> line 1␤␤»
06:38 labster ok the second error is passable,  but the first is whaaa?
06:42 setty1 joined #perl6
06:45 HoboWithAShotgun joined #perl6
06:46 Cabanossi joined #perl6
06:52 domidumont joined #perl6
06:58 domidumont joined #perl6
07:06 rindolf joined #perl6
07:21 wamba joined #perl6
07:28 nadim joined #perl6
07:32 Cabanossi joined #perl6
07:32 kaare__ joined #perl6
07:43 obfusk joined #perl6
07:43 jast joined #perl6
07:45 geekosaur joined #perl6
07:48 jast joined #perl6
07:50 ken joined #perl6
07:58 |oLa| joined #perl6
08:14 Guest51796 joined #perl6
08:23 darutoko joined #perl6
08:31 Cabanossi joined #perl6
08:55 potheads joined #perl6
09:01 Cabanossi joined #perl6
09:08 geekosaur joined #perl6
09:27 Geth ¦ doc: gfldex++ created pull request #1574: note multi hiding via non-multi in lexical scope
09:27 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1574
09:41 APic joined #perl6
09:43 margeas joined #perl6
09:45 kaare__ joined #perl6
09:47 HoboWithAShotgun how do i check wether a given scalar contains an array (.WHAT saying (Array))?
09:50 moritz if $x ~~ Array { ... }
09:54 espadrine joined #perl6
09:55 timotimo labster: subst-mutate works by mutating the string you're calling it on, but that can only work if you have a variable that can be written to. however, subst-mutate returns a match object for what it replaced, so the second subst-mutate you're calling doesn't apply to the $x. what you want is subst instead, because that will return the string after substitution
09:55 timotimo labster: or you can $x.subst-mutate twice in a row
09:55 HoboWithAShotgun allright. i have $f = $foo ~~ Array ?? $foo !! [$foo], which works but isn't there a nice way to express that?
09:55 timotimo or use something like .trans
09:57 timotimo but i'd probably do it differently entirely
09:57 labster Oh, I know why it failed.  I'm just saying the error is not very helpful, and you get a different one depending on whether or not you matched.
09:57 timotimo my $x="    State : abc     "; $x .= split(" = ")[*-1].trim-trailing(); say $x.perl
09:57 timotimo m: my $x="    State : abc     "; $x .= split(" = ")[*-1].trim-trailing(); say $x.perl
09:57 camelia rakudo-moar 7af339: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in bracketed infix; couldn't find final ']'␤at <tmp>:1␤------> 3 State : abc     "; $x .= split(" = ")[*7⏏5-1].trim-trailing(); say $x.perl␤»
09:57 timotimo m: my $x="    State : abc     "; $x = $x.split(" = ")[*-1].trim-trailing(); say $x.perl
09:57 camelia rakudo-moar 7af339: OUTPUT: «"    State : abc"␤»
09:58 timotimo m: my $x="    State : abc     "; $x = $x.split(" : ")[*-1].trim-trailing(); say $x.perl
09:58 camelia rakudo-moar 7af339: OUTPUT: «"abc"␤»
09:58 labster Not my case anyway, I was just playing around with the perl6-users question.
10:01 Cabanossi joined #perl6
10:05 timotimo mhm
10:05 timotimo i saw it, too
10:08 timotimo m: my $x = "    State : abc   "; say $x.comb(/" : " <( \S+ )>/).perl
10:08 camelia rakudo-moar 7af339: OUTPUT: «("abc",)␤»
10:13 Xliff Does it benefit performance if you store Proxy objects that you plan to reuse?
10:14 Xliff Examples here: $XML::LibXML::Globals::skipXMLDeclaration
10:14 Xliff Oops.
10:14 Xliff https://github.com/Xliff/p6-XML-LibXML/blob/master/lib/XML/LibXML/Document.pm#L70
10:16 timotimo if the proxy objects would only live until the next GC run or the next one after that, allocating a proxy is probably rather cheap, but if it lives a medium lifetime, it could be worth caching
10:16 moritz Xliff: measure it
10:16 Xliff Well, that's the thing. It depends on how its used.
10:17 timotimo why does the comment say it's "read-only" but you can set it to a different value?
10:17 Xliff If these properties are used regularly, I can definitely see an argument for caching, but I don't know that since this is a module.
10:17 rindolf joined #perl6
10:17 moritz then benchmark different scenarios
10:18 Xliff timotimo: I didn't write that comment. FROGGS did.
10:18 moritz the caching logic might be slower than creating and GCing new proxies
10:18 timotimo ah, ok
10:18 Xliff moritz: Alright then.
10:19 Xliff Although I am hardpressed to see why the logic might be expensive.
10:19 Xliff Couldn't those methods just use: method prox { state $p = Proxy.new(...); $p }
10:20 timotimo m: class T { method S { state $p = rand; $p } }; T.new.S.say; T.new.S.say;
10:20 camelia rakudo-moar 7af339: OUTPUT: «0.897041809287646␤0.897041809287646␤»
10:20 timotimo ^- same value for different instances, bad idea
10:21 LanceW joined #perl6
10:21 Xliff timo: That's fine, since it's behavior not value that's required, here.
10:21 Xliff I would agree, otherwise.
10:22 timotimo huh?
10:22 Guest51796 joined #perl6
10:22 Xliff Along that same vane, using the same proxy object across instances would be a bonus
10:23 timotimo huh? all future uses of xmlEncoding will change the encoding on the very first Document that ever had it called on it
10:24 Xliff Well crap. Missed that. I thought that self would refer to the right object across instances.
10:24 Xliff So yeah, state would not be good, would need Proxy objects per instance.
10:25 timotimo it only knows what self to refer to because it's taking a closure when you're first creating it
10:25 timotimo xmlDocument is just one per xml file, right?
10:25 Xliff Y
10:25 Xliff xmlDocument per one parsed file or string
10:26 timotimo right
10:26 Xliff So...
10:35 Sgeo_ joined #perl6
10:36 robertle joined #perl6
10:38 Xliff m: class T { has %!getSet; has $!a; method a { %!getSet<a> //= Proxy.new(FETCH => -> $ { $!a },STORE => -> $, $new { $!a = $new; }); %!getSet<a> }; }; my $t = T.new; my $tt = T.new; $t.a = "a"; $tt.a = "aa"; $t.a.say; $tt.a.say;
10:38 camelia rakudo-moar 7af339: OUTPUT: «Cannot modify an immutable Any ((Any))␤  in block <unit> at <tmp> line 1␤␤»
10:38 Xliff W(h)AT?
10:39 Xliff (Why do I always do this to myself... get a brainstorm at 5am and then try to make it a reality with !sleep)
10:41 Xliff Fix it later. Eyes gone droopy.
11:03 astj joined #perl6
11:05 timotimo it's not missing the "is rw", is it?
11:28 Zoffix .
11:30 leont joined #perl6
11:32 leah2 joined #perl6
11:33 Zoffix labster: the different errors is really due to design bug with Nil (and ultimately the safe-call op .?). Nil.subt-mutate should just pass along the Nil, but because Nil is Cool, it goes into the Cool candidate, which expects a Cool:D
11:34 Zoffix I'm surprised you think that one's passable but the first one's a "whaa". It says exactly what's wrong. What would the improved version look like?
11:36 astj joined #perl6
11:38 Zoffix labster: and I think I saw the speculations and the time and I still don't get the difference: descriptions for both methods say "Takes volume, directory and file/[basename] portions and returns an entire path string". Though I guess it don't matter much for me, now that the IO grant is over
11:40 geekosaur joined #perl6
11:44 andrzejku_ joined #perl6
11:52 ShalokShalom_ joined #perl6
11:55 Zoffix oh, the error talks about `$self`
11:57 Xliff timotimo++: That was it. The method needed to be "is rw"
11:59 Geth ¦ ecosystem: 9bec029e5c | (Tom Browder)++ (committed using GitHub Web editor) | META.list
11:59 Geth ¦ ecosystem: new module Geo::Ellipsoid
11:59 Geth ¦ ecosystem:
11:59 Geth ¦ ecosystem: ported from the Perl 5 version
11:59 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/9bec029e5c
12:00 Rawriful joined #perl6
12:11 Zoffix m: (my Match $ = ("x" ~~ /x/)).subst-mutate(/^/, "y")
12:11 camelia rakudo-moar 7af339: OUTPUT: «Type check failed in assignment; expected Match but got Str ("yx")␤  in block <unit> at <tmp> line 1␤␤»
12:11 Zoffix .oO( huh? )
12:12 Zoffix Oh, I get it now, never mind
12:16 Cabanossi joined #perl6
12:16 Zoffix What just tryign to figure out why the two different errors here:
12:17 Zoffix m: 'x'.subst-mutate(/^/, '')
12:17 camelia rakudo-moar 7af339: OUTPUT: «Cannot resolve caller subst-mutate(Str: Regex, Str); the following candidates␤match the type but require mutable arguments:␤    (Str:D $self is rw: Any:D $matcher, $replacement, :ii(:$samecase), :ss(:$samespace), :mm(:$samemark), *%options)␤  in bl…»
12:17 Zoffix m: ($ = 'x').subst-mutate(/^/, '').subst-mutate(/^/, '')
12:17 camelia rakudo-moar 7af339: OUTPUT: «Parameter '$self' expected a writable container, but got Match value␤  in block <unit> at <tmp> line 1␤␤»
12:17 Zoffix m: 42.subst-mutate(/^/, '')
12:17 camelia rakudo-moar 7af339: OUTPUT: «Parameter '$self' expected a writable container, but got Int value␤  in block <unit> at <tmp> line 1␤␤»
12:17 Zoffix I see
12:18 Zoffix $ ./perl6 -e '42.subst-mutate: /^/, ""'
12:18 Zoffix Parameter '$value-to-subst-mutate' expected a writable container, but got Int value
12:18 Zoffix Marginally better
12:19 dalek joined #perl6
12:19 synopsebot6 joined #perl6
12:21 SourceBaby joined #perl6
12:26 MasterDuke "Can only subst-mutate writable containers, but got Int value (42) instead"?
12:26 leont_ joined #perl6
12:27 leont joined #perl6
12:28 moritz m: 42.subst-mutate(/4/, 2)
12:28 camelia rakudo-moar 7af339: OUTPUT: «Parameter '$self' expected a writable container, but got Int value␤  in block <unit> at <tmp> line 1␤␤»
12:29 moritz m: 42 ~~ s/4/2/
12:29 camelia rakudo-moar 7af339: OUTPUT: «Cannot modify an immutable Int (42)␤  in block <unit> at <tmp> line 1␤␤»
12:29 moritz oh, I missed a lot of context
12:38 llfourn joined #perl6
12:44 Zoffix MasterDuke: that'd need to go into X::Parameter::RW's throwage logic. I think you improved that are in the past. Perhaps you can do so here too, by detecting when `is rw` is an invocant?
12:44 wander4096 joined #perl6
12:44 MasterDuke hm, i thought there was some logic about that already
12:45 Aaronepower joined #perl6
12:46 MasterDuke but i'll take a look
12:47 wander4096 m: sub infix:<space-concat> ($a, $b) { $a ~ " " ~ $b }; my $a = 'word1'; $a space-concat= 'word2';     # RESULT: «'word1 word2'»
12:48 camelia rakudo-moar 7af339: ( no output )
12:48 cdg joined #perl6
12:48 wander4096 sub infix:<space-concat> ($a, $b) { $a ~ " " ~ $b }; my $a = 'word1'; $a space-concat= 'word2';  $a.say   # RESULT: «'word1 word2'»
12:48 wander4096 m: sub infix:<space-concat> ($a, $b) { $a ~ " " ~ $b }; my $a = 'word1'; $a space-concat= 'word2';  $a.say   # RESULT: «'word1 word2'»
12:48 camelia rakudo-moar 7af339: OUTPUT: «word1 word2␤»
12:48 wander4096 ===SORRY!=== Error while compiling: Two terms in a row ------> $a⏏ space-concat= 'word2';     expecting any of:         infix         infix stopper         statement end         statement modifier         statement modifier loop
12:49 Zoffix m: sub infix:<space-concat> { "$^a $^b" }; my $a = 'word1'; $a space-concat= 'word2';  $a.say
12:49 camelia rakudo-moar 7af339: OUTPUT: «word1 word2␤»
12:49 Zoffix wander4096: the error isn't in the code you showed.
12:50 Zoffix wander4096: the infix you define is lexical. Are you calling it from somewhere where it's not in scope?
12:50 mr-foobar joined #perl6
12:50 wander4096 it should be no error
12:51 wander4096 but the error msg show when i put them in a REPL line by line
12:51 Zoffix wander4096: ah. It's a bug in REPL. It doesn't remember grammar modifications, which is what your infix does
12:52 Zoffix You'd need to write that program in a file and run it with `perl6 blah.p6`
12:52 Zoffix buggable: glot.io
12:52 Zoffix or use online evalers like that ^
12:52 Zoffix huggable: glot.io
12:52 huggable Zoffix, Run Perl 6 in your browser: https://tio.run/nexus/perl6 or https://glot.io
12:53 wander4096 Zoffix: got it.
12:53 MasterDuke heh, when i just slurp the 50mb, 1million line file, i get 660620maxresident. when i remove the 27 lines with unicode in them, 487160maxresident
12:53 Zoffix Ticket for that bug: https://rt.perl.org/Ticket/Display.html?id=131900#ticket-history
12:54 HoboWithAShotgun joined #perl6
12:54 mryan55 joined #perl6
12:54 Util joined #perl6
12:58 astj joined #perl6
12:59 leont joined #perl6
13:12 HoboWithAShotgun joined #perl6
13:19 Geth ¦ doc: tbrowder++ created pull request #1575: add new doc for an enum example
13:19 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1575
13:20 geekosaur joined #perl6
13:20 tbrowder i'll merge it after it shows passing unless there are objection--suggestions welcome
13:21 tbrowder *objections or suggestions
13:26 tbrowder please see and comment on my reddit post: https://www.reddit.com/r/perl6/comments/71xu0h/module_ecosystem_and_documentation_perl_6_versus/
13:33 sena_kun joined #perl6
13:42 gfldex is there a module to store Perl 6 data structures that supports typed undefined values?
13:44 timotimo yaml could in theory support that. i don't think any of our yaml modules does
13:44 nowan joined #perl6
13:46 Sgeo joined #perl6
13:48 Sgeo__ joined #perl6
13:50 mr-foobar joined #perl6
13:53 kyan joined #perl6
13:53 rindolf joined #perl6
13:58 skids joined #perl6
14:11 geekosaur joined #perl6
14:12 cdg joined #perl6
14:20 mr-foobar joined #perl6
14:22 Sgeo_ joined #perl6
14:22 dogbert11 .seen moritz
14:22 yoleaux I saw moritz 12:29Z in #perl6: <moritz> oh, I missed a lot of context
14:23 samcv any ability to get the width of the terminal? should there be nqp ops to do this?
14:30 Morfent joined #perl6
14:31 audiatorix joined #perl6
14:32 audiatorix Hey folks. My friend is trying to use Cro (web framework) and is having trouble because it uses Encoding::Registry.find, and apparently The Registry symbol can't be resolved. The exact same example code works fine for me. Any ideas?
14:33 sena_kun audiatorix, what rakudo version does your friend use?
14:34 audiatorix I would assume the very latest, since he only recently got into perl 6
14:34 audiatorix let me ask him
14:34 Sgeo_ joined #perl6
14:35 sena_kun Encoding::Registry is a part of rakudo, not cro, so seems like an outdated rakudo to me. `perl6 --version` command output is enough to check it.
14:36 audiatorix That's what I assumed, but considering I have a probably-earlier version, it doesn't make much sense. Still waiting for him to get back to me. For reference, I am using 2017.04.03
14:36 astj joined #perl6
14:36 audiatorix s/03/3/
14:37 audiatorix he is using 2017.06
14:39 audiatorix and apparently he got it though apt, whereas I installed it myself
14:39 audiatorix Perhaps a problem with apt's installation method
14:41 MasterDuke huggable: deb
14:41 huggable MasterDuke, CentOS, Debian, Fedora and Ubuntu Rakudo packages: https://github.com/nxadm/rakudo-pkg/releases
14:41 MasterDuke maybe try those ^^^, the newest release is available there
14:41 geekosaur joined #perl6
14:41 MasterDuke think Cro needs a more recent rakudo
14:41 sena_kun based on https://fossies.org/diffs/rakudo/2017.06_vs_2017.07/ Encoding::Registry was added on 2017.7 release.
14:42 sena_kun but yes, Cro needs latest rakudo, because otherwise things are, hmm, bad.
14:42 timotimo moritz: the book flow chart shows up pretty crappily on twitter; the transparent background makes it unreadable in my tweetdeck where pictures are shown in front of a black background :(
14:42 audiatorix Then that raises the question of how I am able to run it
14:42 HoboWithAShotgun joined #perl6
14:42 audiatorix with rakudo 2017.04
14:42 sena_kun perl6 --version?
14:43 audiatorix oh my bad, I am using .7
14:44 audiatorix Ran perl6 -v on the wrong shell lmao
14:44 sena_kun no problem. You need 2017.08 anyway, iirc.
14:45 audiatorix Well, time to update on all my machines
14:45 audiatorix jeez, still using .04
14:51 mr-foobar joined #perl6
15:02 Cabanossi joined #perl6
15:02 espadrine joined #perl6
15:05 Sgeo joined #perl6
15:12 Grauwolf joined #perl6
15:18 pilne joined #perl6
15:21 Sgeo_ joined #perl6
15:23 yoleaux Zoffix: fix what you broke, bruh: https://rt.perl.org/Ticket/Display.html?id=132128
15:24 Zoffix m: class Foo is Int {};  my Foo $x .= new: 42; say $x; say $x.WHAT;
15:24 camelia rakudo-moar cf95ce: OUTPUT: «42␤(Foo)␤»
15:25 Zoffix yoleaux: already fixed, bruh
15:29 geekosaur joined #perl6
15:34 skids joined #perl6
15:40 astj joined #perl6
15:42 Guest51796 joined #perl6
15:50 HoboWithAShotgun joined #perl6
15:53 Guest51796 joined #perl6
16:02 Geth ¦ doc: 9849f0945f | (Zoffix Znet)++ | 2 files
16:02 Geth ¦ doc: Remove $?USAGE / Document $*USAGE
16:02 Geth ¦ doc:
16:02 Geth ¦ doc: Rakudo impl: https://github.com/rakudo/rakudo/commit/0b15f6728a
16:02 Geth ¦ doc: Spec: https://github.com/perl6/roast/commit/04b03b1d40
16:02 Geth ¦ doc: review: https://github.com/perl6/doc/commit/9849f0945f
16:03 rngoodn joined #perl6
16:03 Zoffix ^ $?USAGE never worked in userland, nor were it specced
16:05 rngoodn What is the purpose of two semicolons after a statement? Are the two semicolons after the third satement in this example a typo? https://pastebin.com/neXs6b33
16:05 Zoffix rngoodn: yeah. It's no-op
16:06 Zoffix rngoodn: in signatures though, two colons marks off the part where multi dispatch will not consider further parameters
16:07 Zoffix (docs for that: https://docs.perl6.org/type/Signature#Long_Names )
16:07 Zoffix m: say 42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; say 'but here they have no special meaning'
16:07 camelia rakudo-moar 21f05e: OUTPUT: «42␤but here they have no special meaning␤»
16:08 rngoodn Zoffix: Thanks... am am reading through this book and it was not explained and done more than once so I started to think it might not have been a typo.
16:08 Zoffix rngoodn: oops :) Which book is it?
16:08 rngoodn Perl 6 Fundamentals
16:08 Zoffix Ah.
16:09 Zoffix moritz: ^ you may wanna fix this up for next edition
16:14 HoboWithAShotgun joined #perl6
16:19 mr-foobar joined #perl6
16:27 khw joined #perl6
16:38 schmause joined #perl6
16:48 BenGoldberg joined #perl6
16:50 mr-foobar joined #perl6
17:04 Grauwolf joined #perl6
17:04 Grauwolf joined #perl6
17:05 wander4096 `$()` has no docs
17:06 wander4096 what is the usage of `$()`
17:06 wander4096 i saw it in try MyGrammar.parse(...); if $/ { say $(); }
17:09 setty1 joined #perl6
17:09 timotimo it gives you the .ast if it's defined, otherwise the matched string
17:09 timotimo i think
17:09 timotimo from $/
17:12 wander4096 emmmm..
17:12 wander4096 that is another thing puzzling
17:13 wander4096 `.ast`
17:13 wander4096 neither i cant find out what AST exactly is in perl 6
17:13 wander4096 *can
17:14 wamba joined #perl6
17:16 wander4096 the doc of `AST` is vague
17:16 leont .ast is a method on Match
17:17 leont It's a synonym for .made
17:17 leont You can set it with make/.make
17:17 HoboWithAShotgun joined #perl6
17:18 timotimo oh, sorry
17:18 timotimo i shouldn't have used the deprecated name
17:18 wander4096 yes, which says "it returns AST"
17:18 wander4096 so it returns to "what AST is"
17:19 wander4096 a dict?
17:19 timotimo no, you decide what you put into the ast
17:19 timotimo make and made is a bit like returning a value and getting the return value, but it doesn't influence the control flow at all
17:22 mr-foobar joined #perl6
17:23 timotimo the .made is a convenient "storage space" that has short-cuts for accessing
17:32 Geth ¦ doc: 66bbcd4bed | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Match.pod6
17:32 Geth ¦ doc: Clarify Match.make
17:32 Geth ¦ doc:
17:32 Geth ¦ doc: - Remove all the waffle about ASTs
17:32 Geth ¦ doc: - Tell the user what the method is used for
17:32 Geth ¦ doc: - Link to calculator example
17:32 Geth ¦ doc: review: https://github.com/perl6/doc/commit/66bbcd4bed
17:34 Zoffix wander4096: you can store whatever you want in a Match object by giving that stuff to .make method. You can later retrieve that stuff by calling .made. The $() thing is a shortcut that returns the made stuff if it's truthy or an empty string if nothing was made or if the made stuff is falsy. I wouldn't spend too much time thinking about the $(). Can't say I've seen it used
17:34 Zoffix m: "" ~~ /^/; make 42; dd $()
17:34 camelia rakudo-moar 0b15f6: OUTPUT: «42␤»
17:34 Zoffix m: "" ~~ /^/; make 0; dd $()
17:34 camelia rakudo-moar 0b15f6: OUTPUT: «""␤»
17:34 Zoffix m: "" ~~ /^/; dd $()
17:34 camelia rakudo-moar 0b15f6: OUTPUT: «""␤»
17:35 Zoffix m: "" ~~ /^/; dd $/.made ?? $/.made !! ""
17:35 camelia rakudo-moar 0b15f6: OUTPUT: «""␤»
17:35 Zoffix ^ expanded form of $() basically
17:36 kyan Hi! I'm trying to do this: https://gist.github.com/ethus3h/96fae446569bd9a91f815526c3ccd082 But, because I'm parsing using a specific rule, the code in TOP is never run. What's the right syntax for making the :my $*ST = St.new(); run at the beginning of the grammar? (I tried the "has St $.ST;" and "has St $.ST = St.new();" forms, but they didn't do the trick.) I assume this is because the grammar's constructor is not called on
17:36 kyan parses so it just uses a type object, but I don't know how to write this... Thanks!
17:36 Sgeo__ joined #perl6
17:37 Zoffix kyan: stick :my $*ST = St.new(); inside `token foo`
17:37 Zoffix kyan: you can also stick it before you call .parse (without the leading colon)
17:37 Zoffix my $*ST = St.new; say EM.parse('!', :rule<foo>);
17:37 eliasr joined #perl6
17:38 Zoffix $*blah are dynamic variables available via dynamic scope, so `method block` will see it up the callstack from <- foo <- parse
17:38 kyan Ohhhhh! I get it. Would I need to reset it between subsequent parses?
17:38 Zoffix Don't think that code will work. I think grammar's method need to return a Match object or something
17:39 kyan (mm, the full code
17:39 Zoffix kyan: I guess. You could wrap it in a sub to reset it for you
17:39 kyan does call a token after that.)
17:39 kyan Yeah. Cool, thanks! :)
17:39 Zoffix m: sub meows { $*ST.say }; sub parse-stuff { my $*ST = 42; meows; $*ST = 70; meows }; parse-stuff; parse-stuff
17:39 camelia rakudo-moar 0b15f6: OUTPUT: «42␤70␤42␤70␤»
17:52 mr-foobar joined #perl6
17:54 wander4096 thanks to Zoffix, timotimo and leont, although i still need some time to handle that >_<
17:54 devmikey joined #perl6
17:59 araujo joined #perl6
18:06 thou joined #perl6
18:10 ShalokShalom_ joined #perl6
18:12 lizmat_ joined #perl6
18:12 HoboWithAShotgun joined #perl6
18:14 thou Zoffix++  (for On Troll Hugging, Hole Digging, and Improving Open Source Communities)!
18:15 Zoffix \o/
18:15 astj joined #perl6
18:16 xxpor joined #perl6
18:18 nadim joined #perl6
18:21 mr-foobar joined #perl6
18:28 pecastro joined #perl6
18:37 El_Che joined #perl6
18:46 Cabanossi joined #perl6
18:51 mr-foobar joined #perl6
19:10 SmokeMachine m: say "{$++}" for ^10
19:10 camelia rakudo-moar 0b15f6: OUTPUT: «0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤»
19:10 SmokeMachine is that expected? ^^
19:11 SmokeMachine m: say $++ for ^10
19:11 camelia rakudo-moar 0b15f6: OUTPUT: «0␤1␤2␤3␤4␤5␤6␤7␤8␤9␤»
19:13 gfldex SmokeMachine: i'm nor surprised but am leaning towards calling that a bug
19:14 gfldex m: (say "" ~ {$++}() ~ "") for ^10
19:14 camelia rakudo-moar 0b15f6: OUTPUT: «0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤»
19:14 gfldex i guess that's what happens
19:16 Cabanossi joined #perl6
19:17 * Zoffix thinks it's not a bug
19:17 Zoffix Oh nevermind
19:17 Zoffix m: { say $++ }() for ^5
19:17 camelia rakudo-moar 0b15f6: OUTPUT: «0␤0␤0␤0␤0␤»
19:17 * Zoffix shrugs
19:21 mr-foobar joined #perl6
19:50 mr-foobar joined #perl6
19:54 cdg joined #perl6
20:01 ufobat joined #perl6
20:06 astj joined #perl6
20:13 rngoodn joined #perl6
20:15 |oLa|1 joined #perl6
20:16 AlexDaniel joined #perl6
20:20 devmikey joined #perl6
20:21 mr-foobar joined #perl6
20:26 TEttinger joined #perl6
20:27 gfldex m: { say "" ~ $++ ~ "" } for ^10
20:27 camelia rakudo-moar 0b15f6: OUTPUT: «0␤1␤2␤3␤4␤5␤6␤7␤8␤9␤»
20:41 AlexDaniel m: say(""~$++~"")xx⁹
20:41 camelia rakudo-moar 0b15f6: OUTPUT: «0␤1␤2␤3␤4␤5␤6␤7␤8␤»
20:42 nhywyll joined #perl6
20:46 mr-fooba_ joined #perl6
20:48 kyan Is there a checking tool available for Perl 6 like Shellcheck, where I can paste my code and get a report of syntactic errors and common mistakes in it?
20:49 Mrofnet joined #perl6
20:50 AlexDaniel kyan: not yet! But we have this page: https://docs.perl6.org/language/traps
20:51 kyan AlexDaniel: cool, thanks!
21:01 Cabanossi joined #perl6
21:11 Ven`` joined #perl6
21:18 [Coke] super slow internet here. Can someone get me a link to the github p6 curses module?
21:19 [Coke] also, is there a secret zef option to not try to update the module list?
21:20 kyan ( Just so you know, https://docs.perl6.org/language/traps has a broken link to https://docs.perl6.org/type/MONKEY-SEE-NO-EVAL )
21:21 [Coke] kyan; please open a ticket at github.com/perl6/doc/issues
21:21 kyan Thanks!
21:21 MasterDuke [Coke]: this? https://github.com/azawawi/perl6-ncurses
21:22 [Coke] MasterDuke: danke. trying a clone...
21:23 [Coke] sooooo slow
21:23 MasterDuke do you need the whole repo? might be faster just to dl master.zip
21:24 [Coke] sure.
21:24 [Coke] bah. Could not resolve host: github.com
21:24 MasterDuke https://github.com/azawawi/perl6-ncurses/archive/master.zip
21:27 rngoodn joined #perl6
21:29 nadim joined #perl6
21:31 Zoffix [Coke]: ^ that zip file: https://temp.perl6.party/master.zip  (if you're still having trouble resolving github.com)
21:31 Zoffix Github's IP: 192.30.253.112
21:32 japhb [Coke]: Please let me know what you like or don't like about working with ncurses in Perl 6.  I'm background-working on writing a from-scratch widget library for Perl 6 to be based on Terminal::Print rather than curses, and I'm aiming for a low annoyance API.
21:43 Rawriful joined #perl6
21:43 raschipi joined #perl6
21:49 Rawriful joined #perl6
21:54 Lac123 joined #perl6
21:58 raschipi samcv: Don't forget to handle SIGWINCH if you're going to detect terminal size. No need to ask again, the kernel signals the program when it's terminal changes shape.
22:00 Lac123 I know its 8 years old, but this perl6 advent (https://perl6advent.wordpress.com/2009/12/09/day-9-having-beautiful-arguments-and-parameters/) suggests that you can name parameters in your call without the sub having ":"s in  front of the variable definitionss.  (i.e. that sub draw_line($x1, $y1, $x2, $y2) { say "hi" }; draw_line(:x1($x1), :y1($y1), :x2($x2), :y2($y2)); should work - but it doesn't).  Has this changed since, or am I mi
22:00 Lac123 (I get "Too few positionals passed; expected 4 arguments but got 0" for the above)
22:02 geekosaur joined #perl6
22:03 raschipi Lac123: To use that calling convention, you need to have the function declared with named parameters instead of positional like above.
22:04 Lac123 ok, thank raschipi; I guess the 8yo advent article is out of date!  or I'm reading it too literally.
22:04 raschipi The explanation isn't clear there, but it hasn't changed.
22:05 jnthn Actually, long ago it *was* speculated that positional parameters would also be passed by name
22:05 jnthn 8 years ago that probably was still in a design doc somewhere
22:06 jnthn In the end, it didn't make the cut
22:06 jnthn There were a few other such magical nuisances that also didn't
22:06 jnthn (With relation to arguments)
22:06 japhb "magical nuisances"   :-)
22:07 Lac123 thank you
22:17 gfldex joined #perl6
22:22 Sgeo joined #perl6
22:46 cdg joined #perl6
22:47 Cabanossi joined #perl6
22:52 geekosaur joined #perl6
22:57 labster joined #perl6
23:22 Geth ¦ doc: d277ade26b | (Tom Browder)++ | doc/Language/enumeration.pod6
23:22 Geth ¦ doc: add new doc en an enum example
23:22 Geth ¦ doc: review: https://github.com/perl6/doc/commit/d277ade26b
23:22 Geth ¦ doc: 766a905e3a | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/enumeration.pod6
23:22 Geth ¦ doc: Merge pull request #1575 from tbrowder/enum
23:22 Geth ¦ doc:
23:22 Geth ¦ doc: add new doc for an enum example
23:22 Geth ¦ doc: review: https://github.com/perl6/doc/commit/766a905e3a
23:24 kyan Hi again... is this probably a problem with Grammar::ErrorReporting, or a problem in my use of it, or is it hard to tell? Thanks :)
23:24 rngoodn joined #perl6
23:28 kyan ...oh, I never posted the problem. D'oh. Here it is: https://gist.github.com/ethus3h/e13fbc9aaa1cb81154ae9137a45cdd88
23:29 itaipu joined #perl6
23:30 kyan Oh! Never mind me. I see. It's not a problem, actually, I just didn't realize Grammar::ErrorReporting would actually exit the enclosing script rather than just reporting failure.
23:30 kyan Sorry for the noise. :)
23:32 wamba joined #perl6
23:35 AlexDaniel kyan: I don't think it does
23:35 AlexDaniel kyan: it simply returns a Failure, and sinking a Failure makes it exit
23:36 AlexDaniel m: Failure.new(‘uh’); say ‘hello world’
23:36 camelia rakudo-moar 0b15f6: OUTPUT: «uh␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
23:36 AlexDaniel m: my $x = Failure.new(‘uh’); say ‘hello world’
23:36 camelia rakudo-moar 0b15f6: OUTPUT: «hello world␤»
23:38 kyan Oh, interesting. Thanks!
23:53 kyan Is there a way to wrap up chunks of code e.g. #`( Methods for doing foo ) { in-the-same-scope; };  without creating a new scope?
23:55 AlexDaniel m: class C { (method foo() { say ‘foo’ }; method bar() { }) }; C.new.foo
23:55 camelia rakudo-moar 0b15f6: OUTPUT: «foo␤»
23:55 AlexDaniel not quite sure why would you need that, but what about this?
23:57 kyan Are the parentheses doing the grouping in that example?
23:57 kyan (The reason I'd like to do that, is because I've got a grammar with a fairly large number of token definitions, and want to group them up into batches I can label with comments and fold-up in the editor
23:59 kyan Oh! Yeah, parentheses do do that, as long as I put a ; at the end before an immediately subsequent token declaration
23:59 kyan Sweet, thanks again! :D

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

Perl 6 | Reference Documentation | Rakudo