| Continuation |
Article Index for Continuation |
Articles about Continuation |
Information AboutContinuation |
| CATEGORIES ABOUT CONTINUATION | |
| control flow | |
| articles with example scheme code | |
|
In Computing , a continuation is a representation of the execution state of a program (for example, the Call Stack ) at a certain point in time. Many languages have constructs that allow a programmer to save the current execution state into an object, and then restore the state from this object at a later point in time (thereby resuming its execution). This technique has been used in Functional Programming , Imperative Programming , and Message Passing Programming . Continuations are also used in models of computation including the Actor Model , Process Calculi , and the Lambda Calculus . Steve Russell invented the continuation in his second LISP implementation for the IBM 704 , though he did not name it. Christopher Strachey , Christopher P. Wadsworth and John C. Reynolds brought the term continuation into prominence in their work in the field of Denotational Semantics that makes extensive use of continuations to allow sequential programs to be analysed in terms of Functional Programming semantics. PROGRAMMING LANGUAGE SUPPORT Many programming languages exhibit such a feature under various names; specifically:
KINDS OF CONTINUATIONS Support for continuations varies widely. A programming language supports ''re-invocable'' continuations if a continuation may be invoked repeatedly (even after it has already returned). Re-invocable continuations were introduced by Peter J. Landin using his J (for Jump) operator that could transfer the flow of control back into the middle of a procedure invocation. Re-invocable continuations have also been called "re-entrant" in the MzScheme programming language. However this use of the term "re-entrant" is too easily confused with its use in discussions of Multitasking . At one time Gerry Sussman and Drew McDermott thought that using re-invocable continuations (which they called "Hairy Control Structure") was the solution to the AI control structure problems that had originated in Planner . Carl Hewitt ''et al.'' developed message passing as an alternative solution in the Actor Model . Guy Steele and Gerry Sussman then developed the continuations in Scheme in their attempt to understand the Actor model. A more limited kind is the ''escape continuation'' that may be used to escape the current context to a surrounding one. Many languages which do not explicitly support continuations support . DISADVANTAGES Continuations are the functional expression of the GOTO statement, and the same caveats apply. While they are a sensible option in some special cases, use of continuations can result in code that is difficult to follow. In fact, the Esoteric Programming Language Unlambda includes call-to-current-continuation as one of its features solely because of its resistance to understanding. The external links below illustrate the concept in more detail. SEE ALSO
EXTERNAL LINKS
REFERENCES
> |
|
|