00:17 librasteve_ left 00:42 linkable6 joined 01:06 oodani left, oodani joined 01:07 kjp_ left
disbot <simon_sibl> m: my $lines = (xmul(2,4)%&mul[3,7]!@^do_not_mul(5,5)+mul(32,64]then(mul(11,8)mul(8,5))); my $p1; for $lines { m:g/'mul('(\d+)','(\d+)')' {$p1 += $0*$1}/ }; say $p1; 01:07
evalable6 (exit code 1) ===SORRY!=== Error while compilin…
simon_sibl, Full output: gist.github.com/48a09a35f9fd68ecf3...a804f3869a
disbot <Raku eval> Failed to create container: Failed while sending request: Failed read response: Resource temporarily unavailable (os error 11) 01:08
<simon_sibl> @jubilatious1_98524 , if you run this code you will see that it only does the first match and then stop
<simon_sibl> only way to force it to do all the matches is to add a loop over $/, and I dont understand why 01:09
01:10 kjp joined 01:11 hulk joined 01:12 kylese left, AlexDaniel left
Voldenet simon_sibl: I bet regex returns iterable but iterable isn't consumed by anything 01:18
m: $_ = "ab ac ad ae af"; m:g/ (a.) { [$0].say } / 01:20
camelia [「ab」]
Voldenet m: $_ = "ab ac ad ae af"; m:g/ (a.) { [$0].say } /.Array
camelia [「ab」]
[「ac」]
[「ad」]
[「ae」]
[「af」]
Voldenet m: $_ = "ab ac ad ae af"; m:g/ (a.) { [$0].say } /.iterator.sink-all 01:21
camelia [「ab」]
[「ac」]
[「ad」]
[「ae」]
[「af」]
disbot <simon_sibl> I would have bet that ! 01:22
<simon_sibl> Thanks to your example I’ll be able to make my code even shorter 😆🙏
<simon_sibl> Iterator sink-all is better memory wise than the Array right ? 01:23
<simon_sibl> I would guess the array to allocate all the matches while the iterator would do a little by little ?
Voldenet yes, sink-all simply keeps doing `skip-one` and does nothing with the value 01:24
disbot <simon_sibl> Thanks !! 01:29
01:32 Aedil joined
disbot <jubilatious1_98524> Not sure if I understand... all I have to do is andthen sum $/ and it works. ~ % printf "10 12\n20 22\n22 24\n" | \ raku -ne 'BEGIN my $sum; m:g/ (\d) (\d) { $sum += (10*$0)+$1 } / andthen put sum $/; END say "total: ", $sum;' 22 42 46 total: 110 02:06
<jubilatious1_98524> m: raku -e ' $_ = "ab ac ad ae af"; m:g/ (a.) { $0.say } / andthen $/.Str; 02:13
evalable6 (exit code 1) ===SORRY!=== Error while compilin…
jubilatious1_98524, Full output: gist.github.com/a67e5cb720de07e836...d7ac319e70
disbot <Raku eval> Failed to create container: Failed while sending request: Failed read response: Resource temporarily unavailable (os error 11)
<jubilatious1_98524> m: $_ = "ab ac ad ae af"; m:g/ (a.) { $0.say } / andthen $/.Str; 02:14
evalable6 ab
ac
ad
ae
af
disbot <Raku eval> Failed to create container: Failed while sending request: Failed read response: Resource temporarily unavailable (os error 11)
02:15 hulk left 02:21 kylese joined
Voldenet that's easy, .Str just evaluates all matches first 03:30
m: $_ = "ab ac ad ae af"; m:g/ (a.) { $0.say } / andthen $/.head(2).Str.say
camelia ab
ac
ad
ab ac
Voldenet but it doesn't have to
03:33 kjp left
Voldenet and it has to evaluate whole regex, because .Str returns matched text 03:34
and probably copies the string on the way
a lot of methods evaluate all matches in some way 03:36
m: $_ = "ab ac ad ae af"; m:g/ (a.) { $0.say } / ~~ 345213625 # fair number generated with 9 dice rolls, guaranteed to be unique ;>
camelia ab
ac
ad
ae
af
linkable6 (2024-12-11) github.com/vsilet/commited/commit/345213625e
Voldenet not as unique as I hoped 03:37
03:57 arkiuat left 04:25 Aedil left 04:29 Aedil joined 04:31 arkiuat joined 04:35 arkiuat left 04:50 kylese left 04:55 kylese joined 04:56 kjp joined
disbot <jubilatious1_98524> > that's easy I should have guessed you'd say that. 05:06
05:06 kjp left 05:10 kjp joined 05:37 derpydoo joined 05:46 atweedie left, atweedie joined 05:53 kjp left 05:54 kjp joined 05:55 arkiuat joined 06:00 arkiuat left 06:05 abraxxa joined 06:17 librasteve_ joined 06:28 arkiuat joined 06:33 arkiuat left 06:56 jjido joined 06:59 LainIwakura joined 07:08 LainIwakura left 07:12 arkiuat joined 07:14 jjido left 07:16 derpydoo left 07:17 arkiuat left 07:18 Sgeo left
Voldenet by easy I meant that you can guess why it evaluates everything just by looking at what Str returns 07:25
07:27 lichtkind joined
Voldenet it's more complicated when you use it with ~~ – is every match compared to the right side somehow or does Match object have to equal right side, are all matches evaluated at the end, or one by one etc. 07:27
in fact, I have no idea what the above smartmatch fully does, normally I think it checks if regex matches some value(s), like "ab" or <ab ac> 07:40
but in case of numbers it's probably… hm, matches count?
07:40 arkiuat joined
Voldenet m: $_ = "ab ac ad ae af"; say so m:g/ (a.) { $0.say } / ~~ 3 07:43
camelia ab
ac
ad
ae
af
False
Voldenet m: $_ = "ab ac ad ae af"; say so m:g/ (a.) { $0.say } / ~~ 5
camelia ab
ac
ad
ae
af
True
Voldenet so it's still extracting list of all matches no matter what it's compared to 07:44
07:44 LainIwakura joined 07:45 arkiuat left
Voldenet I think .Int gets used which returns number of results, so obviously extracts all matches too 07:47
07:49 jjido joined
Voldenet Ah, it's actually list's int method that gets used, not Match.Int 07:50
m: $_ = "ab ac ad ae af"; say so m/ (a.) { $0.say } / ~~ 5 # error, because "ab" is not an int
camelia ab
False
Voldenet m: $_ = "ab ac ad ae af"; say m/ (a.) { $0.say } / ~~ 5 # error, because "ab" is not an int
camelia ab
False
Voldenet m: $_ = "ab ac ad ae af"; say m/ (a.) { $0.say } /.Int # error, .Int called not on a list 07:51
camelia abCannot convert string to number: base-10 number must begin with valid digits or '.' in '<HERE>ab' (indicated by <HERE>)
in block <unit> at <tmp> line 1

Voldenet m: $_ = "ab ac ad ae af"; say m:g/ (a.) { $0.say } /.Int # no error, .Int called on a list 07:52
camelia ab
ac
ad
ae
af
5
Voldenet so .Str also actually gets called on a list in that case 07:54
…or so I think ;p 07:55
(the example with ~~ 5 had the failure too, but "so" masks it) 07:56
08:08 LainIwakura left 08:22 jjido left 08:27 apac joined 08:30 jjido joined 08:38 jjido left 08:47 LainIwakura joined 08:57 arkiuat joined 09:02 arkiuat left 09:13 apac left 09:27 LainIwakura left 09:34 jjido joined 09:42 arkiuat joined 09:47 arkiuat left 10:02 librasteve_ left, melezhik joined 10:19 jjido left 10:22 jjido joined 10:40 DavidSch__ joined 10:43 arkiuat joined 10:48 arkiuat left 10:59 jjido left 11:00 jjido joined 11:16 arkiuat joined 11:19 jjido left 11:24 arkiuat left 11:34 apac joined 11:44 arkiuat joined 11:49 arkiuat left
melezhik Weekly: news.ycombinator.com/item?id=44939615 11:52
Please vote if you like it, thanks 11:53
lizmat weekly: news.ycombinator.com/item?id=44939615 11:55
notable6 lizmat, Noted! (weekly)
lizmat must apparently be lowercase
melezhik Thanks Liz 11:58
12:15 arkiuat joined 12:22 arkiuat left 12:45 arkiuat joined 12:50 arkiuat left 13:19 arkiuat joined 13:24 arkiuat left 13:43 arkiuat joined 14:13 jjido joined 15:30 abraxxa left 15:42 melezhik left 15:45 librasteve_ joined 15:52 apac left 16:09 nort_ left 16:34 lichtkind left, lichtkind joined 16:49 cpli left, cpli joined 16:55 lichtkind left 17:00 jjido left 17:40 lichtkind joined 17:51 ntv joined, apogee_ntv left 17:57 jjido joined 18:05 librasteve_ left 18:43 librasteve_ joined
librasteve_ notable6 weekly 18:43
notable6: weekly 18:44
notable6 librasteve_, 6 notes: gist.github.com/fdc230713f46ea632a...6799d7f397
librasteve_ notable6: weekly reset 18:49
notable6 librasteve_, Moved existing notes to “weekly_2025-08-18T18:49:33Z”
librasteve_ rakudoweekly.blog/2025/08/18/2025-...esilience/ 18:55
19:04 jjido left 19:16 arkiuat left
lizmat librasteve_++ 19:36
19:45 arkiuat joined 19:50 arkiuat left 20:02 jjido joined 20:07 jjido left 20:08 abraxxa-home joined 20:10 abraxxa-home left 20:11 abraxxa-home joined 20:15 apac joined 20:17 rantanplan joined, arkiuat joined 20:20 snonux left, DavidSch__ left, releasable6 left, xkr47 left, tejr left, eseyman left, japhb left, kaskal left, jmcgnh left, inspork left, lucs left, bartolin left 20:22 arkiuat left 20:24 xkr47_ joined 20:25 DavidSch__ joined, releasable6 joined, xkr47 joined, tejr joined, eseyman joined, japhb joined, kaskal joined, jmcgnh joined, inspork joined, lucs joined, bartolin joined 20:27 xkr47 left, xkr47_ is now known as xkr47 20:28 arkiuat joined 20:40 jgaz joined 20:45 MyNetAz joined 21:01 jjido joined 21:04 Aedil left 21:18 abraxxa-home left 21:40 arkiuat left, arkiuat joined 21:45 arkiuat left 22:14 arkiuat joined 22:20 arkiuat left, thatonelutenist left, thatonelutenist joined 22:23 apac left 22:32 DavidSch__ left 22:38 jjido left 23:12 Sgeo joined 23:16 arkiuat joined 23:46 Sgeo left 23:47 Sgeo joined