Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-11-21

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:05 mcmillhj joined #perl6
00:12 _28_ria joined #perl6
00:13 Cabanossi joined #perl6
00:18 mcmillhj joined #perl6
00:18 llfourn joined #perl6
00:18 Geth ¦ ecosystem: f9440918c3 | (Tony O'Dell)++ (committed using GitHub Web editor) | META.list
00:18 Geth ¦ ecosystem: (Digest::FNV) FNV hashing for the masses
00:18 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/f9440918c3
00:32 mcmillhj joined #perl6
00:34 lookatme joined #perl6
00:34 lookatme o\
00:38 mcmillhj joined #perl6
00:48 Altreus oh I just discovered .elements()
00:49 lookatme What's that ?
00:49 Juerd Altreus: Do you mean .elems?
00:49 AlexDaniel probably not
00:49 Altreus oh, I was referring to my earlier query about exemel
00:49 AlexDaniel https://github.com/supernovus/exemel#elements
00:50 aborazmeh joined #perl6
00:50 aborazmeh joined #perl6
00:50 Altreus turns out it has a fairly useful search tool, but I had to read the examples to find it because I tuned out while reading the actual docs
00:51 ZzZombo joined #perl6
00:54 mcmillhj joined #perl6
00:54 lookatme awesome module
01:02 cdg joined #perl6
01:04 mcmillhj joined #perl6
01:07 bazzaar joined #perl6
01:08 bazzaar \o perl6
01:08 AlexDaniel o/
01:09 bazzaar m: "1\n2\n3\n4\n".chars.say;
01:09 camelia rakudo-moar 8ccb60e39: OUTPUT: «8␤»
01:09 bazzaar m: "1\n2\n3\n4\n".lines[1..*].say;
01:09 camelia rakudo-moar 8ccb60e39: OUTPUT: «(2 3 4)␤»
01:11 bazzaar If I insert a newline between the string and the method call, it works for .chars, but not for .lines
01:12 bazzaar not sure why
01:14 ugexe it will work for .lines. not .lines[1..*]
01:15 lookatme How about using that unspace '\'  https://docs.perl6.org/language/5to6-nutshell#Whitespace
01:20 mcmillhj joined #perl6
01:21 bazzaar ugexe : thanks for your help
01:21 bazzaar lookatme : thanks for your help also
01:23 bazzaar I'm now reading up on perl6 whitespace :)
01:23 a3r0 joined #perl6
01:24 lookatme :D
01:29 mcmillhj joined #perl6
01:37 klapperl joined #perl6
01:37 itaylor57 joined #perl6
01:44 MasterDuke joined #perl6
01:45 timotimo bazzaar: you can put newlines into camelia strings by copy-pasting the little nl character it makes
01:45 timotimo m: "1\n2\n3\n4\n"␤.chars.say;
01:45 camelia rakudo-moar 8ccb60e39: OUTPUT: «8␤»
01:45 timotimo m: "1\n2\n3\n4\n"␤.lines[1..*].say;
01:45 camelia rakudo-moar 8ccb60e39: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Missing infix inside []␤at <tmp>:2␤------> 3.lines[7⏏1..*].say;␤    expecting any of:␤        bracketed infix␤        infix␤        infix stopper␤»
01:46 timotimo m: "1\n2\n3\n4\n"␤.lines.[1..*].say;
01:46 camelia rakudo-moar 8ccb60e39: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Malformed postfix call␤at <tmp>:2␤------> 3.lines.7⏏5[1..*].say;␤»
01:46 timotimo interesting
01:49 lookatme m: "1\n2\n3\n4\n"\␤.lines.[1..*].say;
01:49 camelia rakudo-moar 8ccb60e39: OUTPUT: «(2 3 4)␤»
01:49 bazzaar timotimo: thanks for the tip, it will certainly help me shorten my questions :)
01:50 Xliff s0me0n3-unkn0wn: ping
01:51 Xliff s0me0n3-unkn0wn: Why can't you just use a wrapper sub for that, and a conditional to test for OS and generate the right call to use?
01:52 Xliff s/generate/specify/
01:57 bazzaar m: "1\n2\n3\n4\n"␤.lines␤.[1..*]␤.say;
01:57 camelia rakudo-moar 8ccb60e39: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Malformed postfix call (only alphabetic methods may be detached)␤at <tmp>:3␤------> 3.7⏏5[1..*]␤»
01:58 bazzaar nice error message!
02:04 bazzaar m: "1\n2\n3\n4\n"␤.lines\␤.[1..*]␤.say;
02:04 camelia rakudo-moar 8ccb60e39: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Malformed postfix call (only alphabetic methods may be detached)␤at <tmp>:3␤------> 3.7⏏5[1..*]␤»
02:07 bazzaar m: "1\n2\n3\n4\n"\␤.lines.[1..*]␤.say;
02:07 camelia rakudo-moar 8ccb60e39: OUTPUT: «(2 3 4)␤»
02:08 cdg joined #perl6
02:10 bazzaar lookatme: just saw what you did there, thanks
02:11 lookatme you welcome :P
02:23 R0b0t1_ joined #perl6
02:33 llfourn_ joined #perl6
02:55 ilbot3 joined #perl6
02: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!
03:06 noganex_ joined #perl6
03:11 mcmillhj joined #perl6
03:14 ufobat___ joined #perl6
03:18 ufobat joined #perl6
03:34 Herby_ joined #perl6
03:34 Herby_ o/
03:49 mcmillhj joined #perl6
03:53 mson joined #perl6
03:57 kaare__ joined #perl6
04:05 xtreak joined #perl6
04:05 ZzZombo joined #perl6
04:19 mcmillhj joined #perl6
04:26 mcmillhj joined #perl6
04:26 Cabanossi joined #perl6
04:44 Kotnuk joined #perl6
04:45 lookatme o/
04:45 Kotnuk o/
04:51 Kotnuk Is perl 6 faster or slower than perl 5?
04:56 Cabanossi joined #perl6
04:57 mcmillhj joined #perl6
05:20 snapsisy joined #perl6
05:27 mcmillhj joined #perl6
05:34 xtreak joined #perl6
05:37 mcmillhj joined #perl6
05:50 kaare__ joined #perl6
05:58 ZzZombo LTA:
05:58 ZzZombo m: class A {has $.a where *>100};say A.new(:a<10>)
05:58 camelia rakudo-moar 8ccb60e39: OUTPUT: «Type check failed in assignment to $!a; expected <anon> but got IntStr (IntStr.new(10, "10"))␤  in submethod BUILDALL at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
05:58 ZzZombo m: class A {has $.a where *>100};say A.new(:a<10>)
05:58 camelia rakudo-moar 8ccb60e39: OUTPUT: «Type check failed in assignment to $!a; expected <anon> but got IntStr (IntStr.new(10, "10"))␤  in submethod BUILDALL at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
05:58 ZzZombo ?
05:59 ZzZombo what the hell?
05:59 ZzZombo camelia: rakudo-moar 8ccb60e39: OUTPUT: «A.new(a => 1001)␤»
05:59 ZzZombo shit
06:00 ZzZombo camelia: rakudo-moar 8ccb60e39: OUTPUT: «Type check failed in assignment to $!a; expected <anon> # <- here
06:00 lookatme <10> is IntStr
06:01 lookatme I don't like <> operator
06:01 piojo joined #perl6
06:01 teatime I kinda love it and «»
06:01 lookatme m: say <10>.WHAT, <abc>.WHAT;
06:01 camelia rakudo-moar 8ccb60e39: OUTPUT: «(IntStr)(Str)␤»
06:02 lookatme It's type depend on its content
06:02 ugexe m: sub foo(Int $a) { say $a }; foo(<10>)
06:03 camelia rakudo-moar 8ccb60e39: OUTPUT: «10␤»
06:03 teatime it's a quoting construct, IntStr's can come from other places but I'm not sure where right off
06:03 teatime "10".WHAT
06:03 teatime m: "10".WHAT
06:03 camelia rakudo-moar 8ccb60e39: ( no output )
06:03 teatime m: say "10".WHAT
06:03 camelia rakudo-moar 8ccb60e39: OUTPUT: «(Str)␤»
06:04 lookatme I would rather using `a => 10` or `:a(10)`
06:04 teatime feel free :)
06:05 lookatme Yeah, I can do a choice, that's why I love Perl6
06:08 lookatme m: say {}.WHAT; say { 5 }.WHAT;
06:08 camelia rakudo-moar 8ccb60e39: OUTPUT: «(Hash)␤(Block)␤»
06:09 lookatme And I don't like those not consistent ^^^
06:12 darutoko joined #perl6
06:20 s0me0ne-unkn0wn joined #perl6
06:20 wamba joined #perl6
06:21 mson joined #perl6
06:23 Xliff joined #perl6
06:25 evalable6 joined #perl6
06:26 bisectable6 joined #perl6
06:26 unicodable6 joined #perl6
06:26 releasable6 joined #perl6
06:26 Geth__ joined #perl6
06:30 parv joined #perl6
06:36 ivans joined #perl6
06:36 ZzZombo How can I in my custom `clone` method override an array attribute's value/forbid copying its value to the clone?
06:37 ZzZombo It's a private attribute, so I can't modify it outside the object.
06:49 lookatme m: class C { has @.a; method clone(*%_) { %_<a> = %_<a> // @!a.clone; nextwith(|%_); }; }; my C $c .= new(a => Q :w {1 2 3 4}); my $d = $c.clone(); $d.a.push(8); say $c; say $d;
06:49 camelia rakudo-moar 8ccb60e39: OUTPUT: «C.new(a => ["1", "2", "3", "4"])␤C.new(a => ["1", "2", "3", "4", 8])␤»
06:49 lookatme Do you mean this ?
06:54 rindolf joined #perl6
06:57 xtreak_ joined #perl6
06:58 mcmillhj joined #perl6
07:14 domidumont joined #perl6
07:20 domidumont joined #perl6
07:26 Khisanth joined #perl6
07:27 Brumbazz joined #perl6
07:32 mcmillhj joined #perl6
07:41 Cabanossi joined #perl6
07:45 piojo1 joined #perl6
07:53 wander joined #perl6
07:54 wander how can I remove a given element from an Array?
07:54 wander my @a = [1,2,3]; @a.remove(2)
07:54 wander m: my @a = [1,2,3]; @a.remove(2)
07:54 camelia rakudo-moar 8ccb60e39: OUTPUT: «No such method 'remove' for invocant of type 'Array'␤  in block <unit> at <tmp> line 1␤␤»
08:01 geekosaur to make it go away completely, you have to use splice
08:03 jast m: my @a = [1,2,3]; @a.splice(1,1); say @a
08:03 camelia rakudo-moar 8ccb60e39: OUTPUT: «[1 3]␤»
08:03 geekosaur m: my @a = [1,2,3]; @a.splice(1, 1); say @a
08:03 camelia rakudo-moar 8ccb60e39: OUTPUT: «[1 3]␤»
08:03 geekosaur yeh
08:03 geekosaur and this is different:
08:03 geekosaur m: my @a = [1,2,3]; @a[1]:delete; say @a
08:03 camelia rakudo-moar 8ccb60e39: OUTPUT: «[1 (Any) 3]␤»
08:03 lookatme m: my @a = 1, 2, 3, 4, 5; say @a.splice(2, 3); say @a;
08:03 camelia rakudo-moar 8ccb60e39: OUTPUT: «[3 4 5]␤[1 2]␤»
08:04 lookatme m: my @a := 1, 2, 3, 4, 5; say @a.splice(2, 3); say @a;
08:04 camelia rakudo-moar 8ccb60e39: OUTPUT: «Cannot resolve caller splice(List, Int, Int); Routine does not have any candidates. Is only the proto defined?␤  in block <unit> at <tmp> line 1␤␤»
08:05 domidumont joined #perl6
08:06 mcmillhj joined #perl6
08:12 piojo1 m: my %hsh = (a => 1, b => 2); say []; say [ %hsh ]; say [ %hsh, %hsh ];
08:12 camelia rakudo-moar 8ccb60e39: OUTPUT: «[]␤[a => 1 b => 2]␤[{a => 1, b => 2} {a => 1, b => 2}]␤»
08:13 piojo1 that inconsistency is quite troublesome, but the output doesn't show it very well
08:13 piojo1 m: my %hsh = (a => 1, b => 2); say [].elems; say [ %hsh ].elems; say [ %hsh, %hsh ].elems;
08:13 camelia rakudo-moar 8ccb60e39: OUTPUT: «0␤2␤2␤»
08:19 kaare__ joined #perl6
08:25 abraxxa joined #perl6
08:26 lookatme m: my %hsh = (a => 1, b => 2); say %hsh;
08:26 camelia rakudo-moar 8ccb60e39: OUTPUT: «{a => 1, b => 2}␤»
08:27 lookatme m: my %hsh = (a => 1, b => 2); say []; say [ %hsh ].WHAT;
08:27 camelia rakudo-moar 8ccb60e39: OUTPUT: «[]␤(Array)␤»
08:27 kaare_ joined #perl6
08:27 lookatme Why `[ %hsh ]` is an Array ?
08:28 lookatme m: say [1].WHAT
08:28 camelia rakudo-moar 8ccb60e39: OUTPUT: «(Array)␤»
08:28 lookatme m: say [1]
08:28 camelia rakudo-moar 8ccb60e39: OUTPUT: «[1]␤»
08:29 dakkar joined #perl6
08:29 lookatme Oh, I confused () and [] :(
08:29 lookatme m: say (1).WHAT; say (1, 2).WHAT
08:29 camelia rakudo-moar 8ccb60e39: OUTPUT: «(Int)␤(List)␤»
08:30 lookatme And I think [ %hsh ] is a bug
08:30 lookatme m: my %hsh = (a => 1, b => 2); say [ %hsh ][0];
08:30 camelia rakudo-moar 8ccb60e39: OUTPUT: «a => 1␤»
08:31 wamba joined #perl6
08:34 wander yes, :delete is what i want
08:34 wander thank you
08:41 piojo1 lookatme: it seems like a perl-5-ism
08:41 piojo1 it's an automatic flattening
08:42 Cabanossi joined #perl6
08:42 piojo1 I don't like it, but I'm not sure it's a bug
08:42 moritz m: my %hsh = (a => 1, b => 2); say [ %hsh, ][0];
08:42 camelia rakudo-moar 8ccb60e39: OUTPUT: «{a => 1, b => 2}␤»
08:42 moritz it's an application of the one-argument rule
08:43 xtreak joined #perl6
08:44 mcmillhj joined #perl6
08:44 ufobat morning :)
08:45 piojo1 moritz: Is that if there's one argument in a list context, rakudo will try to interpret it as a list?
08:45 piojo1 I see: https://docs.perl6.org/type/Signature#Single_Argument_Rule_Slurpy
08:50 Geth ¦ doc: e170c16604 | ZzZombo++ (committed using GitHub Web editor) | doc/Type/Str.pod6
08:50 synopsebot Link: https://doc.perl6.org/type/Str
08:50 Geth ¦ doc: Fixed wrong example
08:50 Geth ¦ doc:
08:50 Geth ¦ doc: Such an obvious mistake.
08:50 Geth ¦ doc: review: https://github.com/perl6/doc/commit/e170c16604
08:52 lookatme piojo1, I don't like too
08:54 piojo1 m: sub list1 { $(1, 2) }; sub list2 { (1, 2) }; say [list1].elems; say [list2].elems;
08:54 camelia rakudo-moar 8ccb60e39: OUTPUT: «1␤2␤»
08:54 piojo1 awkward!
08:56 lookatme That's really gild the lily . :(
09:01 lowbro joined #perl6
09:01 lowbro joined #perl6
09:03 zakharyas joined #perl6
09:11 kaare_ joined #perl6
09:14 mcmillhj joined #perl6
09:22 lowbro joined #perl6
09:22 lowbro joined #perl6
09:22 xtreak joined #perl6
09:27 ZzZombo joined #perl6
09:32 kaare_ joined #perl6
09:33 zakharyas joined #perl6
09:38 scimon joined #perl6
09:40 domidumont1 joined #perl6
09:41 Cabanossi joined #perl6
09:45 itaipu joined #perl6
09:50 ZzZombo joined #perl6
09:55 tyil how to depend on a minimum version of another module in meta6.json?
10:04 HaraldJoerg joined #perl6
10:07 zakharyas1 joined #perl6
10:08 xtreak_ joined #perl6
10:13 geospeck joined #perl6
10:13 buggable New CPAN upload: App-Cpan6-0.14.1.tar.gz by TYIL https://cpan.metacpan.org/authors/id/T/TY/TYIL/Perl6/App-Cpan6-0.14.1.tar.gz
10:17 sena_kun joined #perl6
10:26 robertle joined #perl6
10:33 mcmillhj joined #perl6
10:40 s0me0ne-unkn0wn Xliff: The problem is libeay32.dll is installed on Win along with OpenSSL module itself and filepaths are mangled, we don't know where the library resides at runtime, so OpenSSL::NativeLib::gen-lib is needed to find the lib
10:40 s0me0ne-unkn0wn And now this behavior should be copy-pasted for another lib
10:41 s0me0ne-unkn0wn It's pain in the ass but I hope core patch resolving the problem arrives soon and all those gen-* are dropped all together
10:48 kaare__ joined #perl6
10:56 kaare__ joined #perl6
10:56 zakharyas joined #perl6
10:56 ZzZombo hello
10:56 Cabanossi joined #perl6
11:11 mcmillhj joined #perl6
11:18 xtreak joined #perl6
11:23 DrForr o/
11:34 invalid_nickname joined #perl6
11:36 HoboWithAShotgun joined #perl6
11:43 mcmillhj joined #perl6
11:47 tbrowder \o DrForr
11:47 ZzZombo how can I *bind* a value to an attribute?
11:51 jnthn $!attr := $value;
11:57 Cabanossi joined #perl6
11:59 llfourn joined #perl6
12:00 domidumont joined #perl6
12:10 Sgeo joined #perl6
12:11 Geth ¦ doc: 0c8fecfaf5 | (Jan-Olof Hendig)++ | doc/Language/traps.pod6
12:11 synopsebot Link: https://doc.perl6.org/language/traps
12:11 Geth ¦ doc: Even more formatting fixes
12:11 Geth ¦ doc: review: https://github.com/perl6/doc/commit/0c8fecfaf5
12:18 Geth ¦ doc: 3625f54aaa | (Jan-Olof Hendig)++ | doc/Language/traps.pod6
12:18 Geth ¦ doc: Fixed three broken links
12:18 Geth ¦ doc: review: https://github.com/perl6/doc/commit/3625f54aaa
12:21 mcmillhj joined #perl6
12:26 rindolf joined #perl6
12:26 Geth ¦ mu: c9b2e40fe7 | (Zoffix Znet)++ (committed using GitHub Web editor) | misc/perl6advent-2017/schedule
12:26 Geth ¦ mu: Fix typo
12:26 Geth ¦ mu: review: https://github.com/perl6/mu/commit/c9b2e40fe7
12:27 xtreak joined #perl6
12:38 ZzZombo m: class C { has Str $.s;multi method s{return-rw $!s};multi method s(Str:D \s){$!s=s};submethod TWEAK(:$s){ self.s($s)} };my $a=C.new(:s<a>);my $s='aaaaaaaaaa';$a.s($s.substr-rw(2,3));$a.s('asd');say ($a,$s)
12:38 camelia rakudo-moar 8ccb60e39: OUTPUT: «(C.new(s => "asd") aaaaaaaaaa)␤»
12:43 _28_ria joined #perl6
12:51 domidumont joined #perl6
12:54 eliasr joined #perl6
12:55 mcmillhj joined #perl6
13:06 mcmillhj joined #perl6
13:07 geospeck joined #perl6
13:16 Geth ¦ mu: 2cf986e72e | (Zoffix Znet)++ (committed using GitHub Web editor) | misc/perl6advent-2017/schedule
13:16 Geth ¦ mu: Add new articles/restructure
13:16 Geth ¦ mu:
13:16 Geth ¦ mu: - Add "The Grinch of Perl 6: A Practical Guide to Ruining Christmas"
13:16 Geth ¦ mu: - Add "A Primer to New, Readable Perl 6 Regex Syntax"
13:16 Geth ¦ mu: - Move "Perl 6 Is My Drummer: Making Grammars Sing" after the primer to regexes
13:16 Geth ¦ mu: review: https://github.com/perl6/mu/commit/2cf986e72e
13:21 stmuk joined #perl6
13:23 stmuk joined #perl6
13:23 ZzZombo_ joined #perl6
13:23 ZzZombo_ test
13:23 stmuk how long does Cro::HTTP testing take?
13:26 stmuk oh futex(0x55b208712054, FUTEX_WAIT_PRIVATE, 1, NULL probably isn't good
13:26 jnthn Depends on the hardware and if the tests are run in parallel
13:27 jnthn Run non-parallel and with time to compile everything, could easily run over a minute or more
13:27 timotimo stmuk: that could just be a worker waiting for work to appear?
13:28 stmuk its been waiting for several mins on an old I5 with 2 cores
13:29 jnthn 43s with -j8 with cold precomp cache here
13:29 jnthn 11s warm
13:30 piojo joined #perl6
13:30 stmuk hmm I'll see if I can reproduce again
13:31 lucs_ Inline::Perl5 problem: https://gist.github.com/lucs/43aa5fa13f6866378e8c154a7b45d811
13:31 jnthn stmuk: There were some hangs in the http-client.t a while back, but I thought they were all resolved (and haven't seen any on Travis for that module since then)
13:39 mcmillhj joined #perl6
13:41 wamba joined #perl6
13:48 holyghost joined #perl6
13:53 Geth ¦ doc: 11fe7c48ed | (Jan-Olof Hendig)++ | doc/Language/testing.pod6
13:53 synopsebot Link: https://doc.perl6.org/language/testing
13:53 Geth ¦ doc: Improved code formatting
13:53 Geth ¦ doc: review: https://github.com/perl6/doc/commit/11fe7c48ed
13:57 Cabanossi joined #perl6
13:58 Brumbazz joined #perl6
14:04 stmuk jnthn: can't reproduce ... I must have just been unlucky
14:05 jnthn Hmm
14:05 timotimo does not bode well ...
14:05 jnthn Maybe one of the Travis runs will eventually show it up
14:06 setty1 joined #perl6
14:07 jnthn BTW, there's now also a #cro channel :)
14:08 cdg joined #perl6
14:12 kaare__ joined #perl6
14:14 DrForr Pod::To::HTML seems to call a chain of subroutines rather than instantiating an object - Is that just the author's choice, or was it by design?
14:16 DrForr I'm giving in and writing Pod::To::BlogspotHTML, and I thought I'd put an object in there that people can subclass if they don't like my HTML formatting.
14:17 DrForr I can bless the object easily enough, but I was wondering if there were any ecosystem reasons why the design decision was made.
14:21 DrForr Oh, wait. I probably can't easily get the package inside the sub, at least not in a way that'd let people override it.
14:21 HaraldJoerg left #perl6
14:26 ZzZombo joined #perl6
14:26 ZzZombo HexChat is great.
14:28 ZzZombo So, I've asked a bunch of questions today, but wasn't able to hear any responses, due to a bug in my previous IRC client, I'm sorry if my interaction was needed.
14:28 stmuk it wasn't weechat was it?
14:29 ZzZombo Pidgin.
14:32 ZzZombo camelia: rakudo-moar 8ccb60e39: OUTPUT: «Type check failed in assignment to $!a; expected <anon> # <- I mean, what on Earth is <anon>?
14:32 mson joined #perl6
14:34 ZzZombo How can I in my custom `clone` method override an array attribute's value/forbid copying its value to the clone?
14:34 ZzZombo It's a private attribute, so I can't modify it outside the object.
14:36 ZzZombo jnthn, what do I do wrong here when binding the attribute?
14:36 ZzZombo m: m: class C { has Str $.s;multi method s{return-rw $!s};multi method s(Str:D \s){$!s:=s};submethod TWEAK(:$s){ self.s($s)} };my $a=C.new(:s<a>);my $s='aaaaaaaaaa';$a.s($s.substr-rw(2,3));$a.s('asd');say ($a,$s)
14:36 camelia rakudo-moar 8ccb60e39: OUTPUT: «(C.new(s => "asd") aaaaaaaaaa)␤»
14:37 ZzZombo I wanna keep the reference to the substring inside the object.
14:37 ZzZombo And use it to modify the original string.
14:41 cdg joined #perl6
14:43 kaare__ joined #perl6
14:46 jnthn ZzZombo: Need to mark the first multi method s with "is rw", I think
14:48 ZzZombo m: m: class C { has Str $.s;multi method s is rw{return-rw $!s};multi method s(Str:D \s){$!s:=s};submethod TWEAK(:$s){ self.s($s)} };my $a=C.new(:s<a>);my $s='aaaaaaaaaa';$a.s($s.substr-rw(2,3));$a.s('asd');say ($a,$s)
14:48 camelia rakudo-moar 8ccb60e39: OUTPUT: «5===SORRY!5===␤Trait 'is rw' needs whitespace before block␤at <tmp>:1␤------> 3 $.s;multi method s is rw{return-rw $!s}7⏏5;multi method s(Str:D \s){$!s:=s};submet␤Missing block (apparently claimed by 'is rw')␤at <tmp>:1␤------> …»
14:49 ZzZombo m: m: class C { has Str $.s;multi method s is rw {return-rw $!s};multi method s(Str:D \s){$!s:=s};submethod TWEAK(:$s){ self.s($s)} };my $a=C.new(:s<a>);my $s='aaaaaaaaaa';$a.s($s.substr-rw(2,3));$a.s('asd');say ($a,$s)
14:49 camelia rakudo-moar 8ccb60e39: OUTPUT: «(C.new(s => "asd") aaaaaaaaaa)␤»
14:51 comborico1611 joined #perl6
14:55 dakkar joined #perl6
14:55 markmont joined #perl6
14:56 ZzZombo joined #perl6
14:56 ZzZombo joined #perl6
15:00 ZzZombo joined #perl6
15:05 zakharyas joined #perl6
15:12 khw joined #perl6
15:26 wander joined #perl6
15:27 wander m: my token x { 0 }; say "001" ~~ /$<var>=<x> $<var>/
15:27 camelia rakudo-moar 8ccb60e39: OUTPUT: «Nil␤»
15:27 wander m: my token x { 0 }; say "001" ~~ /$<var>=<x>/
15:27 camelia rakudo-moar 8ccb60e39: OUTPUT: «「0」␤ var => 「0」␤ x => 「0」␤»
15:27 wander what happens here?
15:27 wander m: my token x { 0 }; say "001" ~~ /$<var>=<x> {} $<var>/
15:27 camelia rakudo-moar 8ccb60e39: OUTPUT: «Nil␤»
15:27 wander I capture a named capture, but cannot refer it later
15:29 perlpilot m: my token x { 0 }; say "001" ~~ /$<var>=(<x>) {} $<var>/
15:29 camelia rakudo-moar 8ccb60e39: OUTPUT: «「00」␤ var => 「0」␤  x => 「0」␤»
15:29 perlpilot m: my token x { 0 }; say "001" ~~ /$<var>=[<x>] {} $<var>/
15:29 camelia rakudo-moar 8ccb60e39: OUTPUT: «「00」␤ var => 「0」␤ x => 「0」␤»
15:30 moritz wander: <var=&x> would be the correct syntax
15:30 moritz m: my token x { 0 }; say "001" ~~ / <var=&x> {} <var> /
15:30 camelia rakudo-moar 8ccb60e39: OUTPUT: «No such method 'var' for invocant of type 'Match'␤  in block <unit> at <tmp> line 1␤␤»
15:30 moritz m: my token x { 0 }; say "001" ~~ / <var=&x> {} $<var> /
15:30 camelia rakudo-moar 8ccb60e39: OUTPUT: «「00」␤ var => 「0」␤»
15:31 perlpilot Still ... I think wander has elucidated a trap that someone might fall into.   I wonder if we can better help the poor user?
15:32 ZzZombo joined #perl6
15:32 ZzZombo joined #perl6
15:33 wander see
15:36 wander m:  my token x { 0 }; say "001" ~~ /$<var>=[<x>] $<var>/
15:36 camelia rakudo-moar b860dea45: OUTPUT: «「00」␤ var => 「0」␤ x => 「0」␤»
15:37 wander I think this syntax is more elegant.
15:41 ZzZombo joined #perl6
15:44 bdmatatu joined #perl6
15:46 mcmillhj joined #perl6
15:50 robertle joined #perl6
15:54 wander m: say "abc".subst(/(\w)/, "{$/[0]}0", :g)
15:54 camelia rakudo-moar b860dea45: OUTPUT: «Use of Nil in string context␤000␤  in block <unit> at <tmp> line 1␤»
15:54 wander oops
15:55 wander m:  say "abc".subst(/(\w)/, "{$/[0]}0", :g)
15:55 camelia rakudo-moar b860dea45: OUTPUT: «Use of Nil in string context␤000␤  in block <unit> at <tmp> line 1␤»
15:55 wander it prints "c0c0c0" in my local REPL
15:56 timotimo m:  say "abc".subst(/(\w)/, * ~ 0, :g)
15:56 camelia rakudo-moar b860dea45: OUTPUT: «a0b0c0␤»
15:56 timotimo better to give it a code block that takes a $/ (or whatever) argument
15:56 timotimo m:  say "abc".subst(/(\w)/, *[0] ~ 0, :g) # more precisely what you had before
15:56 camelia rakudo-moar b860dea45: OUTPUT: «a0b0c0␤»
15:57 Cabanossi joined #perl6
16:00 wander m: say "abc".subst(/$<var>=[\w](\w)/, *<var>~"0"~*[0], :g)
16:00 camelia rakudo-moar b860dea45: OUTPUT: «Too few positionals passed; expected 2 arguments but got 1␤  in block <unit> at <tmp> line 1␤␤»
16:00 mcmillhj joined #perl6
16:00 wander hah..what if captures gone more than one
16:01 moritz use a proper code block
16:01 ilmari m: say "abc".subst(/$<var>=[\w](\w)/, { $^a<var>~"0"~$^a[0]}, :g)
16:01 camelia rakudo-moar b860dea45: OUTPUT: «a0bc␤»
16:02 ilmari m: say "abc".subst(/$<var>=[\w](\w)/, { $/<var>~"0"~$/[0]}, :g)
16:02 camelia rakudo-moar b860dea45: OUTPUT: «a0bc␤»
16:04 wander oh, i used to think subst takes a Str as the second parameter
16:04 ilmari s: Str, &subst
16:04 SourceBaby ilmari, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Undeclared routine:␤    subst used at line 6. Did you mean 'substr'?␤␤
16:05 ilmari s: Str, subst
16:05 SourceBaby ilmari, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Undeclared routine:␤    subst used at line 6. Did you mean 'substr'?␤␤
16:05 ilmari SourceBaby: help
16:05 SourceBaby ilmari, Use s: trigger with args to give to sourcery sub. e.g. s: Int, 'base'. See http://modules.perl6.org/dist/CoreHackers::Sourcery
16:05 ilmari s: Str, 'subst'
16:05 SourceBaby ilmari, Sauce is at https://github.com/rakudo/rakudo/blob/4fca94743/src/core/Str.pm#L1134
16:05 ilmari wander: it can take a str, but it can also take a Callable
16:05 ilmari https://docs.perl6.org/routine/subst.html#Callable
16:06 ilmari the match object will be in $/, $_ and passed as an argument
16:07 geospeck joined #perl6
16:11 zakharyas joined #perl6
16:15 troys joined #perl6
16:16 mcmillhj joined #perl6
16:19 raschipi joined #perl6
16:20 squashable6 joined #perl6
16:25 raschipi Debian is thinking about enabling automatic uploads on upstream release.
16:27 mcmillhj joined #perl6
16:30 kaare__ joined #perl6
16:34 Brumbazz joined #perl6
16:40 DrForr Is the API for how the --doc option works specified somewhere?
16:40 DrForr Pod::To::HTML exports pod2html and a few other subroutines, and while I could look at the code to see what's actually being run, an official place would be nice.
16:40 st_elmo joined #perl6
16:42 chsanch joined #perl6
16:43 callyalater joined #perl6
16:44 mcmillhj joined #perl6
16:49 itaipu joined #perl6
16:50 wamba joined #perl6
16:50 chsanch Hi, I've just compiled Rakudo on Windows 10, but I don't know if I have to do something else besides execute:  'chcp 65001' to handle utf8 characteres in cmd.exe or powershell, this what I'm getting if I use an "ñ" inside a string variable: https://ibb.co/e24nV6
16:53 [Coke] m: my $s = "eñe"; $s.encode('utf8').say
16:53 camelia rakudo-moar 47ebc4ab2: OUTPUT: «utf8:0x<65 c3 b1 65>␤»
16:53 [Coke] OOC, does that work?
16:54 chsanch > my $s = "eñe"; $s.encode('utf8').say
16:55 chsanch utf8:0x<65 00 65>
16:55 mcmillhj joined #perl6
16:56 [Coke] huh
16:59 ugexe what if you dont use the repl
17:01 ugexe if i try to use that in the repl i get '> Decoder may not be used concurrently' on repeat
17:03 chsanch perl6 .test.p6
17:03 chsanch utf8:0x<65 c3 b1 65>
17:03 chsanch it seems it works if I execute it in a script
17:04 zakharyas joined #perl6
17:05 Brumbazz joined #perl6
17:05 ugexe what if you do perl6 -e "my $s = 'eñe'; $s.encode('utf8').say"
17:09 mcmillhj joined #perl6
17:09 chsanch C:\>perl6 -e "my $s = 'eñe'; $s.encode('utf8').say"
17:09 chsanch utf8:0x<65 c3 b1 65>
17:10 khw joined #perl6
17:11 chsanch but, in powershell I'm getting an error: https://gist.github.com/anonymous/df47676a165980544877faf146857199
17:11 Zoffix joined #perl6
17:11 jnthn Powershell is probably interpreting the $ as a shell variable
17:12 Zoffix chsanch: the REPL problem was recently mentioned on a ticket. It's bustitude in prompt (which the REPL uses): https://rt.perl.org/Public/Bug/Display.html?id=132441#txn-1508132
17:13 chsanch Oh ok, I see
17:13 chsanch I need to go now, I'll check this later. Thanks!!!
17:17 Zoffix looks to be a problem in moarvm. perl6 -e "say $*IN.read-internal(1000)" gives an empty buf (Buf[uint8]:0x<>) if the input got fancypants chars
17:20 jnthn wat, the bytes even come out wrong?
17:20 Zoffix yea
17:21 jnthn We...just call read: https://github.com/MoarVM/MoarVM/blob/master/src/io/syncfile.c#L144
17:22 Zoffix _read https://msdn.microsoft.com/en-us/library/wyssk1bs.aspx
17:22 Zoffix It's redefined by a macro
17:22 jnthn Right, to _read
17:22 * Zoffix tries with a file
17:23 zakharyas joined #perl6
17:23 jnthn We're putting the thing in binary mode too: https://github.com/MoarVM/MoarVM/blob/master/src/io/syncfile.c#L496
17:23 Zoffix Works with a file. My guess it's the not-a-proper-filehandle thing so it returns 0 bytes read.
17:23 jnthn So shouldn't be any weirdness from text mode
17:24 jnthn But only for certain input?
17:24 Zoffix Oh right... Weird :)
17:25 * lizmat clickbaits https://p6weekly.wordpress.com/2017/11/20/2017-47-more-tpcia-videos/
17:25 jnthn Very weird. But I already have one workaround for _read doing weird things with a console
17:25 jnthn (If you ask for more than 16KB it dies)
17:26 jnthn So it wouldn't surprise me in the least if there's yet more weird, though at least that case gave an error, not an empty buffer...
17:26 timotimo m(
17:27 itaipu joined #perl6
17:28 * jnthn wanders home
17:29 mcmillhj joined #perl6
17:29 domidumont joined #perl6
17:31 perlpilot That question on SO about hashes having an update method ... sounds like that's something Perl 6 could borrow.
17:31 perlpilot https://stackoverflow.com/questions/47407372/does-perl-6-have-an-equivalent-to-pythons-update-method-on-dictionary
17:32 perlpilot The answers that are there are all awkward IMHO
17:32 konsolebox joined #perl6
17:35 * lizmat likes "%hash ,= %u;"
17:36 ilmari ooh, nice
17:36 perlpilot aye, that's my favorite but in the spirit of timtowtdi, could we not have .update() as well?
17:40 Zoffix left #perl6
17:41 mcmillhj joined #perl6
17:41 ilmari or .merge() ?
17:42 itaipu joined #perl6
17:43 moritz .merge sounds to me like it'd handle multiple levels of hashes
17:43 ilmari point
17:44 timotimo javascript has Object.assign which allows you to merge multiple objects i believe
17:48 mcmillhj joined #perl6
17:49 konsolebox_ joined #perl6
17:56 Cabanossi joined #perl6
17:58 mcmillhj joined #perl6
17:59 cdg joined #perl6
18:09 Khisanth joined #perl6
18:14 mcmillhj joined #perl6
18:22 telex joined #perl6
18:30 mcmillhj joined #perl6
18:43 buggable New CPAN upload: SemVer-0.1.0.tar.gz by TYIL https://cpan.metacpan.org/authors/id/T/TY/TYIL/Perl6/SemVer-0.1.0.tar.gz
18:57 Geth ¦ doc: 2cc35cb228 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/operators.pod6
18:57 Geth ¦ doc: Document `does` can take non-composable :Ds on RHS
18:57 synopsebot Link: https://doc.perl6.org/language/operators
18:57 Geth ¦ doc:
18:57 Geth ¦ doc: Rakudo impl: https://github.com/rakudo/rakudo/commit/575d31e251
18:57 Geth ¦ doc: Spec: https://github.com/perl6/roast/commit/344d6d50a0
18:57 Geth ¦ doc: review: https://github.com/perl6/doc/commit/2cc35cb228
19:07 mcmillhj joined #perl6
19:12 Cabanossi joined #perl6
19:28 Geth ¦ doc: 2cd2a4fe3f | (Jan-Olof Hendig)++ | doc/Language/grammar_tutorial.pod6
19:28 synopsebot Link: https://doc.perl6.org/language/grammar_tutorial
19:28 Geth ¦ doc: Add missing =SUBTITLE
19:28 Geth ¦ doc: review: https://github.com/perl6/doc/commit/2cd2a4fe3f
19:47 evalable6 joined #perl6
20:03 raiph joined #perl6
20:11 zakharyas joined #perl6
20:17 Brumbazz joined #perl6
20:31 ChoHag joined #perl6
20:49 TEttinger joined #perl6
20:56 geospeck joined #perl6
21:11 Cabanossi joined #perl6
21:20 Brumbazz joined #perl6
21:26 kyan joined #perl6
21:33 buggable New CPAN upload: App-Cpan6-0.17.2.tar.gz by TYIL https://cpan.metacpan.org/authors/id/T/TY/TYIL/Perl6/App-Cpan6-0.17.2.tar.gz
21:36 kitsunenokenja joined #perl6
21:38 cdg joined #perl6
21:44 xi- joined #perl6
21:48 mson joined #perl6
22:03 xi- joined #perl6
22:12 mcmillhj joined #perl6
22:24 b2gills joined #perl6
22:25 itaipu joined #perl6
22:26 markong joined #perl6
22:27 mcmillhj joined #perl6
22:31 comborico1611 joined #perl6
22:37 mcmillhj joined #perl6
22:40 cdg joined #perl6
22:42 Cabanossi joined #perl6
22:51 mcmillhj joined #perl6
22:53 markmont joined #perl6
22:56 Altreus If class Y is X, can I change an object of type X into type Y?
22:57 Altreus I'd like to extend XML::Document, and also have its routines return typed nodes
22:57 Altreus its methods
22:58 gfldex m: class B { method m { return self } }; class A is B {}; say A.new.m.^name;
22:58 camelia rakudo-moar 575d31e25: OUTPUT: «A␤»
22:58 gfldex Altreus: ^^^
22:59 Altreus gfldex: sure, but XML::Document.lookfor returns an array of XML::Element objects
22:59 Altreus And I want to extend XML::Element with several new types
23:00 gfldex Altreus: I can't see why that should be a problem.
23:00 Altreus So is there a better way than doing «MyElementType.new($_) for (get some elements)» ?
23:01 gfldex Altreus: you will have to overload the method that is doing the parsing
23:02 Altreus but surely I'd just be doing the above in that method/
23:02 Altreus Otherwise I'd have to reimplement its entire behaviour just to change the type of object it returns
23:03 gfldex Altreus: this might help: https://gfldex.wordpress.com/2017/10/08/its-classes-all-the-way-down/
23:06 xi- joined #perl6
23:09 timotimo Altreus: perhaps what you want can be done by just mixing in roles
23:09 Altreus I was thinking along those lines
23:09 timotimo otherwise, rebless could work, but it's internalsy (use nqp; nqp::rebless(NewType, $object) or the other way around)
23:10 Altreus but then I thought, now it's a role
23:10 Altreus So it doesn't have to go on an XML::Element
23:10 Altreus So *then* I thought, how do I provide a different version of the method depending on what I mix it into?
23:10 Altreus It doesn't matter, but academically...
23:11 Altreus 🤔 Can I overload the method based on the type of $self?
23:11 mcmillhj joined #perl6
23:13 jnthn m: role R { multi method m(Int:) { "Int!" }; multi method m(Str:) { "Str!" } }; say (1 but R).m; say ("foo" but R).m
23:13 camelia rakudo-moar 575d31e25: OUTPUT: «Int!␤Str!␤»
23:13 jnthn Something like that?
23:13 Altreus yeah :D
23:13 Altreus hey that's what I expected
23:13 Altreus thanks ^-^
23:13 jnthn Wasn't quite sure what you were after; glad I guessed right :)
23:17 ChoHag joined #perl6
23:24 mcmillhj joined #perl6
23:25 AlexDaniel jnthn: any progress with whateverable segv? Any assistance I can provide?
23:26 Altreus I seem to have invented an infinite loop
23:26 Cabanossi joined #perl6
23:30 jnthn AlexDaniel: Not yet; today I thought I'd try and quickly finish up a spesh change I was working on last week, and the *one* failing spectest uncovered a tricky issue that I then spent the rest of the day trying to work out how to try and solve...
23:31 AlexDaniel awesome
23:31 * AlexDaniel loves progress
23:31 jnthn Aye, just not on the whateverable segv, alas.
23:32 AlexDaniel someone's bug today is whateverable's bug tomorrow, so I'm happy with any progress :)
23:34 AlexDaniel hmm fwiw that seems to be the golfed version of #1262: https://gist.github.com/AlexDaniel/f7e43792ad2e4a29c3f13dfdf2453506
23:36 astronav_ joined #perl6
23:38 raschipi joined #perl6
23:43 mcmillhj joined #perl6
23:46 Altreus gosh, I spent all this time putting together a github thingy with an example XML file to ask why I have an infinite loop, and the example file I found on the internet doesn't give me an infinite loop D:
23:46 Altreus I can't tell you how pleasing it is to use the word 'but' in a program
23:48 ivans_ joined #perl6
23:55 markong joined #perl6
23:57 mcmillhj joined #perl6

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

Perl 6 | Reference Documentation | Rakudo