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

Re: reduce metaoperator on an empty list

Thread Previous | Thread Next
From:
=?iso-8859-2?Q?B=C1RTH=C1ZI_Andr=E1s?=
Date:
June 1, 2005 06:38
Subject:
Re: reduce metaoperator on an empty list
Message ID:
Pine.LNX.4.61.0506011534090.27310@wish.hu
Hi,

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

Bye,
   Andras

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About