[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
unwind-protect description
- To: gls@AQUINAS.THINK.COM
- Subject: unwind-protect description
- From: "George J. Carrette" <GJC@MC.LCS.MIT.EDU>
- Date: Tue, 15 Apr 86 07:13:50 EST
- Cc: common-lisp@SU-AI.ARPA
- In-reply-to: Msg of Mon 14 Apr 86 13:12 EST from Guy Steele <gls at THINK-AQUINAS.ARPA>
You could word it by giving an implementation of unwind-protect as a macro
in terms of other primitives. The first step is of course
(unwind-protect body1 body2) => (*unwind-protect #'(lambda () body1)
#'(lambda () body2))
Which makes the environment issue clear. Then, given a form of catch
and throw called %CATCH and %THROW that do not take a TAG first argument
you can implement common-lisp CATCH and THROW while taking care of unwind
protect quite neatly.