Please consider the possiblity of tristate logic (RFC TBD.) ala, SQL.
Assuming a "use tristate", undef + number = undef
This might require that the reduce function be able to ignore undefs.
Either always under the tristate pragma. Or on a case by case basis.
Also you haven't specified if the arguments to reduce are evaluated
lazily.
<chaim>
>>>>> "PRL" == Perl6 RFC Librarian <[EMAIL PROTECTED]> writes:
PRL> The first call to the reduction subroutine will be passed the first N
PRL> elements of the list, and subsequent calls will be passed the result of
PRL> the previous call and the next N-1 elements in the list, until no more
PRL> elements remain in the list. If fewer than N-1 elements remain on the
PRL> final call, all the remaining elemetns are passed.
PRL> If the original list has no elements, C<reduce> immediately returns C<undef>.
PRL> If the original list has a single element, that element is immediately returned
PRL> (without every calling the reduction subroutine).
PRL> Otherwise, the result of the final reduction call is the result returned
PRL> by C<reduce>.
PRL> If the reduction subroutine is ever terminated by a call to C<last>,
PRL> the enclosing C<reduce> immediately returns the last reduction value
PRL> (i.e. C<undef> on the first reduction call, $_[0] otherwise)
--
Chaim Frenkel Nonlinear Knowledge, Inc.
[EMAIL PROTECTED] +1-718-236-0183