»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 May 2018.
Geth doc: 8293246c0a | (Ben Davies)++ | 3 files
Simplify util/perl-nbsp.p6
00:12
Kaiepi thanks zoffix 00:13
Zoffix eco: author:elizabeth 00:25
buggable Zoffix, Found 70 results: List::UtilsBy, P5-X, Hash::Util, List::AllUtils, List::MoreUtils. See modules.perl6.org/s/author%3Aelizabeth
Zoffix 70!
Geth doc: bf181d1eb3 | (Will "Coke" Coleda)++ | doc/Language/system.pod6
remove duplicate word
00:43
doc: 6dcb91772a | (Will "Coke" Coleda)++ | doc/Type/Attribute.pod6
fix compilation
synopsebot Link: doc.perl6.org/language/system
synopsebot Link: doc.perl6.org/type/Attribute
Geth doc: fdbc09e822 | (Will "Coke" Coleda)++ | doc/Language/nativecall.pod6
fix pod error
00:47
synopsebot Link: doc.perl6.org/language/nativecall
Geth doc: 0c413c2060 | (Will "Coke" Coleda)++ | doc/Language/system.pod6
fix pod error; pass links test
00:48
Geth doc: ff2ed63356 | (Will "Coke" Coleda)++ | Makefile
fix xtest test order; simple first
00:50
Geth doc/coke/build: 18 commits pushed by (Will "Coke" Coleda)++
review: github.com/perl6/doc/compare/b7fc7...9422715b40
01:26
Geth doc: 6ae7cf8e69 | (Ben Davies)++ | 3 files
Match linebreaks between Perl and 5/6 in util/perl-nbsp.p6
01:54
Kaiepi jesus that was way more annoying to write than it should've been 01:57
rouking Hey folks, I am watching one of jnthn's talks about concurrency, and I was wondering why the `.start(...).migrate()` pattern uses a supply of supplies rather than a supply of promises. Wouldn't promsises make more sense, since each supply coming through that topmost supply will only ever produce one value? 02:05
kerrhau rouking: hello 02:08
Kaiepi is there some way to escape < and > inside C<> pod blocks? 05:02
Xliff_ What is the recommended way to predefine a regex for when you need circular dependency? 05:29
TEttinger Xliff_: pray to The Lurker in Darkness that he might spare your mind as you attempt to parse the infinite 05:56
Kaiepi worked out my problem, just needed to use C«» instead of C<> to put < and > inside the tag 05:58
Geth doc: 09c4084b12 | (Ben Davies)++ | doc/Language/js-nutshell.pod6
Fix formatting in language/js-nutshell.pod6
05:59
synopsebot Link: doc.perl6.org/language/js-nutshell
Xliff_ TEttinger: You do know that when you Look at the Lurker, the Lurker looks back? 06:15
Geth doc: e1b7553fcb | (JJ Merelo)++ | 4 files
Fixes two breaking space instances
06:22
doc: 94f9d75886 | (JJ Merelo)++ | 5 files
Adds detection of breaking space across lines

Also reflows and fixes files where it's found. Closes #2066
doc: 6601343c30 | (JJ Merelo)++ | Makefile
Moves :Z to an independent variable

To avoid problems with BSD make. Closes #2065
06:50
andrzejku hello :) 07:38
rindolf andrzejku: hey 07:42
andrzejku: what's up?
Geth doc: 3e49ef786f | (JJ Merelo)++ | 4 files
Re-indexing "trait is default"

There was a bogus category generated, as well as some other problems. There's still a problem referenced in #1823 comments, but at least a new bogus category (which wasn't even in #1410) has been eliminated.
07:46
doc: e58ebb4e17 | (JJ Merelo)++ | doc/Language/functions.pod6
Reflow and minor grammar adjustments
07:52
synopsebot Link: doc.perl6.org/language/functions
Geth doc: 419a8f8bdd | (JJ Merelo)++ | doc/Language/structures.pod6
Starts with data structures refs #114
07:58
synopsebot Link: doc.perl6.org/language/structures
andrzejku rindolf: fine :) 08:07
AlexDaniel jmerelo: pm :) 09:01
Summertime I noticed that there is very little facilities for sticking two lists together, is it just because its not seen as needed? (due to how versatile slips seem to be?) 09:54
moritz usually you can use the comma operator, and if the context is sufficiently flattening, tha works 10:00
m: my @a = <a b c>; my @b = 1..3; my @c = @a, @b; say @c.perl 10:01
camelia [["a", "b", "c"], [1, 2, 3]]
moritz huh, not flattening enough :(
m: my @a = <a b c>; my @b = 1..3; my @c = flat @a, @b; say @c.perl
camelia ["a", "b", "c", 1, 2, 3]
lizmat moritz: that was the single arg rule in action :-)
moritz :( 10:02
moritz somehow has a brainz blockade when it comes to understanding post-GLR semantics
lizmat m: my @a = ^5; my @b = <a b c d e>; my @c = (|@a,|@b); dd @c # expected 10:03
camelia Array @c = [0, 1, 2, 3, 4, "a", "b", "c", "d", "e"]
lizmat m: my @a = ^5; my @b = <a b c d e>; my @c = (@a,@b).>>Slip # *not* expected, is this a bug ?
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing dot on method call
at <tmp>:1
------> 3 my @b = <a b c d e>; my @c = (@a,@b).>>7⏏5Slip # *not* expected, is this a bug ?
expecting any of:
postfix
lizmat m: my @a = ^5; my @b = <a b c d e>; my @c = (@a,@b)>>.Slip # *not* expected, is this a bug ?
camelia ( no output )
lizmat m: my @a = ^5; my @b = <a b c d e>; my @c = (@a,@b)>>.Slip; dd @c # *not* expected, is this a bug ?
camelia Array @c = [slip(0, 1, 2, 3, 4), slip("a", "b", "c", "d", "e")]
lizmat m: my @a = ^5; my @b = <a b c d e>; my @c = (@a,@b)>>.Slip; dd $_ for @c 10:04
camelia Slip @c = $(slip(0, 1, 2, 3, 4))
Slip @c = $(slip("a", "b", "c", "d", "e"))
lizmat itemized slips... hmmm
Summertime seems to only be the hyper too? other methods for slipping a list seem to work fine 10:20
lizmat Summertime: yeah, that's why I wonder whether that's a bug or not 10:21
it was at least a bit of a WAT to me 10:22
Summertime either a bug or needs documentin', either way, I've ended up going with sub infix:<cc>{|@^a,|@^b} as a concat operator
I just don't know if I'll ever need it now though :(
Summertime then again it allows for collecting values using cc=, which also makes a smiley face which is neat 10:26
Zoffix Summertime: I presume you know about `flat` and `append`? 10:53
m: my @a = <a b c>; my @b = <d e f>; @a .= append: @b; dd @a; 10:54
camelia Array @a = ["a", "b", "c", "d", "e", "f"]
Zoffix This one mutates one of the lists
m: my @a = <a b c>; my @b = <d e f>; my @c = flat @a, @b, @a, @b, @a, @b; dd @c;
camelia Array @c = ["a", "b", "c", "d", "e", "f", "a", "b", "c", "d", "e", "f", "a", "b", "c", "d", "e", "f"]
Zoffix And this one makes a newone
lizmat: if it'd decont, then those cells in the returned Array would no longer be mutable, I think 10:55
m: my @a = ^5; my @b = <a b c d e>; my @c = (@a,@b)».Slip».uc; dd $_ for @c
camelia Str @c = "0"
Str @c = "1"
Str @c = "2"
Str @c = "3"
Str @c = "4"
Str @c = "A"
Str @c = "B"
Str @c = "C"
Str @c = "D"
Str @c = "E"
Zoffix m: my @a = ^5; my @b = <a b c d e>; my @c = (@a,@b)».Slip».self; dd @c 10:56
camelia Array @c = [0, 1, 2, 3, 4, "a", "b", "c", "d", "e"]
Zoffix m: my @a = ^5; my @b = <a b c d e>; my @c = (@a,@b)».Slip; @c[0] = 42; dd @c
camelia Array @c = [42, slip("a", "b", "c", "d", "e")]
Zoffix m: my @a = ^5; my @b = <a b c d e>; (my @c)[0] := (@a,@b)».Slip.head; @c[0] = 42; dd @c
camelia Cannot assign to an immutable value
in block <unit> at <tmp> line 1
Zoffix m: dd (<a b c>.Slip.item, <z y z>.Slip.item) 10:58
camelia ("a", "b", "c", "z", "y", "z")
Zoffix lizmat: nm, I don't get how it works..
Kaiepi m: <a b c>.index('b') 11:04
camelia ( no output )
Kaiepi m: dd <a b c>.index('b')
camelia 2
Kaiepi m: dd <a b c>.grep('b', :k).head
camelia 1
Kaiepi is there a simpler way to get the index of an element in an array?
lizmat m: dd <aa b c>.index('b') # wrong way 11:06
camelia 3
lizmat .index coerces to Str, and then looks up what you give it
Kaiepi i know, that's why i gave the second example 11:07
lizmat Kaiepi: if you only want to know the first occurrence, you can use 'first' 11:09
tbrowder_ nqp: my $r := /[ \x[0020] # space \n ]>+/;
camelia Regex not terminated. at line 2, near ""
at gen/moar/stage2/NQPHLL.nqp:701 (/home/camelia/rakudo-m-inst-1/share/nqp/lib/NQPHLL.moarvm:panic)
from gen/moar/stage2/NQPP6QRegex.nqp:75 (/home/camelia/rakudo-m-inst-1/share/nqp/lib/NQPP6QRegex.moarvm:throw_r…
lizmat m: dd <a b c>.first('b', :k) 11:10
camelia 1
Kaiepi thanks
lizmat m: dd <a b c d e b>.first('b', :k, :end) # and the last one
camelia 5
tbrowder_ nqp: my $r := /<[ \x[0020] # space \n ]>+/; 11:11
camelia ( no output )
Qwerasd If I have a Parameter object how can I get the type as a string? 11:52
yoleaux 25 May 2018 14:55Z <b2gills> Qwerasd: `for @arr.kv -> $i, $_ { @arr.splice($i,1) when 5 }`
Qwerasd What?
m: say (-> Str @a {}).signature.params[0].type
camelia (Positional[Str])
Qwerasd How would I coerce that in to a string that just says "Str" 11:53
moritz m: say (-> Str @a {}).signature.params[0].type.of 11:54
camelia (Str)
moritz m: say (-> Str @a {}).signature.params[0].type.of.^name
camelia Str
moritz Qwerasd: ^^
Qwerasd Thank you!
Can you explain what the .of is about?
moritz docs.perl6.org/type/Positional#method_of
Qwerasd Thanks! 11:55
buggable New CPAN upload: Digest-BubbleBabble-0.0.1.tar.gz by KAIEPI cpan.metacpan.org/authors/id/K/KA/...0.1.tar.gz 12:03
timotimo lizmat: i could imagine the >>.Slip resulting in a 2-element-array comes from "hyper tries its best to keep structure of its input" 12:35
[Coke] /win 3
buggable [Coke], Thank you for entering Accidental /win Lottery! The next draw will happen in 4 days, 11 hours, 24 minutes, and 7 seconds
Xliff_ Is there any way I can pass a rule to a subroutine, use it in a regexp and preserve all of the capture rules within it? 13:56
<Xliff_> m: my rule d { <ws><ident><ws> }; say "ddd" ~~ /<d>/
「ddd」
d => 「ddd」
ws => 「」
ident => 「ddd」
ws => 「」
^^ This is what I want to get, but as soon as I send it to a container:
<Xliff_> m: my rule d { <ws><ident><ws> }; my $r = /d/; say "ddd" ~~ /<$r>/
「d」
timotimo well, there you're just matching a literal d 13:57
the rule d isn't even being used at all 13:58
m: my rule d { <ws><ident><ws> }; my $r = /<d>/; say "ddd" ~~ /<$r>/
camelia 「ddd」
timotimo but yeah, it looks like it doesn't preserve the structure
m: my rule d { <ws><ident><ws> }; my $r = /<d>/; say "ddd" ~~ $r
camelia 「ddd」
d => 「ddd」
ws => 「」
ident => 「ddd」
ws => 「」
Xliff_ O 13:59
Thanks!
timotimo if the "r" is supposed to be dynamic, use the ::("&r") trick again
Xliff_ Right, because I may need to use $r in another dynamic regex. 14:01
So in the case of the rule, I want the <ident> part to be specified by a container. 14:02
OK. Longer story. 14:03
I want to perform unit tests of rules in my grammar. So I need to test certain rules individually, but I want to make sure they are anchored, as they would be in the greater grammar.
So I want to write something like "rule test { <ws><$dynamicRule><ws> };" and then test strings against rule test. 14:04
But I want to do that in a way that the structure of $dynamicRule is preserved.
Xliff_ throws his hands up in confusion.... 14:17
ᕕ༼ ͠ຈ Ĺ̯ ͠ຈ ༽┌∩┐ 14:18
(╬゚◥益◤゚)
I will gist this as soon as I calm back down.
moritz Xliff_: you have to capture is explicitly
rule test { <ws> [$<dynamic>=<$dynamic_Rule>] <ws> } 14:19
Xliff_ moritz: Yes, and I have a rule that works perfectly in the positive case, and in the negative case, something is gobbling up symbols and not failing.
Xliff_ moritz++ 14:19
Xliff_ gist.github.com/Xliff/9f36da860843...6493496c60 14:25
capcassiuscalhou Is it possible to have some short form: @A[^2;^2] = 10.rand; instead of: for ^2 ->\i { for ^2 ->\j { @A[i;j] = 10.rand } } ? 14:43
timotimo yup! 14:45
m: my @a[4;4]; @a[^2;^2] Z= 10.rand; say @a
camelia Partially dimensioned views of shaped arrays not yet implemented. Sorry.
in block <unit> at <tmp> line 1
timotimo ah, right 14:46
Xliff_ m: my @a = (10.rand xx 2, 10.rand xx 2); @a.say
camelia [(7.196854692594082 0.9698668971034952) (9.657844142402483 7.664903413900274)]
timotimo m: my @a[4;4]; @a[^2]>>.[^2] X= 10.rand; say @a
camelia Partially dimensioned views of shaped arrays not yet implemented. Sorry.
in block <unit> at <tmp> line 1
timotimo well, i imagine they want an actual shaped array
if you want to initialize a shaped array like that you can have:
my @a[4;4]; @a = (^10).pick xx 4 xx 4; say @a 14:47
evalable6 [[4 3 7 6] [5 4 2 6] [7 0 9 3] [6 8 8 7]]
timotimo but if you want to assign only to parts, that's tricky with those NYI pieces we have there
Xliff_ Yup
timotimo huh. 14:48
m: my @a[4;4]; @a[$_[0];$_[1]] = (^10).pick for @a.keys.grep({ .[0] ~~ ^2 && .[1] ~~ ^2 }); say @a 14:49
camelia [[0 1 (Any) (Any)] [6 8 (Any) (Any)] [(Any) (Any) (Any) (Any)] [(Any) (Any) (Any) (Any)]]
timotimo ugh, disgusting
m: my @a[4;4]; @a[$_;] = (^10).pick for @a.keys.grep({ .[0] ~~ ^2 && .[1] ~~ ^2 }); say @a 14:51
camelia Partially dimensioned views of shaped arrays not yet implemented. Sorry.
in block <unit> at <tmp> line 1
timotimo m: my @a[4;4]; @a[$_,] = (^10).pick for @a.keys.grep({ .[0] ~~ ^2 && .[1] ~~ ^2 }); say @a
camelia Partially dimensioned views of shaped arrays not yet implemented. Sorry.
in block <unit> at <tmp> line 1
timotimo i can't seem to figure out how to pass the tuple as key there
until someone really invests a month or two into shaped arrays it's going to kind of suck 14:52
Xliff_ timotimo: Read my gist? 14:55
gist.github.com/Xliff/9f36da860843...6493496c60
timotimo sorry, i haven't. let me see 14:56
how are you matching this?
it looks like you simply neglected to anchor the match to the beginning and end 14:57
Xliff_ I surround that in <ws> 14:57
timotimo that only means it'd allow spaces in front and at the end 14:58
m: say "hello world how are you" ~~ /\w\w\w/
camelia 「hel」
Xliff_ Right, but for the negative cases, it chops off the first invalid character.
And I can't find where that character is going in the regex.
timotimo er, that's not what i meant %)
Xliff_ LOL
timotimo m: say "hello world how are you" ~~ /\s\w\w\w\s/ 14:59
camelia 「 how 」
timotimo your question is similar to "why is this matching if there's text before and after that"
Xliff_ m: my $m = "!@notallotta" ~~ /<ws>$<o>=[ <:Letter + [ _ @ # ]> <:Letter + [ _ @ # $ ]>* ]<ws>/; $m.gist.say; 15:00
camelia 「@notallotta」
ws => 「」
o => 「@notallotta」
ws => 「」
Xliff_ m: my $m = " !@notallotta" ~~ /<ws>$<o>=[ <:Letter + [ _ @ # ]> <:Letter + [ _ @ # $ ]>* ]<ws>/; $m.gist.say;
camelia 「@notallotta」
ws => 「」
o => 「@notallotta」
ws => 「」
timotimo m: my $m = " !@notallotta" ~~ /^<ws>$<o>=[ <:Letter + [ _ @ # ]> <:Letter + [ _ @ # $ ]>* ]<ws>$/; $m.gist.say; 15:01
camelia (Any)
Xliff_ So why is the "!" not being applied to the first group in $o?
timotimo m: say "!" ~~ /<:Letter + [_@#]>/
camelia Nil
timotimo m: say "!" ~~ /<:Letter + [_@#!]>/
camelia 「!」
Xliff_ Right, but this is part of a greater grammar, and anchoring it that way won't work.
timotimo m: my $m = " !@notallotta" ~~ /^<ws>$<o>=[ <:Letter + [ _ ! @ # ]> <:Letter + [ _ @ # $ ]>* ]<ws>$/; $m.gist.say;
camelia 「 !@notallotta」
ws => 「 」
o => 「!@notallotta」
ws => 「」
Xliff_ OK. So the regex itself is skipping that part and the <ws> doesn't matter. :s 15:02
timotimo <ws> is allowed to match nothing
Xliff_ I know. So why doesn't that anchor the "!" instead of the "@"? 15:03
timotimo because the ! doesn't match your character class
Xliff_ Right. But I was hoping the <ws> would force it to start there and not skip a character.
timotimo it does no such thing
m: say "!hello!" ~~ /<ws> "hello" <ws>/ 15:04
camelia 「hello」
ws => 「」
ws => 「」
timotimo m: say "ahelloa" ~~ /<ws> "hello" <ws>/
camelia Nil
timotimo the default ws allows no space to be there if there's a symbol on either side
i.e. <ws> will match between a ! and an @
Xliff_ *headdesk*
So how would I anchor this properly without the use of ^? 15:05
timotimo it depends entirely on the rest of your grammar, i think 15:06
Xliff_ The only other way I can think of to do this would be a 0LA.
timotimo well, <ws> is also potentially a 0LA
Xliff_ Yeah, but that means unit testing negative cases is harder. 15:07
And up until now, I haven't had that problem. :/
OK, well another 0LA
timotimo if this is only for testing, why not wrap the match in ^ and $
Xliff_ *shrug* -- Why not? 15:08
*headdeskagain*
timotimo this stuff is tricky :)
Xliff_ Works. 15:09
*headdesk3times*
timotimo++
timotimo i was confused by your suggestion for "COALESCE" in that ticket, did you see my comment?
Xliff_ No. Link? 15:10
timotimo github.com/perl6/doc/issues/2061 15:11
Xliff_ So how would I convert this to a proper testing routine? Not that I'd want <ident_sys> to be a rule/token/regex parameter and the structure to remain intact: "sub test(Str $s) { $m = $s ~~ /^<ident_sys>/; }"
timotimo worst case, just build the BOS assertion yourself "after" the match
i.e. "fail if $/.pos != 0"
can you pass in the actual ident_sys token object, or do you just have the name and it's inside a grammar? 15:12
Xliff_ I can pass the object. 15:13
timotimo cool, then i'd just $s ~~ $regex_obj; ok $/ && $/ == 0
or something like that
Xliff_ OK, so no cool single place test. 15:14
That's what I've been doing.
Xliff_ So you can't do: "my token t { 'ttt' }; sub test (Str $s, \r) { $s ~~ \r }; test("tt", t)" ? 15:16
timotimo m: my token t { 'ttt' }; say &t.parse("tttt") 15:18
camelia No such method 'parse' for invocant of type 'Regex'. Did you mean 'pairs'?
in block <unit> at <tmp> line 1
timotimo mhm
Xliff_ timotimo: Thanks for your help. I will rest my brain for the rest of the day. 15:39
Xliff_ timotimo: Hope you can do the same. :) 15:40
timotimo i was hoping i could get some more productive work time today
timotimo i've been lazy so far :) 15:42
buggable New CPAN upload: Env-0.0.1.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.1.tar.gz 15:43
timotimo what does that do? 15:44
lizmat metacpan.org/pod/Env 15:46
timotimo ah, neat
lizmat it basically exports the keys of %*ENV by their name
timotimo wouldn't that want a p5 in the name like the other butterfly modules? 15:47
lizmat thanks to Zoffix I was able to pull that off
timotimo: no, because the P5... live in the core of Perl 5, not in a module
timotimo oh, OK
lizmat if it's a module, I use the same name to minimize the difference 15:48
for functions that turned out to be impossible
timotimo oh, how so? too many overlaps with perl6 builtins? 15:49
lizmat no, some weird interaction between module name being the same as the sub name being exported from a compiled module
forget what it was exactly
timotimo oh? that sounds weird
lizmat it felt a bit like DIHWIDT, so I didn't report it :-)
anyways, it's too late now: not going to change the names of 50+ distributions 15:50
timotimo mhm
lizmat I guess I should have called them CORE::function
hmmm... 15:51
Ulti jnthn: any more noise about comma ? 16:07
I'm getting fairly addicted to using PyCharm for my Python work vs a plain editor 16:10
jnthn Ulti: I've been doing little except Comma-related things, eating, and sleeping for the last while. :-) 16:19
Ulti: The release engineering side of things has been a bit more of a headache than we expected. We're getting close on that. Meanwhile, the legal/logistical things we had to take care of are pretty much done, and I've been using it for my own Perl 6 programming for a while and feel comfortable we have things working well enough for an initial BETA release. 16:22
jmerelo jnthn++ 16:23
jnthn wants to say "this week" but is afraid of jinxing it :P 16:26
Ulti I can recommend sleeping in the sun rather than in your IDE :P 16:57
that sounds amazing jnthn #nojinx
Geth doc: 7776882f6f | (JJ Merelo)++ | doc/Language/structures.pod6
Advances structures page refs #114
18:18
doc: 47d87c2f1b | (JJ Merelo)++ | doc/Language/structures.pod6
Clarification about identity and scalars

Also goes towards #114
synopsebot Link: doc.perl6.org/language/structures
doc: f1881ff53f | (JJ Merelo)++ | doc/Language/structures.pod6
Adds complex data structres advances #114
Geth doc: 409ff2c4cc | (JJ Merelo)++ | doc/Language/structures.pod6
Starts with funcs and reflows
19:14
doc: af5953d4fe | (JJ Merelo)++ | doc/Language/structures.pod6
Adds iteration and things refs #114
synopsebot Link: doc.perl6.org/language/structures
rindolf hi all 21:35
AlexDaniel o/ 21:38
rindolf AlexDaniel: hi 21:40
Xliff_ \o 22:06
sjn up-for-grabs.net/#/tags/perl6 <- probably a good place to get some visibility 22:46
Xliff_ Is DBIish in a fit to install via zef? 23:40
I'm getting a lot of this:
Undeclared name:
DEPRECATED used at line 34
geekosaur it hasn't caught up with recent changes to "is DEPRECATED", yes 23:41
Xliff_ So I have to force it? 23:44
Looks like it will blow up anything that uses it.
Is there something online that describes these changes?
MasterDuke github.com/rakudo/rakudo/commits/master lizmat 23:47
's recent commits with DEPRECATED in the message
Xliff_ I see a liztomato in blog post from 2013.
SO. 23:51
DEPRECATED("message") inside a method becomes is DEPRECATED("message") outside?