Next: , Previous: , Up: Scheme reference   [Contents][Index]


4.5 Control

The (hoot control) module provides an interface for Guile’s delimited continuation facility known as “prompts” and some of the (ice-9 control) API. See the Guile manual for more detailed information.

Procedure: make-prompt-tag [stem ``prompt'']

Return a new prompt tag that incorporates the value of stem. A prompt tag is simply a unique object.

Procedure: call-with-prompt tag body handler

Call the procedure body, a procedure of 0 arguments or “thunk”, within the context of a prompt marked with tag. Should this prompt be aborted via abort-to-prompt, the procedure handler is called. The handler procedure receives as arguments a continuation object and any additional arguments that were passed to abort-to-prompt.

Procedure: abort-to-prompt tag [val ...]

Unwind the dynamic and control context to the nearest prompt named tag, so passing the additional values val

Procedure: default-prompt-tag

Return the default prompt tag.

Procedure: default-prompt-handler

Return the default prompt handler procedure.

Note that both default-prompt-tag and default-prompt-handler are parameters, so their values may be modified by using parameterize. See Parameters for more information.

Syntax: % expr
Syntax: % expr handler
Syntax: % tag expr handler

Syntactic sugar for call-with-prompt. Evaluate expr in the context of a prompt. If tag is ommitted, the default prompt tag will be used. If handler is omitted, the default prompt handler will be used.


Next: Exceptions, Previous: Bytevectors, Up: Scheme reference   [Contents][Index]