in reply to Re: Re: Useful uses of Quantum::Superpositions?
in thread Useful uses of Quantum::Superpositions?

That is exactly what any() does. It superimposes all of its values into a single scalar and operations on it touch all values. So if you use it in a logical operation like numeric equality - a disjunction has a true value if any of the potential operations have a true value. The point to making this a core feature is that it is syntactically easier to say things like $foo == any( $bar, $baz ..... ). Or my favorite - do the same thing for the m operator.

You'll find junctions in Apocalypse 4 though I gather its actualy more of an operator thing which is apocalypse 3. *shrug*.

Replies are listed 'Best First'.
Re: Re: Re: Re: Useful uses of Quantum::Superpositions?
by feanor_269 (Beadle) on Apr 08, 2003 at 16:51 UTC
    Does this mean you could do something like any(1..10)+1; And if so, what does it do?
    If I weren't at school, I'd try it myself.

    feanor_269

      I have no idea what that would mean to transform a disjunction. Currently my universe extends only so far as to use logical operators. At least that is intuitive about what it means. Or rather - if you impose a booleanize that disjunction then it makes sense again. The boolean value of any(1..10)+1 would be true if any of the expressions 1+1,2+1...10+1 had a true value.

      If you really meant to transform 1..10 then you'd just use a hyper operator but I don't know what that operator looks like anymore so I can't write it.

      It will be the same as saying any(2..11).
        You mean it'll DWIM? Cool... still not sure it's that useful tho...

        feanor_269