Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Nested Quantum::Superpositions

by runrig (Abbot)
on Nov 07, 2003 at 00: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 studying the Monastery: (7)
As of 2018-08-20 20:17 GMT
Find Nodes?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:

    Results (196 votes). Check out past polls.