in reply to Nested Quantum::Superpositions
any(all(1,4)) evaluates to any() since in scalar context there's nothing that can evaluate to all(1,4), i.e. to 1 and 4 simulataneously (any is conjunctive).
I've just tried out the example in de docs, and is doesn't seem to work:
Changing any to all for @features doesn't help matters.my @features = ("tall", "handsome", "rich"); my $ideal = any(all("tall", "handsome", "rich" all("rich", "old"), all("smart", "rich", "Australian")); if (any(@features) eq $ideal) { print "success\n"; } else { print "failure\n"; } print any(@features), "\n"; print $ideal, "\n"; __END__ failure any(handsome,tall,rich) any()
I think we'll need Damian on this, -gjb-
Update: Removed the strike-through of the explanation since it seems to be correct after all. The docs are probably wrong.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Nested Quantum::Superpositions
by welchavw (Pilgrim) on Nov 06, 2003 at 21:07 UTC | |
|
Re: Re: Nested Quantum::Superpositions
by runrig (Abbot) on Nov 07, 2003 at 06:17 UTC |