Dynamic-Wind
------------
`(require 'dynamic-wind)'
This facility is a generalization of Common LISP `unwind-protect',
designed to take into account the fact that continuations produced by
`call-with-current-continuation' may be reentered.
- Procedure: dynamic-wind thunk1 thunk2 thunk3
The arguments THUNK1, THUNK2, and THUNK3 must all be procedures of
no arguments (thunks).
`dynamic-wind' calls THUNK1, THUNK2, and then THUNK3. The value
returned by THUNK2 is returned as the result of `dynamic-wind'.
THUNK3 is also called just before control leaves the dynamic
context of THUNK2 by calling a continuation created outside that
context. Furthermore, THUNK1 is called before reentering the
dynamic context of THUNK2 by calling a continuation created inside
that context. (Control is inside the context of THUNK2 if THUNK2
is on the current return stack).
*Warning:* There is no provision for dealing with errors or
interrupts. If an error or interrupt occurs while using
`dynamic-wind', the dynamic environment will be that in effect at
the time of the error or interrupt.