🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
00:04 pmurias left
rjt_pl Is there a Raku equivalent to p5's s/match/repl/r , important part being the /r (non-destructive substitution and returns result)? 00:04
00:04 patrickz joined
Xliff m: $_ = "Pear"; my $s = S/P/R/; $s.say; 00:05
evalable6 Rear
Xliff ^^ rjt_pl ?
m: $_ = "Pear"; my $s = S/P/R/; $s.say; .say; 00:06
evalable6 Rear
Pear
rjt_pl Oh wow, ok. That explains why I couldn't find an adverb for that. ;-) Thanks!
Xliff Be aware that S/// only works on $_. 00:07
rjt_pl Right, perfect for what I'm doing.
Xliff If you want to do something with arbitrary strings, use Str.replace
Actually... that would be .subst 00:08
docs.perl6.org/routine/subst
00:08 patrickb left 00:14 patrickz left 00:17 pmurias joined
guifa note that Str.subst will (temporarily) likely be faster if you’re not replacing regexen 00:41
(or at least, for a while things like starts-with(‘foo’) and ends-with(‘foo’) were much faster than ~~ /^foo/ and ~~ /foo$/ and the recommended route — and even if regex gets faster, it’s cleaner code IMO) 00:42
rjt_pl Good to know. 00:49
01:03 Doc_Holliwould left
guifa Eventually they should end up being the same speed (regex optimizations should recognize a simple anchor + static string) but there have been bigger fish to fry elsewhere in the core 01:06
01:23 AlexDani` joined 01:24 AlexDaniel left 01:32 cognomin_ left, AlexDani` is now known as AlexDaniel, AlexDaniel left, AlexDaniel joined 01:39 benjif joined 01:54 pmurias left 02:07 wildtrees left 02:29 lucasb left
cpan-raku New module released to CPAN! AttrX::Mooish (0.7.0) by 03VRURG 02:42
02:45 Guest38485 left, skyl4rk left 02:46 Guest38485 joined, skyl4rk joined 03:12 cpan-raku left 03:13 cpan-raku joined, cpan-raku left, cpan-raku joined
Xliff Is there a more up-to-date version of perl6-all-modules from moritz? 03:21
AlexDaniel? 03:32
AlexDaniel Xliff: no
Xliff Whyyyyyy? 03:33
AlexDaniel perl6-all-modules is stuck for some reason and needs fixing
Xliff Oh. nvm
AlexDaniel: What's the best way for me to get a bisectable installation going?
ZzZombo How can I express "this variable/property" is supposed to be initialized with defined strings" w/o also giving it an immediate value, like `my Str:D $a = ''`?
AlexDaniel Xliff: what for?
Xliff I do NOT want to continue compiling rakudo everytime I need to check something 03:34
Compiling GTK is bad enough.
AlexDaniel Xliff: what about this? github.com/perl6/whateverable/wiki/Shareable
Xliff Was looking at that.
AlexDaniel Xliff: you can get any build from whateverable server
I think modern rakudo versions are relocatable so you should have even less issues using this 03:35
Xliff Is there a script that will download a nice subset?
AlexDaniel shareable6: HEAD
shareable6 AlexDaniel, whateverable.6lang.org/HEAD
AlexDaniel Xliff: well, if you replace HEAD with anything else it'll give you the build 03:36
so as long as you can define your own subset, sure
Xliff Hm. OK. This means I need to script downloads via that link, then undo them, then run via that new executable, correct?
I was hoping there was a CLI version of bisectable. 03:37
AlexDaniel there is Blin, yes
which you can use as exactly that
Xliff *sigh*
OK. I've been misunderstanding the purpose of some of these bots, then. 03:38
Let me gain some altitude and explain.
AlexDaniel to be honest I don't entirely understand what problem you're trying to solve :)
Xliff I want to see if I can find the largest perl6 module in the ecosystem. What's the best method to do that?
AlexDaniel hmm, what's largest? 03:39
ZzZombo If you omit the `:D`, then it's possible to assign undefined values, on the other hand, assigning some half-assed default value also kinda works against the design.
Xliff Yes
AlexDaniel I mean, what's your definiton of “largest” 03:40
Xliff Either compunit count or line count. Don't care which.
Line count would be the best one.
That directly translates to "size of repo"
m: class A { method b (Str:D $name) { say 'Defined' }; }; A.new.b() 03:41
evalable6 (exit code 1) Too few positionals passed; expected 2 arguments but got 1
in method b at /tmp/bKbzLRuIn5 line 1
in block <unit> at /tmp/bKbzLRuIn5 line 1
Xliff m: class A { method b (Str:D $name) { say 'Defined' }; }; my $c; A.new.b($c)
evalable6 (exit code 1) Type check failed in binding to parameter '$name'; expected Str but got Any (Any)
in method b at /tmp/NtQI9pcDxH line 1
in block <unit> at /tmp/NtQI9pcDxH line 1
Xliff m: class A { method b (Str:D $name) { say 'Defined' }; }; my $c; A.new.b('')
evalable6 Defined
Xliff m: class A { method b (Str:D $name) { say 'Defined' }; }; my $c; A.new.b(Str)
evalable6 (exit code 1) Parameter '$name' of routine 'b' …
Xliff, Full output: gist.github.com/f770353c2e68e86810...0aacf5a4dd
Xliff ZzZombo: ^^^
ZzZombo What? 03:42
How does that answer my question?
Xliff I don't know. Can you tell me why it doesn't?
ZzZombo Maybe because you involve parameters rather than variables and properties? 03:43
Xliff I don't think I got the mid bit of your explanation...
Can you gist?
AlexDaniel ah, I understand the question
so you want to declare `my Str:D $a;` but assign to it later 03:44
ZzZombo Yep.
Xliff Yeah. That was the mid bit I missed.
ZzZombo Especially in a class, why can't the initialization be deferred to `BUILD\TWEAK`, etc? 03:45
AlexDaniel ZzZombo: well, I don't think you can or should be able to. Before you assign to it, it'll be undefined, meaning it'll be violating the constraint
Xliff class A { has Str $!a is required }; A.new
m: class A { has Str $!a is required }; A.new
evalable6 (exit code 1) The attribute '$!a' is required, but you did not provide a value for it.
in block <unit> at /tmp/bw27leLZ9W line 1
Xliff m: class A { has Str $!a is required; submethod BUILD (:$!a) { }; }; A.new(a => '42') 03:46
evalable6
ZzZombo Good, looks fine.
AlexDaniel Xliff: I can't come up with a very easy way to do it, you'll have to implement it somehow 03:47
Xliff AlexDaniel: *sigh* -- Was hoping I wouldn't need to go through and download every module.
OK. Thanks!@
AlexDaniel Xliff: as for fetching every module, it's also a bit… complicated 03:48
Xliff: first of all, there are two lists: github.com/perl6/Blin/blob/0b12bc0...p6#L36-L37
then there's this issue with source urls being something other than https links… 03:49
then there are different versions of the same module
Xliff Yeek! Looks like massive amounts of data normalization. 04:18
04:54 squashable6 left 04:55 squashable6 joined
guifa .tell jmerelo Sent you an e-mail to your university account. Sorry for the delay! 04:56
tellable6 guifa, I'll pass your message to jmerelo
Xliff Hrm. How can I make a hash slice into another hash... 05:11
m: my %h = ( a=>1, b=>2, c=>3, e=>4 ); %h<b c e>
evalable6
Xliff m: my %h = ( a=>1, b=>2, c=>3, e=>4 ); %h<b c e>.gist.say 05:12
evalable6 (2 3 4)
Xliff m: my %h = ( a=>1, b=>2, c=>3, e=>4 ); %h<b c e>.pairs.map( *.key eq <b c e>.any ).Hash.gist.say 05:13
evalable6 (exit code 1) Died with X::Hash::Store::OddNumber
in block <unit> at /tmp/K0_oczdUtI line 1
Xliff m: my %h = ( a=>1, b=>2, c=>3, e=>4 ); %h<b c e>.pairs.grep( *.key eq <b c e>.any ).Hash.gist.say
evalable6 {}
Xliff m: my %h = ( a=>1, b=>2, c=>3, e=>4 ); %h<b c e>.pairs.grep( *.key eq <b c e>.any ).gist.say 05:14
evalable6 ()
Xliff m: my %h = ( a=>1, b=>2, c=>3, e=>4 ); %h<b c e>.pairs.grep({.key eq <b c e>.any }).gist.say
evalable6 ()
Xliff m: my %h = ( a=>1, b=>2, c=>3, e=>4 ); %h<b c e>.pairs.grep({ .key eq <b c>.any }).gist.say
evalable6 ()
Xliff m: my %h = ( a=>1, b=>2, c=>3, e=>4 ); %h.pairs.grep({ .key eq <b b c>.any }).gist.say
evalable6 (b => 2 c => 3)
Xliff m: my %h = ( a=>1, b=>2, c=>3, e=>4 ); %h.pairs.grep({ .key eq <b c e>.any }).gist.say
evalable6 (e => 4 c => 3 b => 2)
Xliff Hrm.
guifa Xliff: sounds like the time for a custom circumscript 05:31
ZzZombo m: role R[**%h]{method m{%h}};say R[:a<f>, :1b].new.m 05:32
evalable6 (exit code 1) ===SORRY!===
No appropriate parametric role variant available for 'R'
ZzZombo Why?
m: role R[**%h]{method m{%h}};say R[%(:a<f>, :1b)].new.m 05:33
evalable6 {a => f, b => 1}
ZzZombo WTF??
m: role R[**%h]{method m{%h}};say R[a=>'asd', b=>123].new.m 05:34
evalable6 (exit code 1) ===SORRY!===
No appropriate parametric role variant available for 'R'
guifa m: role R[+%h]{method m{%h}};say R[:a<f>, :1b].new.m
evalable6 (exit code 1) Could not instantiate role 'R':

in any protect at gen/moar/stage2/NQPCORE.setting line 1216
in block <unit> at /tmp/nEIoojWBeO line 1
guifa m: role R[*%h]{method m{%h}};say R[:a<f>, :1b].new.m
evalable6 {a => f, b => 1}
guifa wonders why single argument rule isn’t available for hashes
In any case, you need to use a single star slurpy 05:35
ZzZombo Yea, thanks for pointing that out.
BTW, Comma apparently doesn't know about `return` and `fail`... 05:36
guifa it normally does … but sometimes if you have fairly complex syntax it might lose track of the context and it can get screwy
Xliff m: Version.new( 05:38
evalable6 (exit code 1) 04===SORRY!04=== Er…
Xliff, Full output: gist.github.com/1a2d93786b10e34ebd...95f4d78ed1
05:38 Doc_Holliwould joined
Xliff m: my $a = Version.new("0.9.6"); my #b = Version.new("0.9.16"); say $a > $b 05:38
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/H4np3pCf6f
Malformed my
at /tmp/H4np3pCf6f:1
------> 03 #b = Version.new("0.9.16"); say $a > $b08⏏04<EOL>
Xliff m: my $a = Version.new("0.9.6"); my $b = Version.new("0.9.16"); say $a > $b
evalable6 False
Xliff m: my $a = Version.new("0.9.6"); my $b = Version.new("0.9.16"); say $a < $b 05:39
evalable6 True
ZzZombo m: my SetHash:D[Str:D] $h = 'asd', 'foo', 'bra';say $h<asd>
evalable6 (exit code 1) WARNINGS for /tmp/SaLT1tFQHx:
Use…
ZzZombo, Full output: gist.github.com/697f088d6d7e69d016...346269f13d
ZzZombo m: my SetHash:D[Str:D] $h = 'asd', 'foo', 'bra';say $h
evalable6 (exit code 1) WARNINGS for /tmp/FdsclHTCBr:
Use…
ZzZombo, Full output: gist.github.com/9a1cdf0ca9924dda51...bd6d766d86
ZzZombo perlbot: eval: my SetHash:D[Str:D] $h = 'asd', 'foo', 'bra';say $h
perlbot ZzZombo: WARNINGS for /tmp/sk2rrAZ_ht:␤Useless use of constant string "foo" in sink context (lines 1, 1)␤Useless use of constant string "bra" in sink context (lines 1, 1)␤Type check failed in assignment to $h; expected SetHash:D but got Str ("asd")␤ in block <unit> at /tmp/sk2rrAZ_ht line 1␤␤[Exited 1]
ZzZombo perlbot: eval: my SetHash:D[Str:D] $h = ('asd', 'foo', 'bra');say $h
perlbot ZzZombo: Type check failed in assignment to $h; expected SetHash:D but got List ($("asd", "foo", "bra"))␤ in block <unit> at /tmp/C356VWIQn6 line 1␤␤[Exited 1]
ZzZombo perlbot: eval: my SetHash:D[Str:D] $h .= new('asd', 'foo', 'bra');say $h
perlbot ZzZombo: SetHash(asd bra foo)␤
ZzZombo Is there a shorter version of `sub x (--> 42){}` w/o the empty body at all? 05:41
guifa constant &term:<x> = 42; 05:43
Xliff how does this work?
m: sub postcircumfix:<{_ _}>(%h,@v) { %( do for @v { $_ => %h{$_} } ) }; my %a = a => 1, b => 2, c => 3, d => 4; say %a{_ "a", "b" _} 05:44
evalable6 {a => 1, b => 2}
Xliff m: Version.new("0.9.42").say 05:47
evalable6 v0.9.42
ZzZombo It can't be a constant, it actually returns an expression, like `@a.elems`; I'm probably too used to one-liners for such occasions in other languages.
guifa I just wouldn’t use —> then, it’s not obligatory. sub x { @_.elems }  would return the elements of the array passed 05:48
Xliff Grabs cpan.json and turns it into something I can use... 05:53
perl6 -e 'use URI; use JSON::Fast; my $cpan = from-json("cpan.json".IO.slurp); $cpan .= map({ my %h = .pairs.grep( *.key eq <source-url version name auth>.any).Hash; unless %h<auth>:exists { %h<auth> = URI.new(.<source-url>).path.Str.split("/")[5].lc }; if %h<auth>:exists { %h<auth> ~~ s/^ ["github:" | "cpan:" | "CPAN:" | "bitbucket:" | "gitlab:"]//; %h<auth> .= lc if %h<auth>; }; %h }); my %p; for $cpan.Array -> $c { 05:54
%p{$c<auth>}{$c<name>}{$c<version>} = $c<source-url> }; for %p.values -> $a { for $a.values -> $p { my @s = $p.keys.map({ Version.new($_) }).Array.sort; $p<versions> = @s.reverse; }; }; "cpan-parsed.json".IO.spurt: to-json(%p)'
Bwahahaha!
guifa Xliff BTW if you ever do for @a -> $a { for @b -> $b { , etc 06:07
use the X operator
for @a X @b -> $a, $b {  06:09
it’s even more effective when you have to embed 3 or more
err oops forgot you hve to deconstruct 06:14
for @a X @b -> ($a, $b) { 06:15
06:18 sauvin left 06:24 jmerelo joined
jmerelo .seen tmtvl 06:24
tellable6 jmerelo, I saw tmtvl 2019-12-02T18:04:10Z in #raku: <tmtvl> Shall I share the latest Weekly on the Facebook?
jmerelo .seen kaiepi 06:25
tellable6 jmerelo, I saw kaiepi 2019-12-08T10:52:18Z in #raku-dev: <Kaiepi> ah there you are
ZzZombo .seen ZzZombo
tellable6 ZzZombo, I saw ZzZombo 2019-12-10T05:47:23Z in #raku: <ZzZombo> It can't be a constant, it actually returns an expression, like `@a.elems`; I'm probably too used to one-liners for such occasions in other languages.
ZzZombo .seen tellable6
tellable6 ZzZombo, I haven't seen tellable6 around, did you mean evalable6?
ZzZombo LOL
AlexDaniel hah 06:26
you can add some easter egg for that :)
Voldenet uh, but it's not @a X @b, it's %a.values -> $b { $b.values … } 06:28
guifa Voldenet: good point. Um… 06:30
%a.values X %a.values».values.flat
:D
Voldenet in this case tho: for %p.map(*.values).flat.map(*.values).flat { $_<versions> = $_.keys.map({ Version.new($_) }).Array.sort.reverse }; 06:32
06:34 sauvin joined
Voldenet uh, maybe %p.values>>.values.flat, but I'm not very good at golf 06:36
06:56 rindolf joined
Xliff HAH! 07:04
I try to sleep and you marvelous people fiddle with my not-golf. 07:05
07:05 wamba joined
Xliff Of course, you all are missing the assignment to %p, which preclues the X. 07:06
Hmmm... or not...
SmokeMachine m: my %h = ( a=>1, b=>2, c=>3, e=>4 ); (%h<b c e>:p).Hash.say 07:12
evalable6 {b => 2, c => 3, e => 4}
Xliff SmokeMachine++ 07:13
07:23 jmerelo left 07:58 stoned75 left
ZzZombo SmokeMachine: I kinda got how to declare, but how do I use a custom metaclass? 08:06
SmokeMachine ZzZombo: github.com/FCO/Red/blob/master/lib/Red.pm6#L39 08:13
ZzZombo: github.com/FCO/Red/blob/master/exa...son.pm6#L3 08:17
Xliff m: "filename.tar.gs".IO.extension.basename.say 08:23
evalable6 (exit code 1) No such method 'basename' for invocant of type 'Str'
in block <unit> at /tmp/tonL6J9NmD line 1
Xliff m: "filename.tar.gs".IO.extension('').basename.say
evalable6 filename.tar
Xliff m: "filename.tar.gs".IO.extension('', :parts(3)).basename.say 08:24
evalable6 filename.tar.gs
Xliff m: "filename.tar.gs".IO.extension('', :parts(2)).basename.say
evalable6 filename
Xliff m: "filename.tar.gs".IO.extension('', :parts(^5)).basename.say 08:25
evalable6 filename
08:34 wamba left 08:35 xinming_ joined 08:37 chloekek joined
chloekek p6: say set(1, 2, 3) R(elem) 1 08:37
evalable6 True
chloekek Ah, camelia was renamed.
Didn’t work in DM. :þ
08:38 xinming left
rindolf .seen TimToady 08:47
tellable6 rindolf, I saw TimToady 2019-07-22T20:38:55Z in #perl6-dev: * TimToady had the power company swapping his electric meter, and it broke my / key
ZzZombo Yea, where is Camelia? 08:51
I want it back!
cpan-raku New module released to CPAN! Gnome::N (0.15.1.1) by 03MARTIMM 08:53
08:56 sena_kun joined
sarna camelia was renamed? 09:03
09:04 Doc_Holliwould left
sena_kun sarna: hmm? the mascot? 09:04
sarna sena_kun: oh, I think chloekek meant the bot 09:05
chloekek Absolutely.
09:06 SyrupThinker left
sarna can I get rakudo on ARM? like, a rasp pi 09:08
09:11 wamba joined 09:22 patrickb joined 09:33 Doc_Holliwould joined
sarna ha, you can! stackoverflow.com/questions/516048...berry-pi-3 09:36
very nice :D
09:43 wamba left, wamba joined 09:51 knoop joined 09:53 knoop left, knoop joined
knoop hello raku... glad about the new name... I'm looking for a language that makes sense like Perl does but with simpler dependency management... am I in the right place? 09:54
sarna knoop: what do you mean by "simpler dependency management"? 09:55
knoop well I find npm easy to use
cpan not so much
benjif I find zef pretty simple to use 09:56
sarna ah, raku's cli tool is called zef and the modules live at modules.raku.org/
tadzik huh
knoop I guess before I delve in I was wondering if this was a specific area where raku tries to make it simpler than it was with perl 5 09:57
interested in your views
but will read up on zef 09:58
too
thanks!
tadzik knoop: if you like npm then you might like metacpan.org/pod/distribution/App-...script/cpm
raku has nothing quite like it though afaik
sarna knoop: I haven't used perl, but I've heard OO is more convenient in raku 09:59
there are new regexes that are definitely simpler and make more sense, but they take a bit of time to get used to
I've also heard raku's treatment of sigils is way simpler than perl's, not sure if that's true though 10:00
SmokeMachine knoop: 6pm should be a clone of npm for raku... 10:01
knoop Ah yeah oo was the other point but I already knew that was tackled from the ground up in raku
sarna I think overall raku should make more sense than perl, but :) as I said, I have no prior perl experience 10:02
SmokeMachine knoop: github.com/FCO/6pm
knoop thanks for the pointers guys 10:03
sarna you're welcome!
chloekek The way lists work in Perl 5 and Raku is significant when considering sigil variance. 10:06
$xs[$i] and @xs[$i] in Perl 5 are both valid but the former evaluates to a scalar whereas the latter evaluates to a single-element list. 10:10
In Raku what you get when you write @xs[$i] depends on what $i is at runtime.
p6: my @xs = qw「a b c」; my $i = 0; my $j := (0, 1); @xs[$i].perl.say; @xs[$j].perl.say; 10:12
evalable6 "a"
("a", "b")
10:21 Xliff left 10:29 wamba left
ZzZombo m: role R {...};class C does R {};say C.new 10:46
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/KtpVOo3VEc
No appropriate parametric role variant available for 'R'
at /tmp/KtpVOo3VEc:1
ZzZombo m: role R {...};class C does R {};role R {};say C.new 10:47
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/1RCl0jKe0u
No appropriate parametric role variant available for 'R'
at /tmp/1RCl0jKe0u:1
ZzZombo WTF?
This makes forward declaration useless for roles.
chloekek m: role R {...};class C does R {};role R { method m {...}; };say C.new 10:49
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/as6oscVBp9
No appropriate parametric role variant available for 'R'
at /tmp/as6oscVBp9:1
10:49 chloekek left
ZzZombo m: role R {...};class C does R {};role R {};dd R 10:50
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/Vk6S2tFSEC
No appropriate parametric role variant available for 'R'
at /tmp/Vk6S2tFSEC:1
ZzZombo m: role R {...};dd R;role R {}
evalable6 R
ZzZombo m: role R {...};dd R;role R {};dd R 10:51
evalable6 R
R
ZzZombo m: role R {...};dd R.HOW;role R {};dd R.HOW
evalable6 Perl6::Metamodel::ParametricRoleGroupHOW.new
Perl6::Metamodel::ParametricRoleGroupHOW.new
ZzZombo WTF??
Why is it parametric all of sudden? 10:52
jnthn All roles are parametric
Stubbing a role is like declaring a proto with no multi candidates
10:53 wamba joined, sena_kun left
jnthn You can't actually `does` a stubbed role, because composition happens at the time the closing `}` of the class is reached. 10:53
And composition is flattening
So the definition of the role must be available by the point it is composed. 10:54
nine ZzZombo: forward declarations of roles can still be useful for type constraints 10:58
11:00 wamba left 11:07 sena_kun joined 11:09 wamba joined, Doc_Holliwould left 11:14 abraxxa left, abraxxa joined 11:20 Doc_Holliwould joined
tbrowder .tell ab6tract when i actually started designing a check-file sub it was not as simple as i first imagined, but, for my use cases, it's becoming clearer 11:42
tellable6 tbrowder, I'll pass your message to ab6tract
11:54 wamba left 12:08 wamba joined 12:22 scimon joined 12:23 joule joined 12:30 pmurias joined
pmurias vrurg: should I merge in: github.com/perl6/nqp/pull/590 12:32
vrurg: I'm not sure if it's waiting for code review before being merged or something else? 12:33
12:36 lucasb joined 12:37 wamba left 12:38 wamba joined 12:39 wamba left, wamba joined 12:40 wamba left, wamba joined 12:43 scimon left 12:45 wamba left 12:47 scimon joined
ZzZombo m: say 1.'succ()' #?? 12:48
evalable6 (exit code 1) 04===SORRY!04=== Er…
ZzZombo, Full output: gist.github.com/72259a769daa4cedca...60e1734c3c
ZzZombo What am I doing wrong again?
12:49 Doc_Holliwould left 12:50 wamba joined
lizmat m: say 1.succ 12:53
evalable6 2
sarna m: say 1.'succ'()
evalable6 2
lizmat ah, ok
sarna ZzZombo 12:54
12:54 sena_kun left 12:55 wamba left
ZzZombo OK, thanks. 12:56
12:57 knoop left, knoop_ joined 13:00 knoop joined 13:04 knoop_ left 13:08 sena_kun joined
ZzZombo rkeval: my method m(Positional:D \SELF: ){SELF.grep: * % 2 == 0};(1,2,3,4).&m.say 13:08
rkeval: my method m(Positional:D \SELF: ){SELF.grep: * % 2 == 0};(1,2,3,4).'m'().say
perlbot ZzZombo: (2 4)␤
ZzZombo: No such method 'm' for invocant of type 'List'␤ in block <unit> at /tmp/uNJsFyQQq6 line 1␤␤[Exited 1]
ZzZombo Why does the second not work?
scimon Hi all 13:09
lizmat because it does a method lookup for method "m", which List does not have
&m is a direct Callable, so (1,2,3,4).&m basically forces the use of the Callable, without any further checks 13:10
ZzZombo rkeval: say ''.&Int 13:11
perlbot ZzZombo: 5===SORRY!5=== Error while compiling /tmp/UqJaV0v4TL␤Illegally post-declared type:␤ Int used at line 1␤␤[Exited 1]
ZzZombo rkeval: say ''.&say
perlbot ZzZombo: ␤True␤
13:14 cpan-raku left 13:16 cpan-raku joined, cpan-raku left, cpan-raku joined 13:18 maettu left 13:22 pmurias left 13:26 wamba joined
cpan-raku New module released to CPAN! Gnome::Gdk3 (0.15.0.1) by 03MARTIMM 13:33
13:34 xinming_ left 13:35 xinming_ joined 13:40 squashable6 left 13:41 squashable6 joined 13:49 pmurias joined 14:09 Summertime left 14:10 maettu joined 14:15 Summertime joined
Geth doc: McSinyx++ created pull request #3126:
Substitute Perl 6 with Raku
14:22
sarna tyil: thanks for the very nice advent posts :D I learned a lot about grammars 14:25
I even managed to write my own rule for multiline comments 14:26
tyil sarna: nice 14:32
grammars have been one of the hardest (raku) topics to get into for me 14:33
I have a book on grammars, and it's very helpful in my experience, if you want to get better at them
14:36 hungrydonkey joined
sarna tyil: what is it called? 14:36
tyil "Parsing with Perl 6 Regexes and Grammars"
sarna also, how to match anything but some string of characters? something like `-[\n]` but I'd like to do `-["foo"]` 14:37
I'll check it out, thanks!
tyil I do not have an answer on your question, but perhaps you're looking for negative lookahead/behind 14:38
sarna yeah, seems to be it. thanks! 14:40
jnthn I know nothing about what you're trying to parse, but: if that's for keyword handling, it's often more natural to express it in terms of an alternation or protoregexes, and let LTM and the longest literal disambiguation sort it out. 14:44
14:47 hungrydonkey left 14:50 hungrydonkey joined 14:53 sena_kun left 14:55 chloekek joined 14:59 hungrydonkey left 15:03 hungrydonkey joined 15:07 zby joined, sena_kun joined
sarna jnthn: I just think my multiline comment rule is too greedy :D it works fine on small strings but in a real file it matches until the end of the last multiline comment (I think) 15:09
15:11 hungrydonkey left
sarna it’s `‘/*’ <( .* )> ‘*/‘` 15:12
chloekek p6: say '/* foo */ /* bar */' ~~ /‘/*’ <( .* )> ‘*/’/ 15:13
evalable6 「 foo */ /* bar 」
chloekek p6: say '/* foo */ /* bar */' ~~ /‘/*’ <( .*? )> ‘*/’/
evalable6 「 foo 」
sarna oh nice! why does that work? 15:15
does ? make it not greedy?
15:15 hungrydonkey joined
chloekek .*? is not the same as [.*]?. Instead, *? is special syntax for a non-greedy match. 15:15
You can also use a negative lookahead: 15:16
p6: say '/* foo */ /* bar */' ~~ /‘/*’ <( [. <!before ‘*/’>]* )> ‘*/’/
evalable6 Nil
15:19 Doc_Holliwould joined
sarna awesome, thanks chloekek :) 15:20
chloekek p6: say '/* foo */ /* bar */' ~~ /‘/*’ <( [<!before ‘*/’> .]* )> ‘*/’/
evalable6 「 foo 」
chloekek p6: say '/* foo /* bar */ */ /* baz */' ~~ /‘/*’ <( .*? )> ‘*/’/ 15:22
evalable6 「 foo /* bar 」
15:25 wamba left, wamba joined, hungrydonkey left
sarna oh, that’s why I was getting Nil with !before 15:28
I put the dot before <> too :D
15:29 pmurias left, pmurias joined
chloekek . already matches * <!before> wouldn’t get to see it. 15:29
15:29 hungrydonkey joined
sarna right 15:30
15:49 hungrydonkey left 15:51 wamba1 joined, wamba left 16:10 pmurias left 16:11 chloekek left 16:38 jmerelo joined
Geth doc: b4db2e6616 | (Nguyễn Gia Phong)++ | doc/Type/Cool.pod6
Substitute Perl 6 with Raku

Handle irregular cases (pun intended) and whitespace to complete #3054
16:39
doc: a81f8c0d22 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Type/Cool.pod6
Merge pull request #3126 from McSinyx/master

Substitute Perl 6 with Raku
16:44 patrickb left, mscha joined
mscha m: my $a = 5+i; my $step = -1+i; for $a+$step, $a+2×$step ... * -> $b { say $b; last if ++$ ≥ 10; } 16:44
evalable6 4+2i
3+3i
2+3i
1+3i
0+3i
-1+3i
-2+3i
-3+3i
-4+3i
-5+3i
mscha Huh? 16:45
my $a = 5+i; my $step = -1+i; say ($a+$step, $a+2×$step ... *)[^10]; # Simpler, still broken 16:48
evalable6 (4+2i 3+3i 2+3i 1+3i 0+3i -1+3i -2+3i -3+3i -4+3i -5+3i)
16:52 scimon left
mscha github.com/rakudo/rakudo/issues/3344 16:52
16:53 sena_kun left
mscha m: my $a = 5+i; my $step = -1+i; loop (my $b = $a+$step; ; $b += $step) { say $b; last if ++$ ≥ 10; } 16:54
evalable6 4+2i
3+3i
2+4i
1+5i
0+6i
-1+7i
-2+8i
-3+9i
-4+10i
-5+11i
Geth advent: tmtvl++ created pull request #43:
Update drafts
16:56
advent: a013579013 | (Tom Browder)++ (committed using GitHub Web editor) | raku-advent-2019/schedule
update schedule
17:04
17:07 wamba1 left 17:08 sena_kun joined
Geth advent: be05891746 | (Tim Van den Langenbergh)++ (committed using GitHub Web editor) | raku-advent-2019/drafts
Update drafts
17:18
advent: 14201a542a | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | raku-advent-2019/drafts
Merge pull request #43 from tmtvl/patch-1

Update drafts
lizmat clickbaits rakudoweekly.blog/2019/12/09/2019-...-starring/ 17:33
Geth whateverable: f645470099 | (Aleks-Daniel Jakimenko-Aleksejev)++ | META6.json
Depend on “sake” instead of “Sake”

See #370 and github.com/ugexe/zef/issues/327.
17:54
18:10 stoned75 joined 18:20 chloekek joined 18:23 wildtrees joined 18:24 wildtrees left 18:27 knoop left 18:28 wamba joined, xinming_ left, knoop joined 18:29 xinming_ joined 18:39 wamba left, wamba joined 18:45 wildtrees joined 18:54 sena_kun left 19:08 sena_kun joined
sena_kun m: { :a, {{ True ?? :prefix<42> !! hash }} } 19:11
evalable6 (exit code 1) Odd number of elements found wher…
sena_kun, Full output: gist.github.com/85bc553f3ff505b36f...974739e3f6 19:12
sena_kun any ideas how to DWIM?
oops 19:14
m: { :a, |{ True ?? :prefix<42> !! hash } }
evalable6 (exit code 1) Odd number of elements found wher…
sena_kun, Full output: gist.github.com/f8b814e93a1f1551df...3e70f9f252
jmerelo Search results for Raku going up: binary input output Raku gets the official documentation in third place www.google.com/search?client=ubunt...p;oe=utf-8 19:46
tellable6 2019-12-10T04:56:21Z #raku <guifa> jmerelo Sent you an e-mail to your university account. Sorry for the delay!
jmerelo Still not the first, but we're getting there...
El_Che jmerelo: lo 19:54
19:58 jmerelo left 20:12 mscha left 20:14 daxim left 20:21 daxim joined 20:47 chloekek left 20:53 sena_kun left 20:59 joule left 21:03 thundergnat joined
thundergnat m: my $a = 5+i; my $step = -1+i; say ({$a + ++$ × $step} ... *)[^10] 21:04
evalable6 (4+2i 3+3i 2+4i 1+5i 0+6i -1+7i -2+8i -3+9i -4+10i -5+11i)
tellable6 2019-11-14T18:15:33Z #raku <tbrowder> thundergnat avl tree is on rosettacode.org
thundergnat mscha ^^
21:09 sena_kun joined 21:12 pmurias joined 21:34 just_why joined
just_why Hi. Why did you do that ? 21:34
21:41 just_why left 21:54 zby left 21:59 pmurias left 22:01 pmurias joined 22:27 atweiden-air joined
atweiden-air it's 2019-12-11 where i'm at, but rakudo is reporting 2019-12-10 22:33
i've tested this on macos with rakudo-2019.07.1 and on voidlinux with rakudo-2019.11 22:35
$*TZ
Pacific/Auckland 22:37
46800
?
22:38 knoop left
atweiden-air ah, i see now.DateTime and DateTime.now are producing different results 22:38
i hadn't realized this from reading the docs docs.perl6.org/routine/now which suggest now's timezone=$*TZ by default 22:39
i guess it's UTC though 22:40
lizmat hmmm... feels to me they should produce the same result, though ? 22:41
atweiden-air DateTime.now.Date works 22:42
22:43 sena_kun left 23:04 knoop_ joined 23:15 atweiden-air left 23:27 clarjon1 joined, rindolf left 23:50 knoop_ left 23:55 wamba left