02:32 melezhik joined 02:45 melezhik left
Nemokosch yes, I figured something similar, e.g [(|)] 10:19
can operators defined as methods? 10:20
10:53 lizmat_ joined 10:54 TempIRCLogger__ joined 10:55 TempIRCLogger left 10:57 lizmat left 10:58 TempIRCLogger__ left, TempIRCLogger joined
also, how do I split an iterable into two based on a criteria? 11:21
lizmat_ perhaps with categorize? 12:02
12:02 lizmat_ left 12:03 lizmat joined
Nemokosch thank you, gotta try that 12:21
m: my (@filtered, @rest) := categorize(* %% 5, (1..90).pick: 5){True, False}; dd @filtered, @rest; 13:11
is there a better way to do this?
lizmat not at the moment, no 13:16
I guess we could make a Supply version of categorize, that would return a Supply of Supplies 13:17
Nemokosch lol 13:18
I kinda miss some decent pattern matching mechanism 13:19
when JS has that for years by now
much more than this slurp-slurp-slurpiness all around tbh
lizmat could you elaborate on that? maybe it's easy to make a module for it :-) 13:20
13:21 lizmat left
Nemokosch my (True => @filtered, False => @rest) := categorize(...) 13:21
would already feel much better
this is pretty much a transliteration of ES6 destructuring assignment
13:23 lizmat joined, TempIRCLogger__ joined 13:24 TempIRCLogger left 13:27 TempIRCLogger__ left, TempIRCLogger joined
gfldex @Nemokosch#9980 I'm working on a Christmas present for you. :) 15:42
Nemokosch 😯 15:44
Hydrazer that's pretty good 17:07
SmokeMachine m: my ($a, $b); :(:True($a), :False($b)) := ^10 .classify: * %% 2; dd $a; dd $b 20:24
camelia $[0, 2, 4, 6, 8]
$[1, 3, 5, 7, 9]
SmokeMachine m: my (@a, @b); :(:True(@a), :False(@b)) := ^10 .classify: * %% 2; dd @a; dd @b
camelia Array element = [0, 2, 4, 6, 8]
Array element = [1, 3, 5, 7, 9]
SmokeMachine Nemokosch: 👆this is also possible 20:26
21:33 qorg11 left, qorg11 joined 23:04 discord-raku-bot left 23:13 discord-raku-bot joined