develooper Front page | perl.perl6.language | Postings from June 2005

Re: reduce metaoperator on an empty list

Thread Previous | Thread Next
June 1, 2005 06:38
Re: reduce metaoperator on an empty list
Message ID:

> You have to either supply an initial value or refactor your logic not
> to allow an empty @array (as in the first case).  If you want it some
> other way, there are far too many special cases we have to work with,
> some of which are just mathematically impossible.
> I think `fail`ing is the best bet.

I haven't read the whole thread, so I'm sorry, if it was before. I think 
that a fail is a good idea. Or maybe it should be a warning, and the 
return value should be undef.

I mean:

   [<]@empty === undef < undef;
   [*]@empty === undef * undef;


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About