> 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.

I'm not sure how this would affect the proposal. If an item in the list being
reduced is undef, it appears in the reduction subroutines arg list as undef.
The reduction subroutine can then handle it (or not) as it chooses. 

For example, to short-circuit if the reduction ever becomes undef:

        $sum = { defined $_[0] or last; $_[0]+$_[1] } 0, @numbers;


   > Also you haven't specified if the arguments to reduce are evaluated
   > lazily.

Good point. They should definitely be Virtuous. :-)

Damian

Reply via email to