in reply to Short-circuiting a map list.
FWIW map in Perl 6 supports last
$ perl6 -e 'my @out = (1..5).map: { $_ == 3 and last }; say @out.perl' Array.new(False, False)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Short-circuiting a map list.
by ikegami (Patriarch) on Oct 08, 2011 at 06:39 UTC |