Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Nested Quantum::Superpositions

by runrig (Abbot)
on Nov 06, 2003 at 19:02 UTC ( #305196=note: print w/replies, xml ) Need Help??

in reply to Nested Quantum::Superpositions

Without ever having used that module extensively, my thinking is that for your second example, you want this:
(all(1,4) == any(any(1,4), any(2), any(3))) and print "y2\n";
all(1,4) can not equal all(1,4) because that would mean 1 equals 4, which is obviously not true.

Update: After rereading your post, I'm thinking that the above is probably not what you want either. I don't think this is correct:

use Quantum::Superpositions; if ( any("tall", "rich", "handsome") eq all('tall', 'rich', 'handsome' +) ) { print "match1\n"; } if ( all("tall", "rich", "handsome") eq any('tall', 'rich', 'handsome' +) ) { print "match2\n"; } #prints: match2
Update: I think I understand the example in the docs now(posted by welchav above), and the reason it doesn't seem to work is that you can't use any simple Q::S object to equal any of those feature sets. No one simple thing can equal 'all' of "tall", "rich", and "handsome". You need some special object which can equal all of those things at once. And so I'm not sure if the results above are correct, or a bug. I don't know if 'eq' in Q::S is supposed to be commutative.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://305196]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2018-11-20 00:24 GMT
Find Nodes?
    Voting Booth?
    My code is most likely broken because:

    Results (219 votes). Check out past polls.