Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: When I'm arguing with a fool...

by papidave (Monk)
on Sep 07, 2007 at 21:43 UTC ( #637763=note: print w/replies, xml ) Need Help??


in reply to Re: When I'm arguing with a fool...
in thread When I'm arguing with a fool...

I had some time to think about it, and realized that my code isn't valid. My earlier example depends on a race condition to select one state or the other. What I _should_ have done is implement a solution that acts both ways without interference:
my $folly = $fool->folly; my $tabby = new Cat( owner => 'Schroedinger' ); answer( $folly ) if ( $tabby->alive ); answer( not $folly ) unless ( $tabby->alive );
The problem I've been running into is that the first time I call Cat::alive(), the quantum decoherence collapses, and it only invokes answer() once. Does anyone have a method for measuring the "alive" state of $tabby without actually looking into the box? I think I need to modify the implementation of sub alive() ...

Replies are listed 'Best First'.
Re^3: When I'm arguing with a fool...
by jdporter (Canon) on Sep 07, 2007 at 22:57 UTC

    use Quantum::Superpositions:

    use Quantum::Superpositions; sub You::answer_according_to_his_folly() { any( 0, 1 ) } not $you->answer_according_to_folly($fool) or $you->be_like($fool); $you->answer_according_to_folly($fool) or $fool->be_wise_in_own_ey +es();
    A word spoken in Mind will reach its own level, in the objective world, by its own weight

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://637763]
help
Chatterbox?
[ww]: ++ambrus "their browser died just when...."
[ambrus]: ww: or they accidentally closed the window, or something. the exact excuse doesn't matter.
[ambrus]: you hear that on web forums frequently.
LanX Fermat 's famous browser
[ww]: ambrus agree; got the t-shirt, et al

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (17)
As of 2017-03-23 18:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (292 votes). Check out past polls.