At 6:22 PM -0800 1/23/07, Larry Wall wrote:
Recently I started redefining C<map> to return multislices such that
map { $_, $_ * 10 }, 1..3
seems to return 1,10,2,20,3,30 by default, but in a multidimensional
context:
@@multislice := map { $_, $_ * 10 }, 1..3
it would have the value [1,10], [2,20], [3,30].
Maybe I'm missing something important that would affect various new
Perl 6 features, but if not then we could simply do this like it is
done in Perl 5, which is to use the "smooth" approach all the time,
and if people want chunks, they do something that would cause
explicit chunking.
Eg, smooth:
map { $_, $_ * 10 }, 1..3
Vs chunky:
map { [$_, $_ * 10] }, 1..3
-- Darren Duncan