🦋 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:12 xinming left, xinming joined 00:18 pecastro left 00:20 mcmillhj joined, mcmillhj left, mcmillhj joined
ggoebel Doc_Holliwood: very nice. I wish I'd thought of that. Thank you for sharing. 00:29
16m16s 00:30
00:38 oneeggeach joined
mcmillhj is there a map with index operation similar to Python's enumerate in Raku? 00:39
00:41 oneeggeach left 00:44 perryprog left
mcmillhj sorry should have RTFM, List#kv does what I wanted 00:48
00:53 Doc_Holliwood left 00:54 mcmillhj left
no-n I think pairs does that as well 00:59
p6: say pairs 'abc'.comb 01:00
camelia (0 => a 1 => b 2 => c)
no-n p6: say 'abc'.comb.kv 01:01
camelia (0 a 1 b 2 c)
no-n slightly different ig
01:03 perryprog joined
ggoebel Doc_Holliwood: if I change the hard coded 30000000 to $N it takes 18m 01:07
tellable6 ggoebel, I'll pass your message to Doc_Holliwood
01:30 perryprog left, perryprog joined 01:34 perryprog left, perryprog joined 01:39 fridim_ joined, fridim left 02:29 xinming left, xinming joined 02:34 cocomo joined 02:35 cocomo left 02:53 linkable6 left, linkable6 joined 03:24 leont left 03:33 wamba left 03:39 aborazmeh joined, aborazmeh left, aborazmeh joined 03:44 cpan-raku left 03:47 cpan-raku joined, cpan-raku left, cpan-raku joined 04:00 Some-body_ joined, DarthGandalf left 04:01 Some-body_ is now known as DarthGandalf 04:11 parabolize left 04:12 parabolize joined 04:15 mowcat left 04:21 jmchael_ left 04:53 ex_nihilo joined 05:11 rir joined, justsomeguy joined 05:14 DarthGandalf left 05:15 DarthGandalf joined, DarthGandalf left 05:21 pounce joined 05:22 aborazmeh left 05:27 justsomeguy left 05:55 maggotbrain joined 05:59 skids left 06:08 jmerelo joined 06:09 rindolf joined
elcaro ggoebel: check my Raku solution for day 15 on reddit (user: 0rac1e) runs in ~15s on my laptop 06:14
06:17 xinming left, xinming joined 06:58 ufobat_ joined 07:05 sjm_uk joined 07:11 frost-lab joined
jmerelo Have you checked out today's article? raku-advent.blog/2020/12/16/day-16...e-part-ii/ Do it if you want to write fast Raku code! 07:19
tellable6 2020-12-15T18:58:54Z #raku <melezhik> jmerelo , then, disregard my last post, I will probably put it as regular one ... no worries
07:20 parabolize left
jmerelo .tell melezhik thanks! 07:20
tellable6 jmerelo, I'll pass your message to melezhik
Geth advent: 9cfd6d8688 | (Fritz Zaucker)++ (committed using GitHub Web editor) | raku-advent-2020/authors.md
Update authors.md

Fix title and link of zaucker's article.
07:23
07:35 maggotbrain left 07:52 domidumont joined 08:12 pecastro joined 08:15 guifa2 joined
guifa2 Any ideas what might be causing a "Cannot invoke this object (REPR: Null; VMNull)" error when using 'callwith' ? Basically, I'm wrapping a method in a module A. Works great if I 'use A', but if I 'use B', were B is a module that uses A, I get that error 08:17
it shouldn't be a precompilation issue I don't think, because the wrapping is happening in INIT, not BEGIN 08:18
08:20 Doc_Holliwood joined 08:26 Sgeo left 08:52 dakkar joined 08:58 sno joined 09:01 Altai-man joined 09:09 sena_kun joined 09:10 Altai-man left
guifa2 hmmm, seems to be related to this github.com/Raku/old-issue-tracker/...xn-1395331 09:14
09:19 guifa2 left 09:30 manwar joined 09:39 sno left 09:51 fridim_ is now known as fridim 10:14 MasterDuke left, wamba joined 10:20 mahafyi left 11:01 sno joined 11:08 morayj joined 11:15 jmchael_ joined 11:27 Doc_Holliwood left 11:28 ufobat_ left 11:42 patrickb joined 11:53 frost-lab left 12:04 brtastic1 joined 12:05 dakkar left, dakkar joined 12:07 brtastic1 is now known as brtastic
lizmat .tell guifa2 as the original creator of `callwith`, I think it has been a mistake to make it (at least as it currently is implemented) 12:10
tellable6 lizmat, I'll pass your message to guifa2
lizmat .tell guifa2 so I would be in favour of deprecating callwith, hope this helps 12:11
tellable6 lizmat, I'll pass your message to guifa2
elcaro bisectable6: say [(^)] (0,1,2), (0,1,2), (0,1,2); 12:14
bisectable6 elcaro, Will bisect the whole range automagically because no endpoints were provided, hang tight
elcaro, Output on all releases: gist.github.com/ec0a747dd3e02e9ff0...6ac2b5b7f3 12:15
elcaro, Bisecting by output (old=2020.02.1 new=2020.05.1) because on both starting points the exit code is 0
elcaro, bisect log: gist.github.com/b37d81b8aad85e92a5...4384df9660
elcaro, (2020-03-03) github.com/rakudo/rakudo/commit/cf...a04909eb64
elcaro, Bisecting by output (old=2017.06 new=2017.07) because on both starting points the exit code is 0
12:15 ggoebel left
bisectable6 elcaro, bisect log: gist.github.com/51f0d6370242395f97...f738f5f962 12:16
elcaro, (2017-07-14) github.com/rakudo/rakudo/commit/0c...dcf273f6f8
elcaro, Output on all releases and bisected commits: gist.github.com/4f8a666ffd9dd6c386...a5bf74378e
elcaro lizmat: bug in the sym-diff operator. I will raise a GH bug 12:18
m: say [(^)] (0,1,2), (0,1,2), (0,1,2);
camelia Set(0)
elcaro m: say [(^)] (1,2,3), (1,2,3), (1,2,3);
camelia Set()
lizmat yup, that's a bug, thanks for the spot! 12:19
elcaro looks like maybe a truthy-ness check is confusing it
lizmat yup, looks like
12:29 manwar left 12:47 leont joined 13:04 patrickb left 13:08 Altai-man joined 13:11 sena_kun left 13:32 patrickb joined 13:34 Kaeipi left, Kaeipi joined 13:41 morayj left 13:51 morayj joined 14:13 rindolf left 14:16 rindolf joined, brtastic left, brtastic joined 14:18 rindolf left 14:19 rindolf joined 14:26 cpan-raku left 14:27 cpan-raku joined, cpan-raku left, cpan-raku joined 14:28 DarthGandalf joined
elcaro something I ran into with today's AOC... this works... 14:53
m: my $rule = any(0..5, 8..19); my @col = (12, 9, 1, 14); say all @col.map(* ~~ $rule);
camelia all(True, True, True, True)
elcaro or this...
m: my $rule = any(0..5, 8..19); my @col = (12, 9, 1, 14); say all @col X~~ $rule;
camelia all(True, True, True, True)
elcaro but why can't I just do `all(@col) ~~ $rule`. I just get False 14:54
m: say all(12, 9, 1, 14) ~~ any(0..5, 8..19);
camelia False
elcaro I'm pretty sure I've mixed `all` and `any` in simlilar ways in the past... but I could be wrong 14:55
it only gives True if all of values are in one of the ranges 14:56
m: say all(12, 9, 10, 14) ~~ any(0..5, 8..19); 14:57
camelia True
15:06 Sgeo joined 15:20 timlegge left 15:23 sjm_uk left 15:26 parabolize joined, ex_nihilo left
tbrowder .tell jmerelo see private msg from me 15:28
tellable6 tbrowder, I'll pass your message to jmerelo
15:36 xelxebar left, timlegge joined 15:37 timlegge left, timlegge joined 15:41 morayj left, morayj joined 15:45 mcmillhj joined
mcmillhj Is there a specific paste tool I should use for this channel? I know that #perl doesn't like when people paste code in the channel directly so just curious 15:49
moritz any pastebin will do 15:51
perryprog hastebin.com always works, I don't know if there's a better option though
moritz some prefer gist.github.com
mcmillhj awesome thank you, I am having some trouble using `all()` and was hoping someone could steer me in the right direction: topaz.github.io/paste/#XQAAAQBOAQA...Bx/BKATONV 15:52
DDGITqWjbZegzdxcsd06rrgrOR/7YuqzUWmXNaW1Gh5a6R4+shx5XIwFXnw/shErqGj16MIpR2ufSjSTjqWY1pdgg0T5IxptlQqDxhUK/lq0xEcnTi+/AP+qkZ+Fiw2eRGv1gm7LYAolzUiIJMmlEwjUeQyfBFmSB/t/drPt98M7EB8H/Sv+AAA==
moritz wtf? does that encode the full contents in the URL?
perryprog Apparently
moritz -> headdesk 15:53
perryprog Kinda ruins the point of a pastebin :P
Whoa, there's some kind of compression scheme going on there. Try deleting the end of the URL character by character, you get some crazy stuff. 15:54
mcmillhj yeah I think it does, my client shortened the url but sounds like that isn't the case for others ... I can post a gist if that would better
sorry about that
perryprog No worries; it's pretty amusing
15:56 ensamvarg3 left
mcmillhj here's the source if anyone is curious: github.com/topaz/paste 15:57
perryprog Huh, LZMA 15:58
mcmillhj `all(@buses.map: ($t + *.key) % *.value) == 0` seems to be the offending line, but I am not sure why 16:06
16:10 __jrjsmrtn__ left 16:14 __jrjsmrtn__ joined 16:20 camelCaser left 16:21 ccamel joined 16:25 mcmillhj left 16:28 mcmillhj joined 16:39 abraxxa left
dakkar m: my $code=*+*;say $code.signature # mcmillhj 16:44
camelia (;; $whatevercode_arg_1 is raw, $whatevercode_arg_2 is raw)
dakkar the code you're passing to `.map:` wants two arguments, because it contains `*` twice
leont Whatever star is great for simple cases, but does break down soon in more complicated cases 16:45
mcmillhj oh interesting, for some reason I thought * functioned like $_ 16:46
leont If you only use it once, yes
dakkar m: @things=(1=>2,3=>4);say @things.map: { .key ~ '=>' ~ .value }
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '@things' is not declared
at <tmp>:1
------> 3<BOL>7⏏5@things=(1=>2,3=>4);say @things.map: { .
dakkar m: my @things=(1=>2,3=>4);say @things.map: { .key ~ '=>' ~ .value }
camelia (1=>2 3=>4)
dakkar `* + *` is the essentially the same as `{ $^a + $^b }` or `-> $a,$b { $a + $b }` 16:47
mcmillhj ah ok, thanks for clearing that up code is working as expected now :) 16:49
16:50 m_athias left 16:55 patrickb left 17:09 sena_kun joined 17:11 Altai-man left, tejr left, tejr_ joined, tejr_ is now known as tejr 17:12 skids joined 17:27 mcmillhj left 17:34 dakkar left 17:35 domidumont left 17:46 aborazmeh joined, aborazmeh left, aborazmeh joined, tony-o left 17:55 tony-o joined 18:13 m_athias joined 18:23 wamba left 18:27 wamba joined 18:45 mscha joined
mscha m: my $s = 'hXllX'; $s ~~ s/X/$_/ for <e o>; say $s; 18:46
camelia hhhhXllXllXllXllX
mscha Why doesn't this DWIM?
m: my $s = 'hXllX'; for <e o> -> $c { $s ~~ s/X/$c/ }; say $s 18:52
camelia hello
mscha This works, but I don't understand what's wrong with my first attempt.
lizmat the $_ in the substitution is *not* the one you think 18:54
it's scope is different
*its 18:55
mscha Ah, thanks.
lizmat is what I remember from having seen this question before
s/foo/bar/ is really syntactic sugar for: 18:56
m: my $s = "hXllX"; $s .= subst("X",$_) for <e o>; dd $s
camelia Str $s = "hello"
mscha OK, makes sense. 18:57
19:18 toilie is now known as dudz, dudz is now known as Toilie 19:20 Manifest0 left, mowcat joined 19:22 skids left 19:23 Manifest0 joined 19:32 mscha left 19:34 Doc_Holliwood joined 19:42 jmerelo left 19:59 MasterDuke joined 20:04 rindolf left 20:21 k-man left 20:28 pecastro left
[Coke] if I have a standalone 'my rule ...' , how can I refer to that in a m// later? 20:34
<&rulename> doesn't seem right... 20:37
20:39 leont left 20:51 dataange` left
moritz it should work 21:01
m: my rule abc { ab. }; given 'xzabc' { say m/ <&abc> / } 21:02
camelia 「abc」
21:03 sena_kun left 21:04 ggoebel joined 21:22 k-man joined 21:32 kst joined 21:37 leont joined
[Coke] wonder what I was doing wrong. I've since made a grammar and am using that instead. :) 21:39
moritz++
[Coke] apparently did advent of code in 2018 and skipped 2019 21:42
21:45 raiph joined 21:55 brtastic left
raiph .tell coldpress I barely know C or NativeCall so your gists were overwhelming, sorry. I was mostly just reacting to your question "Is it weird if my 2D-Array algo is > 2x slower with CArrays, compared to Raku Arrays?". The link I shared showed me helping a dev cut run time 21:59
other Raku code. My point being I'm confident it *could* be hugely sped up.
tellable6 raiph, I'll pass your message to coldpress
2020-12-13T02:28:21Z #raku <coldpress> raiph: Here are the details: without CArray: 0x0.st/iFHl.raku, with CArray: 0x0.st/iFH0.raku. I can't use Blobs because I need my CArray to be mutable
raiph .tell coldpress Hmm. That's not what I meant. I meant it all depends on the details, and that it *might* be possible to hugely speed it up. Also, I think creating a Minimal Reproducible Example you can come up with showing the speed disparity and posting that to StackOverflow would be a good way to go if you still would like informed responses to 22:03
your code.
tellable6 raiph, I'll pass your message to coldpress
22:10 aborazmeh left 22:11 morayj left 22:12 MasterDuke left 22:25 raiph left 22:45 aborazmeh joined, aborazmeh left, aborazmeh joined
mst fails to find the right piece of documentation to explain precedence for custom operators 22:50
22:53 wamba left
lizmat docs.raku.org/language/functions#i...is_tighter 22:54
mst aha, I'd looked at the operators page and the creating an operator one linked from there 22:55
thank you!
lizmat: docs.raku.org/language/optut maybe should link that or something? 22:57
lizmat possibly? github.com/Raku/doc/blob/master/CO...rting-bugs
mst lizmat: #3737 opened 23:00
lizmat thanks!
mst admittedly, with a paste of our conversation and a note to poke me here if that wasn't enough to make it obvious, but I figure that's still me volunteering ;) 23:01
23:04 skids joined 23:09 aluaces left
leont That doesn't document an important element of «is equiv» (and maybe the others?): it enables the right meta operators 23:10
Which is arguably a side-effect, but I don't know of any other way of achieving that
lizmat please add that to the issue
mst leont: I was also a bit confused because C (chain) precedence didn't seem explained anywhere 23:11
lizmat is off for some shuteye&
leont is equiv<===> will not only set the associativity, but also iffiness (which decides if a operator is negatable 23:15
23:16 MasterDuke joined
leont Actually, is assoc<chain> should probably also have that side effect, but currently doesn't 23:17
Then again, a custom infix operator should almost always have an explicit precedence declaration anyway 23:23
23:34 aborazmeh left
coldpress raiph: I see, thanks for the advice. Anyways, I'm starting to think CArrays are meant for external calls to C functions, and looping tightly over CArrays in Raku is expensive. But I'll come up with a minimal example to show this. 23:48
tellable6 coldpress, I'll pass your message to raiph