Factbites
 Where results make sense
About us   |   Why use us?   |   Reviews   |   PR   |   Contact us  

Topic: Call with current continuation


Related Topics

In the News (Sat 28 Nov 09)

  
  Continuation - Wikipedia, the free encyclopedia
In computing, a continuation is a representation of the execution state of a program (for example, the call stack or values of variables) at a certain point.
Continuations are also used in models of computation including the Actor model, process calculi, and the lambda calculus.
Continuations are the functional expression of the GOTO statement, and the same caveats apply.
en.wikipedia.org /wiki/Continuation   (755 words)

  
 Call-with-current-continuation - Wikipedia, the free encyclopedia
The continuation behaves like an ordinary function, except that it does not return inside the caller; instead, control flow continues after the call to call/cc.
However, when f is passed to call/cc (as in the last line of the example), applying the parameter (the continuation) to 1 forces execution the program to jump to the point where call/cc was called and causes call/cc to return the value 1.
The power of call/cc lies in the ability for the continuation to be called more than once and even from outside the lexical context of the call/cc construction: there are no rules stating that the continuation has to "stay inside" call/cc.
en.wikipedia.org /wiki/Call-with-current-continuation   (481 words)

  
 Info Node: (scheme)Continuations
The escape procedure is a Scheme procedure of one argument that, if it is later passed a value, will ignore whatever continuation is in effect at that later time and will give the value instead to the continuation that was in effect when the escape procedure was created.
Most of the time the continuation includes actions specified by user code, as in a continuation that will take the result, multiply it by the value stored in a local variable, add seven, and give the answer to the top-level continuation to be printed.
The continuation in effect when this procedure is called must be a multiple-value continuation that was created by `with-values'.
www.math.psu.edu /bin/info2www?(scheme)Continuations   (653 words)

  
 Revised(5) Report on the Algorithmic Language Scheme - Tail recursion
Note that this includes calls that may be returned from either by the current continuation or by continuations captured earlier by call-with-current-continuation that are later invoked.
Although an improper implementation might use a new continuation in the call, a return to this new continuation would be followed immediately by a return to the continuation passed to the procedure.
A tail call is a procedure call that occurs in a tail context.
www.cs.rice.edu /CS/PLT/packages/doc/r5rs/node22.htm   (645 words)

  
 Continuations - Guile Reference Manual
The special property is that when a continuation is called it abandons the current program location and jumps directly to that represented by the continuation.
A continuation is like a dynamic label, capturing at run-time a point in program execution, including all the nested calls that have lead to it (or rather the code that will execute when those calls return).
Continuations are a powerful mechanism, and can be used to implement almost any sort of control structure, such as loops, coroutines, or exception handlers.
www.gnu.org /software/guile/docs/docs-1.8/guile-ref/Continuations.html   (615 words)

  
 Revised(5) Report on the Algorithmic Language Scheme - Control features
Before is called whenever execution enters the dynamic extent of the call to thunk and after is called whenever it exits that dynamic extent.
If a second call to dynamic-wind occurs within the dynamic extent of the call to thunk and then a continuation is invoked in such a way that the afters from these two invocations of dynamic-wind are both to be called, then the after associated with the second (inner) call to dynamic-wind is called first.
If a second call to dynamic-wind occurs within the dynamic extent of the call to thunk and then a continuation is invoked in such a way that the befores from these two invocations of dynamic-wind are both to be called, then the before associated with the first (outer) call to dynamic-wind is called first.
www.bath.ac.uk /~masrjb/R5RS/r5rs_63.html   (1787 words)

  
 An Introduction to Scheme and its Implementation - Recursion in Scheme
At a call, the state of the "caller" (calling procedure) is saved on the stack, and then control is transferred to the callee.
We often call this "popping" a continuation, because it's a stacklike operation--saving a (partial) continuation pushes the values in registers onto the front of the "stack," and restoring one pops the values back into the registers.
Continuations are thus created and used nondestructively, and the continuations on the heap form a graph that reflects the pattern of non-tail procedure calls.
www.cs.utexas.edu /ftp/pub/garbage/cs345/schintro-v13/schintro_127.html   (4002 words)

  
 Info: (guile) Continuations   (Site not responding. Last check: 2007-10-13)
The implementation of continuations in Guile is not as efficient as one might hope, because it is constrained by the fact that Guile is designed to cooperate with programs written in other languages, such as C, which do not know about continuations.
So continuations should be used when there is no other simple way of achieving the desired behaviour, or where the advantages of the elegant continuation mechanism outweigh the need for optimum performance.
Such a call will work like a goto to the invocation location of `call-with-current-continuation', passing the arguments in a way that they are returned by the call to `call-with-current-continuation'.
www.cims.nyu.edu /cgi-comment/info2html?(guile)Continuations   (260 words)

  
 An Introduction to Scheme and its Implementation - call-with-current-continuation
If you take a pointer to the current continuation, and put it in a live variable or data structure, however, then that continuation chain will remain live and not be garbage collected.
The current continuation will be passed to that procedure, which can use it (or not) as it pleases.
Calls the procedure passed as its (call-with-current-continuation's) argument, handing it the escape procedure as its argument.
www.federated.com /~jim/schintro-v14/schintro_141.html   (1705 words)

  
 Guile Reference Manual: Basic Ideas
The side effects of calling the procedure are the combination of the side effects of the sequence of evaluations of expressions in the procedure body.
Then, whenever that procedure is called, the interpreter reinstates the environment that is stored in the procedure definition and evaluates the procedure body within the context of that environment.
To apply one of the methods to the account, you call the procedure with a symbol indicating the required method as the first parameter, followed by any other parameters that are required by that method.
www.seul.org /~grumbel/tmp/guile-1.6.0/guile_15.html   (5790 words)

  
 CSc 520 Principles of Programming Languages :
A continuation is a closure that holds the current program counter and environment.
can invoke the continuation and immediately return to the situation as it was when the call was made.
Continuations can, for example, be used to quickly exit a tree-search procedure once the node we're looking for has been found.
www.cs.arizona.edu /people/collberg/Teaching/520/2005/Html/Html-35   (414 words)

  
 Unlambda in K
That is, the new current character is the old current character, the new data stack is the old data stack, and the new instruction stack is d[G],H, the result of calling 'd' with unevaluated G, the first complete expression on the instruction stack, prepended to the rest of the instruction stack.
That is, the new instruction stack is created by replacing X with the result of applying 'c' to X (the function on which call-with-current-continuation is to be called) and the current continuation, and prepending the result to Y, the rest of the instruction stack.
The current continuation is a K dictionary (following the Unlambda convention, we shall write it '') with a single entry, 'c'.
www.nsl.com /papers/unlambda.htm   (3629 words)

  
 Revised(5) Scheme
The escape procedure is a Scheme procedure that, if it is later called, will abandon whatever continuation is in effect at that later time and will instead use the continuation that was in effect when the escape procedure was created.
If the expression is evaluated at top level, for example, then the continuation might take the result, print it on the screen, prompt for the next input, evaluate it, and so on forever.
The dynamic extent of a procedure call is the period between when the call is initiated and when it returns.
www.delorie.com /gnu/docs/guile/r5rs_64.html   (1373 words)

  
 Continuation Marks
Continuation marks support debuggers and other program-tracing facilities, because continuation frames roughly correspond to stack frames in traditional languages.
For example, a debugger can annotate a source program to store continuation marks that relate each expression to its source location; when an exception occurs, the marks are extracted from the current continuation to produce a ``stack trace'' for the exception.
After key-expr is evaluated to obtain a key and mark-expr is evaluated to obtain a mark, the key is mapped to the mark in the current continuation's initial frame.
download.plt-scheme.org /doc/103p1/html/mzscheme/node88.htm   (548 words)

  
 A page about call/cc
stands for “call with current continuation”; it is a function that exists in certain programming languages.
A continuation is not something, like a function, which takes a value and returns another: it just takes a value and does everything that follows to it, and never returns.
Continuations are not something static that can be determined at compile time: they are dynamic entities that are created and invoked as program execution proceeds.
www.madore.org /~david/computers/callcc.html   (2739 words)

  
 Continuations and advanced flow control
The continuation is a callable entity that takes one parameter, and that parameter is then returned to the point where the continuation is created.
For flow control to pass across the "guard" line (whether by continuation or by normal control flow), the appropriate procedure must be executed for clean-up (either "entering" or "exiting," depending on the direction).
When reading the code, remember that the "failure continuation" is the way that the backtracker gets back into the list of values, and the "success continuation" is the way the function returns the next value back into the normal program flow.
www.ibm.com /developerworks/linux/library/l-advflow.html?ca=dgr-lnxw06FlowControl   (4249 words)

  
 Call With Current Continuation
If and whenever the continuation is called, the then current continuation will be abandoned, and the program flow will continue at the point at which the continuation was captured.
Historically, the language construct to capture the current continuation in Scheme wasn't always a function; a special operator called CATCH or LET-CC was used instead.
Continuations are an abstraction of control flow, and can be used to implement any kind of control flow at all.
c2.com /cgi/wiki?CallWithCurrentContinuation   (2112 words)

  
 composable-continuations-tutorial
Composable continuations are a means of inverting control by reification of continuation segments.
There are other names for `composable continuations' as well, such as `delimited continuations' and `partial continuations,' but we shall consistently use the term `composable' here.
We can, in fact, call composable continuation procedures multiple times; they are simply functions that run through portions of a program, and we can run through those portions more than once.
community.schemewiki.org /?composable-continuations-tutorial   (776 words)

  
 Definition of Scheme programming language
Scheme was originally called "Schemer", in the tradition of the languages Planner and Conniver.
The current name resulted from the authors' use of the ITS operating system, which limited filenames to 6 characters.
It has no operator precedence rules because prefix notation is used for all function calls, and there are no ambiguities as are found in infix notation, which mimics conventional algebraic notation.
www.wordiq.com /definition/Scheme_programming_language   (2113 words)

  
 [No title]
The current state of execution can be grabbed and wrapped up as a first class object and it can be reused elsewhere.
In order to save a continuation two things need to be grabbed: the state of all registers and the state of the C stack.
Incidentally, if you're trying to implement an interpreter for a language with continuations in C then one approach is to implement continuations in C. This is what Aubrey Jaffer did in his Scheme interpreter.
homepage.mac.com /sigfpe/Computing/continuations.html   (763 words)

  
 Scheme Exception Handling
The denotation of system exceptions and the initial current exception handler are system-dependent, as is the behavior whenever a handler for an exception raised by the system returns to its continuation.
When the new current exception handler is invoked with exn, the predicates are invoked, in sequence, with exn until a true value is returned.
The predicates are called in a dynamic context in which the current exception handler is the exception handler that was current in the dynamic context of the call to with-handlers.
www.cs.indiana.edu /scheme-repository/doc.proposals.exceptions.html   (678 words)

  
 CALL from FOLDOC   (Site not responding. Last check: 2007-10-13)
The program does not call the handler directly but when the event occurs, the run-time system calls the handler, usually passing it arguments to describe the event.
It calls f and passes it the current continuation, which is itself a function, k.
The continuation represents the context of the call to call/cc.
www.instantweb.com /d/dictionary/foldoc.cgi?query=CALL   (1057 words)

  
 Normal-order syntax-rules and proving the fix-point of call/cc
As we know, the field of first-class continuations is sufficiently interesting to reasonably doubt one's intuition and rely on a formal proof instead.
The current term now is an abstraction, the term stack is not empty -- and so we have a redex.
The current term now is a bare variable -- and now we are pressed for the substitution.
okmij.org /ftp/Scheme/callcc-calc-page.html   (2434 words)

  
 Revised(5) Scheme - 6. Standard procedures
A pair (sometimes called a dotted pair) is a record structure with two fields called the car and cdr fields (for historical reasons).
A string constant may continue from one line to the next, but the exact contents of such a string are unspecified.
If an escape procedure is used to escape from the continuation of these procedures, their behavior is implementation dependent.
www.swiss.ai.mit.edu /~jaffer/r5rs_8.html   (8849 words)

  
 Using Pocket Scheme
Pocket Scheme may call procedures that were not written in Scheme through its foreign function interface, or FFI.
call could also supply a hint vector with the window procedure, constraining the application to call the window procedure only for those messages named in the hint vector.
Note that the current version of this macro does not generate accessors for C structure bitfields.
www.mazama.net /scheme/pscheme-usage.htm   (2819 words)

  
 Help exploring continuations   (Site not responding. Last check: 2007-10-13)
The reason for the particular problem you are experiencing is in fact very simple: continuations in Scheme only take one argument, because calling a continuation is the "same thing" in some sense as returning from a function, and functions in Scheme can only return one value.
The exact quote from the language spec is: "Except for continuations created by the `call-with-values' procedure, all continuations take exactly one value." It is sad and ironic that in a community that generated SICP the art of pedagogy seems to have been discarded in favor of one-upmanship.
A useful, boring and mundane way to use continuations is to use them for simple returns, escapes and exits.
www.codecomments.com /message158155.html   (975 words)

  
 Gauche Reference Manual: Continuation
First class continuation is one of the most distinct feature of Scheme, but this margin is too small to contain explanation.
However, if a continuation is created during "callback" from C code--- that is, you call some C-implemented function that calls Scheme code again--the continuation's extent is limited until the Scheme evaluation returns to the C code.
Note that it is still allowed to invoke a continuation from such callbacks.
fit.c2.com /files/LispPlatform/lisp/gosh-docs/gauche-refe_83.html   (329 words)

Try your search on: Qwika (all wikis)

Factbites
  About us   |   Why use us?   |   Reviews   |   Press   |   Contact us  
Copyright © 2005-2007 www.factbites.com Usage implies agreement with terms.