»ö« 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.
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
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
guifa ToddAndMargo: it seems to be 04:36
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
guifa Err, I meant that to be "Buf $b is readonly" but result is the same. 04:45
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
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>
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
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
cpan-p6 New module released to CPAN! App-AizuOnlineJudge (0.0.1) by 03TITSUKI 06:55
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
Ven`` o/ 09:01
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
Ven`` :+1: 09:47
moritz call it --glacier 09:56
masak aka "what we do currently" :P 10:35
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!
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!
cpan-p6 New module released to CPAN! MeCab (0.0.13) by 03TITSUKI 12:32
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
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?
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?
guifa Rogue: yeah. And a nice visual indicator to say/scream "I can do [Positional | Associative | Callable]" 13:43
tbrowder .tell lizmat see private msg from me 13:55
yoleaux tbrowder: I'll pass your message to lizmat.
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
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
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.
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
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?
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
uzl I'll be back later! 16:13
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
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.
Altreus is there a simple regex 17:34
Altreus it starts as a simple regex 17:34
and ends in tears :P
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
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
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
Xliff_ Altreus: Have any code that shows the circularity? 18:35
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.
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
Geth doc: 1993a30685 | Coke++ | 2 files
no preposition needed with 'trust'
20:01
Altreus imagine if this syntax were a real assignment: $x ~~ s[...] = ... 22:57
So then you could do my $subst = $x ~~ s[...];
Altreus (I tried it but it's not :<) 22:59