Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Re: Unusual Closure Behaviour

by HyperZonk (Friar)
on Jul 12, 2001 at 22:19 UTC ( #96136=note: print w/ replies, xml ) Need Help??

in reply to Re: Unusual Closure Behaviour
in thread Unusual Closure Behaviour

Actually, the if being evaluated first is exactly what we would want in any case. You are missing the implication of the behavior, however. The variable, besides being localized which is unexpected (until one realizes that data scoping is done at compile-time in this case), also becomes static; that is, it retains its value between calls, which is unexpected behavior for a local via my variable. See iakobski's reply in this thread for more details.

Comment on Re: Re: Unusual Closure Behaviour
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://96136]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2015-11-27 02:06 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (712 votes), past polls