in reply to Re: 99 Problems in Perl6
in thread 99 Problems in Perl6
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: 99 Problems in Perl6
by gaal (Parson) on Feb 21, 2007 at 20:45 UTC | |
by eric256 (Parson) on Feb 21, 2007 at 23:37 UTC |