Next: Instrumentation Instructions, Previous: Trampoline Instructions, Up: Instruction Set [Contents][Index]
Capture the current continuation, and write it to dst. Part of
the implementation of call/cc
.
Return to a continuation, nonlocally. The arguments to the continuation are taken from the stack. contregs is a free variable containing the reified continuation.
Abort to a prompt handler. The tag is expected in slot 1, and the rest
of the values in the frame are returned to the prompt handler. This
corresponds to a tail application of abort-to-prompt
.
If no prompt can be found in the dynamic environment with the given tag, an error is signalled. Otherwise all arguments are passed to the prompt’s handler, along with the captured continuation, if necessary.
If the prompt’s handler can be proven to not reference the captured
continuation, no continuation is allocated. This decision happens
dynamically, at run-time; the general case is that the continuation may
be captured, and thus resumed. A reinstated continuation will have its
arguments pushed on the stack from slot 0, as if from a multiple-value
return, and control resumes in the caller. Thus to the calling
function, a call to abort-to-prompt
looks like any other function
call.
Compose a partial continuation with the current continuation. The arguments to the continuation are taken from the stack. cont is a free variable containing the reified continuation.
Push a new prompt on the dynamic stack, with a tag from tag and a handler at handler-offset words from the current ip.
If an abort is made to this prompt, control will jump to the handler.
The handler will expect a multiple-value return as if from a call with
the procedure at proc-slot, with the reified partial continuation
as the first argument, followed by the values returned to the handler.
If control returns to the handler, the prompt is already popped off by
the abort mechanism. (Guile’s prompt
implements Felleisen’s
–F– operator.)
If escape-only? is nonzero, the prompt will be marked as escape-only, which allows an abort to this prompt to avoid reifying the continuation.
See Prompts, for more information on prompts.
Raise an error by throwing to key and args. args should be a list.
Raise an error, indicating val as the bad value.
key-subr-and-message should be a vector, where the first element
is the symbol to which to throw, the second is the procedure in which to
signal the error (a string) or #f
, and the third is a format
string for the message, with one template. These instructions do not
fall through.
Both of these instructions throw to a key with four arguments: the
procedure that indicates the error (or #f
, the format string, a
list with value, and either #f
or the list with value
as the last argument respectively.
Next: Instrumentation Instructions, Previous: Trampoline Instructions, Up: Instruction Set [Contents][Index]