03:27 stanrifkin joined 03:29 stanrifkin_ left 04:31 apogee_ntv left 04:33 human-blip left, apogee_ntv joined 04:37 apogee_ntv left 04:42 apogee_ntv joined 04:43 human-blip joined 07:09 lizmat left 07:14 TempIRCLogger left 07:15 TempIRCLogger joined 07:17 lizmat joined 08:11 lizmat_ left 08:12 TempIRCLogger joined 08:13 TempIRCLogger left, lizmat_ joined 08:16 TempIRCLogger joined 08:40 lizmat_ left 08:41 lizmat joined 11:48 stanrifkin left 13:21 stanrifkin joined 14:52 librasteve_ joined
librasteve_ rakudoweekly.blog/2025/09/15/2025-37-astquery/ 15:39
16:39 lizmat_ joined 16:41 lizmat left 16:44 dakkar left 18:37 lizmat_ left, lizmat joined
rcmlz I was reading in the rakudoweekly about the "Print lines that have no duplicates in a file and preserve sort order" discussion where @jubilatious1_98524 made an advanced Raku example. I was wondering if that could be made more appealing and simple for people first looking at Raku. Here is my take glot.io/snippets/hb59kbbv7z and my question is: can I improve in line 20? How to get the keys of a Bag? 19:26
(there are only 3 lines of code - no worries about that "line 20") 19:28
nahita3882 you can do >>.key to make it a little shorter 20:39
but by making an Array and looking in it is O(N) 20:40
so in theory, the following is faster perl my %counts := @numbers.Bag; .say for @numbers.grep({ %counts{$_} == 1 }) 20:42
as hash (bag here) lookup is O(1) 20:43
SmokeMachine glot.io/snippets/hb5c9y7jet 21:28
👆does mostly the same but in a different way… 21:30
21:48 stanrifkin left 23:03 kjp left 23:04 kjp joined 23:05 kjp left 23:06 kjp joined