Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #2230

Re: goto

From "BartC" <bc@freeuk.com>
Newsgroups comp.programming
Subject Re: goto
Date 2012-09-19 19:25 +0100
Organization A noiseless patient Spider
Message-ID <k3d2n5$n75$1@dont-email.me> (permalink)
References <04ef7083-e585-41b5-a7b2-9752597583d6@googlegroups.com> <9dadnbInqY6nacTNnZ2dnUVZ_oqdnZ2d@earthlink.com>

Show all headers | View raw



"Patricia Shanahan" <pats@acm.org> wrote in message 
news:9dadnbInqY6nacTNnZ2dnUVZ_oqdnZ2d@earthlink.com...
> On 9/19/2012 9:00 AM, bob wrote:
>> In most languages that support goto, can you do a goto from one function 
>> to another?
>>
>
> A function call usually involves some set-up that is done as part of
> function call, such as pushing a stack frame to contain the local
> variables, and remembering where to return to. Jumping into the middle
> of the function without doing that set-up would cause problems.
>
> The closest I know of are coroutines.

I do it all the time in one of my languages. But you need to know what is 
happening.

In my case, I use it for threaded code, where you do a goto, not a call, to 
the start of one function, and that then terminates by doing a goto, not a 
return or call, to the next function.

There are a few other uses, but it's usually too risky to do with a 
language/compiler you're not familiar with, even if there is some way of 
doing it.

-- 
Bartc 

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

goto bob <bob@coolfone.comze.com> - 2012-09-19 09:00 -0700
  Re: goto diego <deepakpjose@gmail.com> - 2012-09-19 09:28 -0700
    Re: goto diego <deepakpjose@gmail.com> - 2012-09-19 09:28 -0700
      Re: goto bob <bob@coolfone.comze.com> - 2012-09-20 12:36 -0700
  Re: goto Patricia Shanahan <pats@acm.org> - 2012-09-19 09:35 -0700
    Re: goto "BartC" <bc@freeuk.com> - 2012-09-19 19:25 +0100
    Re: goto Anonymous <nobody@remailer.paranoici.org> - 2012-09-20 17:04 +0000
  Re: goto Robin Vowels <robin.vowels@gmail.com> - 2012-09-20 18:37 -0700
    Re: goto Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-09-21 10:35 -0700
  Re: goto Mok-Kong Shen <mok-kong.shen@t-online.de> - 2012-09-22 22:48 +0200
    Re: goto Mok-Kong Shen <mok-kong.shen@t-online.de> - 2012-09-22 23:14 +0200
      Re: goto Patricia Shanahan <pats@acm.org> - 2012-09-22 16:12 -0700
        Re: goto Mok-Kong Shen <mok-kong.shen@t-online.de> - 2012-09-23 15:25 +0200
      Re: goto Robin Vowels <robin.vowels@gmail.com> - 2012-09-28 18:07 -0700
  Re: goto Florian Scholz <florian.scholz@stud.hn.de> - 2012-09-28 18:36 +0200
    Re: goto bob <bob@coolfone.comze.com> - 2012-09-28 15:05 -0700
      Re: goto "BartC" <bc@freeuk.com> - 2012-09-28 23:39 +0100

csiph-web