On Wed, May 04, 2005 at 03:15:09PM +0200, Juerd wrote:
: Larry Wall skribis 2005-05-04  6:10 (-0700):
: > On Wed, May 04, 2005 at 08:59:04AM -0400, Rob Kinyon wrote:
: > : This may be a naive question, but what's wrong with just having a
: > : keyword called reduce()? Why do we need an operator for everything?
: > Because it's an operator/macro in any event, with weird unary or
: > listop parsing:
: >     reduce(+) @array
: That's ugly, but there's also the map-ish form, and I'd like that to
: still be available.
:     reduce { $^a + $^b }, @array;
:     reduce &infix:<+>,    @array;

Yes, we'll certainly have that form too.  It's just a little cumbersome
to use that to interpolate multiple slices into a multidimensional

    @foo[0..9; reduce &infix:<;>, @array; 0..9];

But it can probably be made to work nonetheless, presuming the list
interpolator respects interpolated multidimensional lists somehow.
Perhaps the dimensions are separated internally by some kind of
() xx Omega value to turn them surreal for contexts that care.


Reply via email to