Difference between revisions of "Continuation"
Jump to navigation
Jump to search
EndreyMark (talk | contribs) m (/*Powerful metaphors, images* other better localization of links: linking directly the cited sections) |
EndreyMark (talk | contribs) ((1) →Imperative metaphors: split off from →Functional metaphors: (2) Adding Daume III's ``what to do next'' metaphor.) |
||
Line 4: | Line 4: | ||
=== Powerful metaphors, images === |
=== Powerful metaphors, images === |
||
+ | |||
+ | Here is a collection of short descriptions, analogies or metaphors, that illustrate this difficult concept, or an aspect of it. |
||
+ | |||
+ | ==== Imperative metaphors ==== |
||
* “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” (Wikipedia's [http://en.wikipedia.org/wiki/Continuation Continuation]). |
* “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” (Wikipedia's [http://en.wikipedia.org/wiki/Continuation Continuation]). |
||
⚫ | |||
* “At its heart, <code>call/cc</code> is something like the <code>goto</code> instruction (or rather, like a label for a <code>goto</code> instruction); but a Grand High Exalted <code>goto</code> instruction... The point about <code>call/cc</code> is that it is not a ''static'' (lexical) <code>goto</code> instruction but a ''dynamic'' one“ (David Madore's [http://www.madore.org/~david/computers/callcc.html#sec_intro A page about <code>call/cc</code>]) |
* “At its heart, <code>call/cc</code> is something like the <code>goto</code> instruction (or rather, like a label for a <code>goto</code> instruction); but a Grand High Exalted <code>goto</code> instruction... The point about <code>call/cc</code> is that it is not a ''static'' (lexical) <code>goto</code> instruction but a ''dynamic'' one“ (David Madore's [http://www.madore.org/~david/computers/callcc.html#sec_intro A page about <code>call/cc</code>]) |
||
+ | |||
+ | ==== Functional metaphors ==== |
||
+ | |||
⚫ | |||
+ | * “The idea behind CPS is to pass around as a function argument what to do next“ ([http://www.isi.edu/~hdaume/htut/ Yet Another Haskell Tutorial] written by Hal Daume III, 4.6 Continuation Passing Style, pp 53-56)) |
||
+ | |||
=== Links === |
=== Links === |
||
Revision as of 14:52, 24 May 2006
General or introductory materials
Powerful metaphors, images
Here is a collection of short descriptions, analogies or metaphors, that illustrate this difficult concept, or an aspect of it.
Imperative metaphors
- “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” (Wikipedia's Continuation).
- “At its heart,
call/cc
is something like thegoto
instruction (or rather, like a label for agoto
instruction); but a Grand High Exaltedgoto
instruction... The point aboutcall/cc
is that it is not a static (lexical)goto
instruction but a dynamic one“ (David Madore's A page aboutcall/cc
)
Functional metaphors
- “Continuations represent the future of a computation, as a function from an intermediate result to the final result“ (Continuation monad section in Jeff Newbern's All About Monads)
- “The idea behind CPS is to pass around as a function argument what to do next“ (Yet Another Haskell Tutorial written by Hal Daume III, 4.6 Continuation Passing Style, pp 53-56))
Links
- Wikipedia's Continuation is a surprisingly good introductory material on this topic. See also Continuation-passing style.
- Yet Another Haskell Tutorial written by Hal Daume III contains a section on continuation passing style (4.6 Continuation Passing Style, pp 53-56)
- HaWiki has a page on ContinuationPassingStyle, and some related pages linked from there, too.
- David Madore's A page about
call/cc
describes the concept, and his The Unlambda Programming Language page shows how he implemented this construct in an esoteric functional programming language.
Continuation monad
- Jeff Newbern's All About Monads contains a section on it.
- Control.Monad.Cont is contained by Haskell Hierarchical Libraries.