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

Re: reduce metaoperator on an empty list

Thread Previous | Thread Next
From:
Michele Dondi
Date:
May 19, 2005 01:50
Subject:
Re: reduce metaoperator on an empty list
Message ID:
Pine.LNX.4.62.0505191034130.27669@pilsner.pcteor1.mi.infn.it
On Wed, 18 May 2005, Matt Fowles wrote:

> All~
>
> What does the reduce metaoperator do with an empty list?

Interesting. Mathematically an empty sum is zero and an empty product is 
one. Maybe each operator {c,s}hould have an associated method returning 
its neutral element for [] to use it on empty lists, so that it would 
probably return undef on empty lists.


Just my 2 Eurocents,
Michele
-- 
It was part of the dissatisfaction thing.  I never claimed I was a
nice person.
- David Kastrup in comp.text.tex, "Re: verbatiminput double spacing"

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