From: David Vallner Date: 2006-08-17T04:24:27+09:00 Subject: Re: goto function? On Wed, 16 Aug 2006 13:55:01 +0200, Christian Neukirchen wrote: > It is often said that continuations are as powerful as goto. > But is there a way to jump *forward* with continuations, without > rewriting the code to use additional methods? As others said, continuations continue. You can jump backwards, because you know the whole context to jump into - it already existed. To jump forward in code without explicitly setting up a context in which to run would either result in undefined behaviour, accepting some defaults for the context (all local / instance / other nonglobal variables are nil, for example), or the timespace continuum breaking. That might not apply if you were scripting a time machine, of course. This is precisely why goto is considered harmful in the first place - to jump forward, you have to use only global context, or some other context that is defined to be shared when using such a construct. It would be interesting however if there was a concept of capture a (possible) future point of code execution without having to do explicit setup via a command object or something similar. I'll admit at this point that my savvy gets a little fuzzy around very high level programming theory - so I might actually be honking wrong in which case I'm all ears intrigued as to the workings of that construct. David Vallner