Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Continuation
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Uses=== Continuations simplify and clarify the implementation of several common [[software design pattern|design pattern]]s, including [[coroutine]]s/[[green thread]]s and [[exception handling]], by providing the basic, low-level primitive which unifies these seemingly unconnected patterns. Continuations can provide elegant solutions to some difficult high-level problems, like programming a web server that supports multiple pages, accessed by the use of the forward and back buttons and by following links. The [[Smalltalk]] [[Seaside (software)|Seaside]] web framework uses continuations to great effect, allowing one to program the web server in procedural style, by switching continuations when switching pages. More complex constructs for which ''"continuations provide an elegant description"''<ref name="history_of_continuations"/> also exist. For example, in [[C (programming language)|C]], [[longjmp]] can be used to jump from the middle of one [[Function (computer science)|function]] to another, provided the second function lies deeper in the stack (if it is waiting for the first function to return, possibly among others). Other more complex examples include [[coroutine]]s in [[Simula|Simula 67]], [[Lua (programming language)|Lua]], and [[Perl]]; tasklets in [[Stackless Python]]; [[Generator (computer science)|generators]] in [[Icon (programming language)#Generators|Icon]] and [[Python (programming language)|Python]]; continuations in [[Scala (programming language)|Scala]] (starting in 2.8); [[Fiber (computer science)|fibers]] in [[Ruby (programming language)|Ruby]] (starting in 1.9.1); the [[backtracking]] mechanism in [[Prolog]]; [[Monad (functional programming)|monads]] in [[functional programming]]; and [[Thread (computer science)|threads]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)