»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
00:01 w_richard_w left 00:02 andrzejku_ joined 00:03 w_richard_w1 left, leont left 00:04 andrzejku left, andrzejku_ is now known as andrzejku 00:09 w_richard_w joined 00:11 rindolf left 00:24 elcaro joined 00:35 pecastro left 00:39 w_richard_w left 00:52 reach_satori joined 01:00 sena_kun left 01:20 mns` left 02:04 cpan-p6 left, cpan-p6 joined 02:07 reach_satori left, reach_satori joined 02:13 molaf left 02:25 molaf joined 02:56 kurahaupo joined 03:01 kurahaupo_ joined, kurahaupo left, kurahaupo_ left 03:02 kurahaupo joined 03:13 kurahaupo left, kurahaupo joined, kurahaupo left 03:16 kurahaupo joined 03:26 markoong left 03:29 guifa joined
guifa Curiosity got me. Why are the proto regexes made to be {*}? Seems like it would make some sense to say something like proto token foo { {*} 'fix' }; token foo:sym<pre> { 'pre' }; token foo:sym<post> { 'post' }; 03:31
04:23 andrzejku_ joined 04:25 andrzejku left 04:26 andrzejku_ is now known as andrzejku 04:27 Cabanossi left 04:28 ToddAndMargo joined
ToddAndMargo Anyone on newbie detail tonight? 04:28
A question for the developers. sub xxx( Buf $YugeBuf is ro ) {some miricle} Is $YugeBuf (up to 100 MB) a copy of the entire variable or just the structure? I don't want the time hit of a copy 04:30
04:32 Cabanossi joined 04:36 kurahaupo_ joined, kurahaupo left
guifa ToddAndMargo: it seems to be 04:36
04:37 kurahaupo_ left
guifa p6: sub a (Buf $b) { say $b.WHERE }; my $c = Buf.new(1,2,3); say $c.WHERE; a($c) 04:38
camelia 139828431461220
139828431461220
04:39 kurahaupo joined 04:45 kurahaupo left
guifa Err, I meant that to be "Buf $b is readonly" but result is the same. 04:45
04:46 kurahaupo joined 04:48 aindilis left
guifa Even when you use "is copy", the copy doesn't get made until after the value has been modified. Seems Rakudo is smart in that regards: 04:49
p6: sub a ($a is copy) { say $a.WHERE; $a++; say $a.WHERE}; my $b = 1; say $b.WHERE; a($b)
camelia 140226293132168
140226293132168
140226293132208
04:49 aindilis joined
guifa Just be aware that readonly doesn't necessarily mean what you might think it does: 04:53
p6: sub a (Buf $b is readonly) { $b[0] = 0}; my $c = Buf.new(1,2,3); a($c); say $c
camelia Buf:0x<00 02 03>
05:00 kurahaupo_ joined, kurahaupo left, kurahaupo_ left 05:01 kurahaupo joined 05:09 cpan-p6 left 05:10 cpan-p6 joined 05:38 kyzn_ left 05:41 kyzn joined 05:55 curan joined 06:02 zacts joined, reach_satori left
ToddAndMargo Thank you! 06:06
$ p6 'sub a (Buf $b) { say $b.WHERE.base(0x10) }; my $c = Buf.new(1,2,3); say $c.WHERE.base(0x10); a($c);' 7F385D41334C 7F385D41334C 06:10
Is that a 64 bit address? 06:15
06:15 zacts left 06:18 jmerelo joined, mowcat left 06:26 molaf left 06:28 zacts joined
jmerelo releasable6: status 06:28
releasable6 jmerelo, Next release in ≈5 days and ≈12 hours. 11 blockers. 163 out of 293 commits logged
jmerelo, Details: gist.github.com/1f892ba35a53cb79f9...50438eb574
06:31 zacts left 06:34 kensanata joined 06:51 ToddAndMargo left 06:52 kensanata left
cpan-p6 New module released to CPAN! App-AizuOnlineJudge (0.0.1) by 03TITSUKI 06:55
07:05 w17t joined 07:14 ravenousmoose joined 07:18 domidumont joined 07:20 leszekdubiel joined 07:41 jmerelo left 07:42 w17t left 07:43 w17t joined 07:46 w17t left, w17t joined 07:47 ravenousmoose left 07:48 w17t left, w17t joined 07:51 ravenousmoose joined 07:59 w17t left 08:12 zakharyas joined
leszekdubiel in perl we can substitute and return result... erl -e 'my $x = "alfa"; my $y = $x =~ s/lf/X/r; print "$x, $y, \n"; ' alfa, aXa, 08:17
how to substitute and return modified string in perl6? 08:18
Ok... I have found that subst just returns, and $x ~~ s/../../ makes in place. Thank you. 08:21
Geth ecosystem: 79a4a07bdf | (Pawel Pabian)++ (committed using GitHub Web editor) | META.list
Removed module because MaxMind legacy databases are no longer available.

GeoIP2 (github.com/bbkr/GeoIP2) is the successor that supports all current MaxMind databases.
08:30
leszekdubiel Some more thougts on documentation from newbie point of view...
p6: my $s = "alfa"; my @a = 1, 2, 3; say "scalar is $s, array is @a; " 08:31
camelia scalar is alfa, array is @a;
leszekdubiel then I google "perl6 quoting" and landing on page: docs.perl6.org/language/quoting
Documentation is very good, bo I think not for novices, not for scientists I think who just want to make computations. 08:32
Why? Because at the top of the page there is Q quoting, instead of simple explanation that ' don't interpolate, and "" by default interpolates only $ and { and \. 08:33
What I do next? Go to perl6intro. Ctrl+F, find quoting. Did it explain why @ doesn't interpolate? No... 08:35
Anyway... I have read about Q and I know what I was looking for. 08:37
08:39 eseyman joined 08:40 saki joined 08:46 cpan-p6 left, ravenousmoose left, cpan-p6 joined 09:00 Ven`` joined
Ven`` o/ 09:01
09:03 robertle_ joined, rindolf joined 09:09 robertle1 joined, scimon joined 09:10 robertle_ left 09:11 dakkar joined
masak \o 09:15
m: class C { has @.a; method w { @!a.WHICH }; method clone { self.new(a => @!a) } }; my $c1 = C.new; say $c1.w; my $c2 = $c1.clone; say $c2.w
camelia Array|80353248
Array|81215032
masak in the above, the two @.a arrays are two distinct objects. is there a way to clone but to share the @.a object/reference between $c1 and $c2? 09:16
(toying around with a copy-on-write scheme for a common type of object in 007)
ufobat_ With Proxy? 09:18
masak m: class C { has @.a; submethod BUILD(:@a) { @!a := @a }; method w { @!a.WHICH }; method clone { self.new(a => @!a) } }; my $c1 = C.new; say $c1.w; my $c2 = $c1.clone; say $c2.w 09:19
camelia Array|82838200
Array|82838200
masak that seems to work
Ven`` That totally won't create hard-to-find bugs down the line..:-) 09:20
masak m: class C { has @.a; submethod BUILD(:@a) { @!a := @a }; method w { @!a.WHICH }; method clone { self.new(:@!a) } }; my $c1 = C.new; say $c1.w; my $c2 = $c1.clone; say $c2.w
camelia Array|81805416
Array|81805416
masak Ven``: the price of a good optimization is eternal vigilance ;)
Ven``
.oO( more tests for the TAP God! )
09:21
masak Ven``: this is for _007::OpScope, where operators and their precedence levels are currently *always* cloned, for every. single. new. block.
Ven`` that does sound a bit wasteful, yes. 09:22
masak they only need to be cloned-on-write, when there's actually a new operator in that block
I'm hoping this will speed up the test suite, which currently hovers around 68 seconds on my laptop.
Ven`` class Block { method opscope { $.current // $.parent.opscope }; method add-op(|) { $.current //= $.parent.opscoppe.clone; ... } } :P 09:23
masak ;)
by the way, I'm fairly convinced now that the only reason we even have opscopes is that the 007 parser isn't mutable enough 09:24
or some synonym of "mutable" that means "able to change" but doesn't sound disgusting to people who love purity ;) 09:25
Ven`` coughes 09:26
masak or, put differently, what's now the opscope should be widened and get more responsibilities (user-defined statement forms, for example), until eventually it encompasses the entire parser, or at least the parts of it that can change 09:28
if parsers then follow the opscope model, parsers literally *are* mutable within a given scope, but they get thrown away at the end of the block and the outer block's parser takes over again 09:32
Ven``: you do have a point about hard-to-find bugs, though. I guess it would be prudent to have a flag that says "always clone", so that one can compare the behavior with and without COW 09:37
09:44 saki left
Ven`` :+1: 09:47
09:49 abraxxa joined
moritz call it --glacier 09:56
10:26 AlexDaniel joined 10:34 dakkar left
masak aka "what we do currently" :P 10:35
10:39 leszekdubiel left 10:46 sena_kun joined 11:04 domidumont left
timotimo notable6: weekly There is now a <a href="discord.gg/gg2a3T6">Discord community</a> for all things Perl 6 (Raku). Come ask questions, provide answers, discuss news, share your work, and generally have a good time with other developers! 11:04
notable6 timotimo, Noted!
timotimo notable6: weekly <tyil> if it's interesting to note, this is the software in use for the bridge: github.com/reactiflux/discord-irc, and it's hosted on Kubernetes 11:05
notable6 timotimo, Noted!
11:13 dakkar joined 11:26 mns` joined 11:32 ravenousmoose joined 11:55 leont joined 12:00 reportable6 left, kerrhau left 12:01 shareable6 left, releasable6 left, squashable6 left, benchable6 left, notable6 left, undersightable6 left, releasable6 joined, ChanServ sets mode: +v releasable6, undersightable6 joined, ChanServ sets mode: +v undersightable6 12:02 Actualeyes joined, squashable6 joined 12:03 benchable6 joined, shareable6 joined, ChanServ sets mode: +v shareable6, reportable6 joined, ChanServ sets mode: +v reportable6 12:06 notable6 joined, cpan-p6 left, cpan-p6 joined
AlexDaniel weekly: `.t6` extension is a thing now. See github.com/perl6/user-experience/issues/36 and leave a comment (especially if you have something against it) 12:07
notable6 AlexDaniel, Noted!
AlexDaniel weekly: reportable (January): gist.github.com/Whateverable/5a7a2...938c8dd889 12:09
notable6 AlexDaniel, Noted!
12:27 markoong joined
cpan-p6 New module released to CPAN! MeCab (0.0.13) by 03TITSUKI 12:32
12:41 dogbert2_ joined 12:45 domidumont joined
cpan-p6 New module released to CPAN! Oyatul (0.0.6) by 03JSTOWE 12:48
tyil AlexDaniel: nice 12:57
scimon Who made the Twitter bot for new modules? It's generally a bit ahead of modules.perl6.org 13:04
So links to pages that don't exist.
ufobat_ can i mixin some grammar into a grammar while the grammar is parsing something(), if not how does slangs or macros work? 13:05
Geth ¦ ecosystem-unbitrot: titsuki self-assigned Algorithm::LBFGS github.com/perl6/ecosystem-unbitrot/issues/328 13:06
13:10 jmm_ joined 13:11 jmm_ left 13:12 lucasb joined 13:15 powerbit left
lizmat and another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2019/02/11/...squashing/ 13:17
cpan-p6 New module released to CPAN! Algorithm-LBFGS (0.0.4) by 03TITSUKI 13:18
guifa So custom operators are very easy to make. Is it possible to make a custom sigil? 13:20
discord6 <Vendethiel> Not really, no 13:23
tyil I don't think there's an easy way, at least
discord6 <Rogue> you can look at how the existing sigils are implemented in the grammar and work from there, but that's probably not what you want 13:25
guifa For some reason I had thought I had remembered reading a tutorial about doing a custom sigil, but google fu couldn't find it. May have been either a dream or maybe some article on hacking the innards or something 13:29
lucasb Maybe with a "slang" you could augment this token: github.com/rakudo/rakudo/blob/mast....nqp#L1831 13:32
discord6 <Rogue> a sigil nowadays is basically just a role restriction plus some special meaning for type constraints, isn't it?
13:35 kurahaupo left, kurahaupo_ joined 13:36 kurahaupo_ left, kurahaupo joined
daxim m: class Foo { has @.quux is required; has &.bar; method clone { nextwith :quux(@!quux.clone) }; }; my $f = Foo.new(quux => []); my $g = $f.clone(bar => sub { die }); dd $g; 13:37
camelia Foo $g = Foo.new(quux => [], bar => Callable)
daxim how do you clone-mixin a callable?
13:37 yqt joined
guifa Rogue: yeah. And a nice visual indicator to say/scream "I can do [Positional | Associative | Callable]" 13:43
13:47 yqt left 13:49 huf joined 13:53 zakharyas left
tbrowder .tell lizmat see private msg from me 13:55
yoleaux tbrowder: I'll pass your message to lizmat.
13:59 pmurias joined
pmurias great that we got a bunch of proposal in time for the gsoc application, I hope it get through 14:00
tyil same 14:07
14:07 avuserow left 14:14 curan left 14:22 saki joined 14:24 mowcat joined 14:34 stanley joined
stanley p6: say hi; 14:36
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
hi used at line 1
stanley p6: say 'hello';
camelia hello
14:39 mowcat left 14:44 skids joined 15:10 natrys joined 15:19 w17t joined 15:30 uzl joined
uzl Hello all! 15:31
yoleaux 7 Feb 2019 04:39Z <MasterDuke> uzl: you can find examples github.com/perl6/roast/blob/master...y-shapes.t and github.com/perl6/roast/blob/master...re/shape.t
8 Feb 2019 09:11Z <jjmerelo> uzl: it's going to be a book for APress, "Perl 6 quick reference". Already 4 chapters into it, will amount to 15 chapters. No bible, though.
15:31 cpan-p6 left, cpan-p6 joined
uzl .tell MasterDuke Thanks! I was kind of shortsighted because doing, for example, my @a[2].perl prints out how it'd be declared explicitly. ;-) 15:35
yoleaux uzl: I'll pass your message to MasterDuke.
uzl jmerelo: That sounds great. Congratulations!
I'm trying to p6doc a .pm6 file and I obtain an error. Details here: sprunge.us/CNL3SA 15:38
Any help/insight would be appreciated. I was going to post it on SO but I'm not sure if it's SO-worthy though! 15:39
tyil you need to include Foo/Walker.pm6 in your search path somehow 15:40
uzl: can u try `PERL6LIB="$(pwd)" p6doc <file.pm6>` 15:41
one of the downsides of pod6 is that it will execute the file, which includes the `use`s, to render the pod 15:42
15:43 saki left
uzl tyil: I'm running `PERL6LIB="$(pwd)" p6doc Person.pm6` but unfortunately getting the same error. 15:47
tyil hmm 15:48
do you have your code in a repo that I can look at?
15:57 reach_satori joined 16:02 stanley left 16:05 zakharyas joined
uzl tyil: not really! I was reading about Pod6 and playing with the declarator blocks. I can put what I linked to on Github though. 16:08
masak
uzl tyil: I don't any module skeleton. Just plain .pm6 files in a directory. 16:09
*have
16:10 htoc^ joined 16:11 Actualeyes left
uzl I'll be back later! 16:13
16:13 uzl left 16:14 Actualeyes joined 16:15 ravenousmoose left 16:31 zakharyas left 16:33 robertle1 left 16:35 jmerelo joined 16:38 ravenousmoose joined 16:40 ufobat___ joined 16:44 ufobat_ left 16:54 ravenousmoose left 16:57 yqt joined, abraxxa left 17:00 pmurias left
Altreus how does one perform a filesystem glob in perl6, or some equivalent? Given a directory, I know there's exactly 1 XML file in it, and I want to find it 17:03
and if there's more than one, whatever, I'll use the first 17:04
timotimo you want to use the dir sub
m: dir(*.ends-with('.md')).say
camelia No such method 'IO' for invocant of type 'WhateverCode'
in block <unit> at <tmp> line 1
timotimo m: dir('.', *.ends-with('.md')).say 17:05
camelia Cannot resolve caller dir(IO::Path:D: WhateverCode:D); none of these signatures match:
(IO::Path:D: Mu :$test = { ... }, *%_)
in block <unit> at <tmp> line 1
Altreus radical, thanks
timotimo m: dir('.', test => *.ends-with('.md')).say
camelia ()
timotimo m: dir('.').say
camelia (".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".…
timotimo m: dir('.', test => *.starts-with('.le')).say
camelia (".lesshst".IO)
Altreus tada \o/
using perl6 to make my thumbnails
17:09 mowcat joined
Altreus how would one use XML to replace the text of a node? Is it necessary to create a new XML::Text and replace all children of the parent node with it? 17:12
Cos that seems long-winded
I think I've got this wrong. I thought `x given y` ran x with $_ set to y iff y is defined 17:26
but it's complained about an Any
oh, actually nvm, it's a different Any 17:28
jmerelo Altreus: maybe a simple regex would do.
17:28 scimon left
Altreus is there a simple regex 17:34
17:34 dakkar left
Altreus it starts as a simple regex 17:34
and ends in tears :P
17:38 zacts joined
jnthn Altreus: It's `with` that does the definedness testing, not `given` 17:40
Altreus with! woops! 17:41
I was thinking 'when' but it seemed wrong
Turns out it was wrong, so yay 17:42
OK so we already made a mistake passing arguments in the wrong order so I would like to take more advantage of the fact P6 lets me put types in my method signature 17:45
The problem is, and has always been, that I can't constrain to a type it doesn't know about, but I can't include those types because they have circular dependencies
Any advice welcome here
hahainternet a type that is a circular reference is usually something exceptionally broken imho 17:48
jnthn Altreus: Extract a role to another module that both can `use` to break the circularity 17:49
17:50 ravenousmoose joined 17:53 domidumont left, ravenousmoose_ joined
Altreus hm right 17:56
That might be a good focus for a quick refactor as well
jmerelo Altreus: I don't know why people keep saying that... A simple regex can be faster than most XML libraries. And most of the time, is all it takes. 17:57
Altreus experience usually 17:58
jnthn: that sounds very much like having a .h and a .c :)
a .cpp for sure
18:02 ravenousmoose left, woolfy left, woolfy joined 18:04 ravenousmoose_ left
cpan-p6 New module released to CPAN! GraphQL-Server (0.1) by 03CTILMES 18:10
New module released to CPAN! CroX-HTTP-Transform-GraphQL (0.1) by 03CTILMES
New module released to CPAN! GraphQL (0.6.1) by 03CTILMES
Geth doc: bb92b0d0bb | (JJ Merelo)++ | doc/Type/Mu.pod6
Clarifies say in Mu, closes #2619
18:21
synopsebot Link: doc.perl6.org/type/Mu
18:34 zacts left
Xliff_ Altreus: Have any code that shows the circularity? 18:35
18:35 Xliff_ is now known as Xliff 18:38 ravenousmoose joined, ravenousmoose is now known as ravenousmoose[aw 18:39 ravenousmoose[aw left 18:40 zakharyas joined 18:42 patrickb joined 18:51 molaf joined 18:53 ravenousmoose joined 18:57 mns` left 18:59 pecastro joined 19:02 jme` left
Geth doc: d73ab8cf57 | Coke++ | doc/Language/hashmap.pod6
whitespace
19:07
synopsebot Link: doc.perl6.org/language/hashmap
doc: 8935f13ad9 | Coke++ | doc/Language/hashmap.pod6
"subhashes" isn't referenced elsewhere in docs

  (and would have to be added to the spell checker)
try to clarify but not define a specific usage.
19:10 zachk joined, zakharyas left 19:14 zachk left, zachk joined 19:18 zacts joined 19:27 sauvin left 19:29 cpan-p6 left, cpan-p6 joined 19:30 Peter_R left 19:32 Kaiepi left
Geth doc: 6126c6c35d | (Martin Barth)++ (committed using GitHub Web editor) | doc/Type/Mu.pod6
added missing link pod syntax
19:45
synopsebot Link: doc.perl6.org/type/Mu
jmerelo ufobat___: thanks! 20:00
ufobat___ sure
20:00 jmerelo left
Geth doc: 1993a30685 | Coke++ | 2 files
no preposition needed with 'trust'
20:01
20:17 zacts left 20:23 Actualeyes left 20:35 yqt left 20:38 ravenousmoose left 20:39 ravenousmoose joined, ravenousmoose is now known as ravenousmoose[aw 20:40 ravenousmoose[aw left, ravenousmoose_ joined 20:50 ravenousmoose_ left 20:53 drolax joined 21:04 jme` joined 21:28 jme` left 21:50 patrickb left, dct joined 21:58 patrickb joined 22:12 MasterDuke joined, MasterDuke left, MasterDuke joined 22:20 skids left 22:22 lucasb left 22:23 rindolf left 22:31 rindolf joined 22:35 leszekdubiel joined 22:53 jme` joined
Altreus imagine if this syntax were a real assignment: $x ~~ s[...] = ... 22:57
So then you could do my $subst = $x ~~ s[...];
22:58 natrys left
Altreus (I tried it but it's not :<) 22:59
22:59 drolax left 23:00 leszekdubiel left 23:04 sena_kun left 23:07 cpan-p6 left 23:08 cpan-p6 joined 23:40 obfusk_ joined, esh_ joined 23:41 sjn_ joined, integral_ joined 23:42 bhm_ joined, Juerd_ joined, pecastro left 23:44 ecocode_ joined 23:45 Mithaldu` joined, mephinet- joined 23:46 reu_ joined, molaf left, obfusk left, Juerd left, alpha6 left, pnu__ left, mrsolo left, sjn left, integral left, Juerd_ is now known as Juerd 23:48 patrickb left 23:54 kerrhau joined