[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IDL interpreter questions - can someone (D.Fanning) explain - TIA

<mankoff@I.HATE.SPAM.lasp.colorado.edu> writes:

> On 18 May 2001, Craig Markwardt wrote:
> > As for continuations, closures, etc., these are computer science
> > jargon for specific language behaviors.  IDL has none of them.  I
> > understand continuations to be a way for execution contexts to be
> > suspended, saved, and later restored.  Perhaps the CATCH error
> > handling technique is a nascent continuation.  Alas, this has nothing
> > to do with the CONTINUE reserved word recently added to FOR and WHILE
> > loops.
> ok, i get it.
> But if you want to "suspend, save, restore" the execution state, wouldn't
> "save, /vars" and "save, /all" simulate this to some extent?

Yes, sort of, but a formal continuation also saves the execution
context, not just the variables.  Take a look at CATCH for exception
handling and you will see that CATCH can essentially return *twice*.
Once in the normal program flow, and a second time if an error occurs.

So, internally CATCH saves the execution context so that when an error
happens the execution can resume again within CATCH.  To be honest I
don't totally understand formal continuations, but I think CATCH is a
rudimentary example of one.


Craig B. Markwardt, Ph.D.         EMAIL:    craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response