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

Re: reduce metaoperator on an empty list

Thread Previous | Thread Next
From:
Juerd
Date:
May 31, 2005 19:26
Subject:
Re: reduce metaoperator on an empty list
Message ID:
20050601022624.GA26711@c4.convolution.nl
Damian Conway skribis 2005-06-01 10:44 (+1000):
>     2+ args: interpolate specified operator
>     1 arg:   return that arg
>     0 args:  fail (i.e. thrown or unthrown exception depending on use fatal)

Following this logic, does join(" ", @foo) with +@foo being 0 fail too?

I dislike this, and would prefer [op] with no elements to simply return
whatever () returns: an empty list in list context, undef in scalar
context.


Juerd
-- 
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html 
http://convolution.nl/gajigu_juerd_n.html

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