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

catching



NIL contains two undocumented special operators CATCHALL and
CATCH-BARRIER.

CATCHALL takes an argument list (function &body body).  It evaluates
and saves function, then evaluates the body as a progn.  If a THROW is
performed through this construct, the function gets invoked on two
arguments:  the tag being thrown to, and the value being thrown.
Obviously this is incorrect wrt throwing multiple values;  the obvious
correction is to make the function get called on all of the values
being thrown.  The idea is, however, that one can inspect the tag and
repeat the throw as if nothing had happened.  Normal return, and
abnormal returns that do not use THROW (we have a
force-return-from-function-call-frame operation in NIL for use by the
debugger) do not invoke the catchall function, even though they would
invoke the cleanup forms of an unwind-protect.  And, there are NO
special catch tags;  they are objects compared with EQ.

CATCH-BARRIER is just like CATCH, except that it effectively makes all
established CATCH tags outside of its dynamic scope invisible.  I.e.,
	(catch 'foo
	   (catch-barrier 'bar
		(throw 'foo t)))
will complain that FOO is an unseen catch tag.

^_