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

reduce metaoperator on an empty list

Thread Next
From:
Matt Fowles
Date:
May 18, 2005 17:57
Subject:
reduce metaoperator on an empty list
Message ID:
f2601a7f050518175715927591@mail.gmail.com
All~

What does the reduce metaoperator do with an empty list?

my @a;
[+] @a; # 0? exception?
[*] @a; # 1? exception?
[<] @a; # false?
[||] @a; # false?
[&&] @a; # true?

Also if it magically supplies some correct like the above, how does it
know what that value is?

Thanks,
Matt
-- 
"Computer Science is merely the post-Turing Decline of Formal Systems Theory."
-???

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