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

go and return-from inside unwind-protect cleanup



Are the following legal?

	(defun foo (go-p)
	  (prog nil
	     tag
		(unwind-protect
		    (return (compute))
		  (if go-p (go tag)))))

	(defun bar (return-p)
	  (prog nil
	     tag
		(unwind-protect
		    (progn (compute)
			   (go tag))
		  (if return-p (return nil)))))

I say no, because the unwind-protect could be usurping the values of the
first form of unwind-protect (in the case of normal exit) or could be
usurping a THROW (in the abnormal exit).  

There is no mention of this in CLtL (in the unwind-protect section, at
least).  If it is legal, would somebody please tell me what FOO does.