Couldn't that be done easier with take/gather?
my @in = <a a a a b c c a a d e e e e>; my @out = gather { for @in -> $i { state $last; take $i if $i ne $last; $last = $i; }}; say @out;
In reply to Re^2: 99 Problems in Perl6
by eric256
in thread 99 Problems in Perl6
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |