[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re : unwind-protect

>Hmm.  How would unwind-protect be expressed with just call/cc?

UNWIND-PROTECT is trivial to implement in terms of DYNAMIC-WIND, which can
be implemented in terms of CALL-WITH-CURRENT-CONTINUATION provided the
Scheme system permits CALL-WITH-CURRENT-CONTINUATION to be redefined,
uses close-coded calls to CALL-WITH-CURRENT-CONTINUATION for all captures
of a continuation, and contains no pre-captured continuations.

An implementation appears in Haynes and Friedman, Embedding Continuations
in Procedural Objects, TOPLAS 9, 4 (October 1987), pages 582-598.

William Clinger