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

Re: cross scope gotos?

by BrowserUk (Pope)
on Apr 06, 2010 at 11:53 UTC ( #833026=note: print w/replies, xml ) Need Help??


in reply to cross scope gotos?

So what exactly is a "dynamic scope" here?

Basically anywhere in the current program that hasn't been optimised away:

perl -e"sub x{ goto $_[0] } bill: x( 'bill' ) " perl -e"sub x{ goto $_[0] } bill: x( 'john' ); john: goto bill;"

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: cross scope gotos?
by LanX (Bishop) on Apr 06, 2010 at 15:19 UTC
    > Basically anywhere in the current program that hasn't been optimised away:

    not that easy!

    perl -e' goto INTO; print "Start"; for $i (0..9) { INTO: print "STOP"; };' Can't "goto" into the middle of a foreach loop at -e line 4.

    You can't jump to a label out of the current or previous frames!

    see Re^3: cross scope gotos? and goto

    Cheers Rolf

      You can't jump to a label out of the current or previous frames!

      I think that's (currently) an over statement:

      perl -le"goto loop; $x=0; if( $x ){ while(1){ loop: print 'hi' } }"

      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        > I think that's (currently) an over statement:

        nope, while has a proper block but not a proper "frame" like foreach or subs.

        (I read somewhere that foreach has internally a frame, but no time to search now...)

        But the confusion is understandable, that's why I started the thread.

        Cheers Rolf

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://833026]
help
Chatterbox?
[marto]: yes, trying to do anything other than sideload to android via windows has always been more effort than linux
[Corion]: The inconvenient thing is that my Linux machine is in another room than my desktop, so I have to walk up to it while some device is hooked up to it, just to press "allow" for install tasks etc :-)
[Corion]: I see the Chuwi H9 Air, but at the price of 8 or 9 cheapo tablets, that
[Corion]: ... that's not that great for quasi-disposable devices ;)
[Eily]: can't you just remote connect to the linux machine ?
[marto]: IIRC the hiemdal suite made life much easier on windows, and people on XDA developers put out released of windows only pages for adb that made it less of a pain
[marto]: Eily you can't remote connect the physical device via USB ;)
[Corion]: Eily: Sure, that's what I do, but some things you need to do on the Android device directly, like when navigating the bootloader :-)

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (10)
As of 2018-05-23 09:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?