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

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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://305196]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2018-01-18 00:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (206 votes). Check out past polls.

    Notices?