[Audacity-nyquist] Q: unwind_protect
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
|
From: Steven J. <jo...@sw...> - 2005-08-26 06:51:22
|
I'm trying to write an error handler in XLISP and am confused about
unwind-protect.
Its my understanding from reading the manual that the "clean up" code is
executed unconditionally. Calling (foo nil) executes both the protected
and clean-up forms. Calling (foo t) generates an error as expected but
the clean up code is not executed. What am I missing?
(defun foo (flag)
(unwind-protect
(progn
(if flag
(error ""))
(format t "protected expression ~%"))
(progn
(format t "clean-up expression ~%"))))
Thanks
Steven Jones
|