> In any case, the preferred option should be to provide a default value:
> 
>         $sum = reduce ^_+^_, 0, @values;
> 
> which is always cleaner *and* shorter. :-)

Ummm...Maybe I'm missing something, but how does reduce() know the
difference between

        $sum = reduce ^_+^_, 0, @values;

        unshift @values, 0;
        $sum = reduce ^_+^_, @values;

        $sum = reduce ^_+^_, 0, 1, 2, 3, 4, 5;

Is this just a prototyping issue? And if so, any reason not to make 0
the default value by default?

I'm still uneasy about the throwing exception thing, in case you can't
tell...

-Nate

Reply via email to