in reply to Re^2: 99 Problems in Perl6
in thread 99 Problems in Perl6

TIMTOWTDI of course, but syntax updates to gather since the OP allow you to write it as:

my @in = <a a a a b c c a a d e e e e>; say gather for @in -> $i { state $last; $last = take $i if $i ne $last; };

Replies are listed 'Best First'.
Re^4: 99 Problems in Perl6
by eric256 (Parson) on Feb 21, 2007 at 23:37 UTC

    Excellent. I'd been looking for a better syntax as i was sure there was one..now if perl6 just had a way to access the last element returned by for you could simplify it even one more time.


    ___________
    Eric Hodges