|Perl Monk, Perl Meditation|
Re: Nested Quantum::Superpositionsby tilly (Archbishop)
|on Nov 07, 2003 at 00:36 UTC||Need Help??|
Allow me to clarify runrig's answer in case it didn't make sense to you. all(1,4) == all(1,4) would be true if 1 == all(1,4) and 4 == all(1,4).
For the first statement to be true we must have 1 == 1 and 1 == 4 Since 1 is not 4, the first one is false.
The second one is false for the same reason. A fact that we didn't actually need to check since the failure of either the first or the second statement is enough to make the overall comparison fail.
Therefore in quantum logic, all(1,4) != all(1,4), no matter how much that violates your classical prejudices.
And that is why the match that you expected to find in the more complex example, wasn't found.
UPDATE Here is a simple example to make you think that the way that Quantum::Superpositions works is reasonable. Just read the statement all(1, 2, 3) < all(4, 5, 6) as plain English. All of (1, 2, 3) are less than all of (4, 5, 6). Which is true. So the code evaluates to true. By contrast all(1, 2, 4) < all(3, 5, 6) says that All of (1, 2, 4) are less than all of (3, 5, 6). Which is false because 4 is not less than 3. And so the code evaluates to false.
And this is exactly how Quantum::Superpositions works. When you read all(1,4) == all(1,4), don't think of all(1,4) as a "thing" in and of itself. It isn't. Think of the whole statement as being a sentence asserting something, and think about whether that assertion is correct.
Yes, at some level all(1,4) has to be a single Perl scalar. But the illusion is that it isn't, and with TheDamian doing the illusioning, you can bet that it is a pretty darned good illusion!