Next: compensations, Previous: syntaxes, Up: Top [Contents][Index]
Unwind–protection allows operations to be performed synchronously with respect to the dynamic extent of a call to thunk; the mechanism is sophisticated because there are multiple, sophisticated ways to exit the dynamic extent of a function call. The typical application is to release asynchronous resources, like input/output ports and database connections.
To understand the unwind–protection mechanism we must understand the concepts “dynamic extent of a function call” and “dynamic environment” as defined by the Scheme standard.
The unwind–protection mechanism described here is used by MMCK Exceptional Conditions in: the implementation of
compensations (see compensations); the implementation of the syntax try
(see syntaxes try).
NOTE The unwind protection mechanism may misbehave in some cases, so do not trust it blindly (see unwind problems).
• unwind intro | Introduction to the unwind protection mechanism. | |
• unwind syntaxes | Unwind-protection syntaxes. | |
• unwind dynamic | On the meaning of dynamic extent termination. | |
• unwind except 1 | Raising non-continuable exceptions from the thunk. | |
• unwind except 2 | Raising continuable exceptions from the thunk. | |
• unwind except 3 | Raising exceptions from the unwind handler. | |
• unwind returnable | Use with returnable bodies. | |
• unwind reenter | Handling reentering continuations. | |
• unwind dyn-env | Clean-up thunks and the dynamic environment. | |
• unwind problems | Known problems. | |
• unwind call/cc | Unwinding call/cc .
|
Next: compensations, Previous: syntaxes, Up: Top [Contents][Index]
This document describes version 0.1.0-devel.1 of MMCK Exceptional Conditions.