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

Re: reduce metaoperator on an empty list

Thread Previous | Thread Next
Rob Kinyon
May 18, 2005 19:56
Re: reduce metaoperator on an empty list
Message ID:
On 5/18/05, Stuart Cook <> wrote:
> To summarise what I think everyone is saying, []-reducing an empty
> list yields either:
> 1) undef (which may or may not contain an exception), or
> 2) some unit/identity value that is a trait of the operator,
> depending on whether or not people think (2) is actually a good idea.

I would think that the Principle of Least Surprise points to (1),
given that the standard explanation of the [+]@x is eval join( '+', @x
) ...


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