1
0
Fork 0
cl-sites/www.cs.cmu.edu/Groups/AI/html/cltl/clm/node330.html
2023-10-25 11:23:21 +02:00

50 lines
2.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
<!Converted with LaTeX2HTML 0.6.5 (Tue Nov 15 1994) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
<HEAD>
<TITLE>29.3.15. Signaling Conditions</TITLE>
</HEAD>
<BODY>
<meta name="description" value=" Signaling Conditions">
<meta name="keywords" value="clm">
<meta name="resource-type" value="document">
<meta name="distribution" value="global">
<P>
<b>Common Lisp the Language, 2nd Edition</b>
<BR> <HR><A NAME=tex2html5815 HREF="node331.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html5813 HREF="node315.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html5807 HREF="node329.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html5817 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html5818 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html5816 HREF="node331.html"> Resignaling Conditions</A>
<B>Up:</B> <A NAME=tex2html5814 HREF="node315.html"> Survey of Concepts</A>
<B> Previous:</B> <A NAME=tex2html5808 HREF="node329.html"> Condition Types</A>
<HR> <P>
<H2><A NAME=SECTION0033315000000000000000>29.3.15. Signaling Conditions</A></H2>
<P>
<img align=bottom alt="change_begin" src="gif/change_begin.gif"><br>
When a condition is signaled, the system tries to locate the most appropriate
handler for the condition and to invoke that handler.
<P>
Handlers are established dynamically using <tt>handler-bind</tt> or abstractions built
on <tt>handler-bind</tt>.
<P>
If an appropriate handler is found, it is called. In some circumstances,
the handler may <i>decline</i> simply by returning without performing a
non-local transfer of control. In such cases, the search for an
appropriate handler is picked up where it left off, as if the called
handler had never been present.
<P>
If no handler is found, or if all handlers that were found decline,
<tt>signal</tt> returns <tt>nil</tt>.
<P>
Although it follows from the description above, it is perhaps worth noting
explicitly that the lookup procedure described here will prefer a general
but more (dynamically) local handler over a specific but less (dynamically)
local handler. Experience with existing condition systems suggests that
this is a reasonable approach and works adequately in most situations.
Some care should be taken when binding handlers for very general kinds of
conditions, such as is done in <tt>ignore-errors</tt>. Often, binding for a more
specific condition type than <tt>error</tt> is more appropriate.
<br><img align=bottom alt="change_end" src="gif/change_end.gif">
<P>
<HR>
<P><ADDRESS>
AI.Repository@cs.cmu.edu
</ADDRESS>
</BODY>