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

unwind-protect



    Date: 11 Apr 86 19:47 PST
    From: Pavel.pa@Xerox.COM

    What is the result of this code:

    (proclaim '(special *foo*))

    (let* ((x 'good)
	   (*foo* x))
      (block bar
	(unwind-protect
	  (let ((*foo* 'bad))
	    (return-from bar))
	  (setq x *foo*)))
      x)

    The Zetalisp manual says it will return GOOD, but the silver book is
    silent on the issue.  This should be clarified.

	    Pavel

I also believe that it should return GOOD.  There should be some prose
in the silver book (not there now) that says that the cleanup-forms
are executed in the dynamic environment of the unwind-protect form
itself.  Loosely speaking, it is as if there were a TAGBODY tag just
in front of the first cleanup form, and any exit causes a transfer of
control to that tag as if by a GO (but with further actions pending,
such as the returning of a value or resumption of a THROW).  This will
be very hard to word properly.
--Guy