Continuation - Kinds

Kinds

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 Racket language. However this use of the term "re-entrant" can be easily confused with its use in discussions of multithreading.

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 exception handling, which is equivalent to escape continuations and can be used for the same purposes. C's setjmp/longjmp are also equivalent: they can only be used to unwind the stack. Escape continuations can also be used to implement tail call elimination.

One generalization of continuations are delimited continuations. Continuation operators like call/cc capture the entire remaining computation at a given point in the program and provide no way of delimiting this capture. Delimited continuation operators address this by providing two separate control mechanisms: a prompt that delimits a continuation operation and a reification operator such as shift or control. Continuations captured using delimited operators thus only represent a slice of the program context.

Read more about this topic:  Continuation

Famous quotes containing the word kinds:

    There are two kinds of liberalism. A liberalism which is always, subterraneously authoritative and paternalistic, on the side of one’s good conscience. And then there is a liberalism which is more ethical than political; one would have to find another name for this. Something like a profound suspension of judgment.
    Roland Barthes (1915–1980)

    There are two kinds of fathers in traditional households: the fathers of sons and the fathers of daughters. These two kinds of fathers sometimes co-exist in one and the same man. For instance, Daughter’s Father kisses his little girl goodnight, strokes her hair, hugs her warmly, then goes into the next room where he becomes Son’s Father, who says in a hearty voice, perhaps with a light punch on the boy’s shoulder: “Goodnight, Son, see ya in the morning.”
    Letty Cottin Pogrebin (20th century)

    There used to be two kinds of kisses. First when girls were kissed and deserted; second, when they were engaged. Now there’s a third kind, where the man is kissed and deserted. If Mr. Jones of the nineties bragged he’d kissed a girl, everyone knew he was through with her. If Mr. Jones of 1919 brags the same everyone knows it’s because he can’t kiss her any more. Given a decent start any girl can beat a man nowadays.
    F. Scott Fitzgerald (1896–1940)