guifa | MasterDuke indeed. I wonder if a grammar by default should avoid the more Raku-y ones like <identifier>. <digit> makes sense (and can even be usefully overridden with <[0..9]> ) | 03:28 | |
actually, nm. They aren't included (I think I've been in slang world too long). There shouldn't be a problem with identifier or token, etc, in a normal grammar. | 05:32 | ||
08:50
TempIRCLogger left
08:51
lizmat left,
RakuIRCLogger left
08:59
dakkar joined
09:00
lizmat_ left,
lizmat joined
11:39
frost left
|
|||
Nemokosch | Hello | 12:35 | |
yes, I'm thinking about 154-2... | |||
is there a nice way to remove duplicates from a Seq? | 12:36 | ||
MasterDuke | .unique | 13:17 | |
Nemokosch | wow thanks, this is good to know | 13:24 | |
what is the runtime cost of using it? I guess it needs to store the elements of the sequence? | |||
MasterDuke | github.com/rakudo/rakudo/blob/mast...1846-L1882 | 13:32 | |
so yeah, just checked against a hash it creates | 13:34 | ||
15:07
frost joined
15:36
frost left
17:40
dakkar left
18:07
Hello16 joined
18:08
Hello16 left
|
|||
gfldex | <@297037173541175296> .squish might work too | 19:26 | |
Nemokosch | Oh? | 19:28 | |
Nahita | if sequential | ||
m: [12, 12, 4, -1, 12].squish.say | |||
Nemokosch | Yeah, that is for something else, right? | ||
Nahita | yeah, they did say \*might\* | ||
Nemokosch | It's more effective but tbh I wouldn't want to depend on a "trivial detail" like this | 19:32 | |
gfldex | @Nemokosch#9980 do you care to share your 154-2 solution? | 20:41 | |
Nemokosch | <github.com/manwar/perlweeklychalle...2.raku> | 20:45 | |
gfldex | here is mine: gfldex.wordpress.com/2022/03/01/pushing/ | 20:46 | |
Nemokosch | Nice :) | 20:52 | |
I see you love containerless stuff | 20:53 | ||
Nahita | `×` instead of 1 more `*` could be better to avoid confusion IMHO, while you're using ∞ | 20:55 | |
so many *s | |||
gfldex | m:``` | 20:59 | |
use experimental :cached; | |||
proto P(Int $n) is cached { * } | |||
multi sub P ($n where * == 0|1|2) { 1 } | |||
multi sub P ($n where * ≥ 3) { P($n - 2) + P($n - 3) } | |||
(0..*).map(&P).grep(&is-prime).unique.head(10).say; | |||
``` | |||
@Nemokosch#9980 is cached works for multis too | |||
Nemokosch | I know but I preferred given when here | 21:01 | |
gfldex | Sadly, we can't use junctions as literals in signatures. | ||
Nemokosch | I suspected so | 21:05 | |
I thought if I couldn't use the constant value elegantly, why even bother with the multi | 21:07 | ||
gfldex | I like to use containerless symbols for lazy lists because they act rather like functions. | 21:15 | |
22:48
codesections5 joined
22:50
codesections left,
codesections5 is now known as codesections
|