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 men, and only two, and that young man is one kind. He is high-minded, he is pure, he’s the kind of man that the world pretends to look up to, and in fact despises. He is
    the kind of man who breeds unhappiness, particularly in women.
    Robert Bolt (1924–1995)

    Love is made by two people, in different kinds of solitude. It can be in a crowd, but in an oblivious crowd.
    Louis Aragon (1897–1982)

    There are as many kinds of beauty as there are habitual ways of seeking happiness.
    Charles Baudelaire (1821–1867)