in reply to Re: Perl6 Infinite Lazy Lists
in thread Perl6 Infinite Lazy Lists
Come to think of it, I think there's an in-place map operator, too:my sub by_n ($n := $_) { my $k = 0; return -> $x { $x ?? $k += $n +:: $k } }; @list = @list.map( &by_n );
@list.=map( &by_n );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl6 Infinite Lazy Lists
by stvn (Monsignor) on May 03, 2005 at 01:33 UTC |