Aktuelle Änderungen Printable View Änderungen Bearbeiten
SExpressions > HeapAndStack > SQLInjection > CodeInjection > AlexMartelli > ClojureHacks > DenkzeitWiki > ChoosePython > PythonVsRuby > TortoiseMerge > TypeInference > BeautifulCode > ReadEvalPrint > JamieZawinski > PythonSprache > GuisInClojure > ContinuationsClear Traila continuation is a way to represent the execution state (i.e. the stack frame) of a program at a given point [1]
continuations have sometimes been described as `gotos with arguments'.
A continuation is a closure, but not vice versa.
Stack Recursion
gotos with arguments [2]
Continuations are variously understood as representations of the current evaluation context and as representations of the rest of the computation, but these understandings contradict each other
A continuation is a program frozen in action: a single functional object containing the state of a computation. When the object is evaluated, the stored computation is restarted where it left off. In solving certain types of problems it can be a great help to be able to save the state of a program and restart it later. In multiprocessing, for example, a continuation conveniently represents a suspended process. In nondeterministic search programs, a continuation can represent a node in the search tree.
One thing that people don’t often tell you about continuations is that they don’t actually resume exactly where you left off. After all, if they did, you would end up in an infinite loop. The only thing that is really restored is a few pointers. Everything that resides on the heap, or is stored externally in places like files and databases, remains unaffected when you invoke a continuation.
Exceptions are escape continuations.
[4]
continuations are basic building blocks: you can build on top of them exception systems, generators, coroutines, microthreads, etc, and it is an interesting learning experience to understand how this is done. [5]
Continuations are the functional expression of the GOTO statement, and the same caveats apply.[6]!)
The Actor model treats “Actors” as the universal primitives of concurrent digital computation: in response to a message that it receives, an Actor can make local decisions, create more Actors, send more messages, and determine how to respond to the next message received. The Actor model has been used both as a framework within which to develop a theoretical understanding of concurrency, and as the theoretical basis for several practical implementations of concurrent systems.