emacs.d/clones/www.cs.cmu.edu/Groups/AI/html/cltl/clm/node219.html
2022-08-26 19:11:35 +02:00

102 lines
5.6 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>24. Errors</TITLE>
</HEAD>
<BODY>
<meta name="description" value=" Errors">
<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=tex2html4286 HREF="node220.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html4284 HREF="clm.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html4278 HREF="node218.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html4288 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html4289 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html4287 HREF="node220.html"> General Error-Signaling Functions</A>
<B>Up:</B> <A NAME=tex2html4285 HREF="clm.html">Common Lisp the Language</A>
<B> Previous:</B> <A NAME=tex2html4279 HREF="node218.html"> Accessing Directories</A>
<HR> <P>
<H1><A NAME=SECTION002800000000000000000>24. Errors</A></H1>
<P>
<A NAME=XERROR>Errors</A>
may be signaled for a variety of reasons.
Many built-in Common Lisp functions may signal an error when given incorrect
arguments. Other functions, described in this chapter,
may be called by user programs for the purpose of signaling
an error.
<P>
When an error is signaled, it is
handled in an implementation-dependent way. It is expected
that each implementation of Common Lisp will provide an interactive debugger that
prints the error message along with suitable contextual information
such as which function detected the error. The user may interact with
the debugger to examine or modify the state of the program in various
ways, including abandoning the current computation (``aborting to top
level'') and continuing from the error. What ``continuing'' means
depends on how the error is signaled; the details of this are specified below
for each error-signaling function.
<P>
<img align=bottom alt="old_change_begin" src="gif/old_change_begin.gif"><br>
An implementation may also choose to provide means (such as the
<tt>errset</tt> special form in MacLisp) for a program to trap
all errors and prevent the debugger from stepping in for
certain errors.
<P>
<hr>
<b>Rationale:</b> Error handling of adequate
flexibility and power for all systems written in Common Lisp appears to
require a complex error classification system.
Experience with several error-handling systems
in such dialects as MacLisp and Lisp Machine Lisp indicates that
further experimentation is needed in this area;
it is too early to define a standard error-handling mechanism.
Therefore Common Lisp provides standard ways to <i>signal</i> errors,
but no standard ways to <i>handle</i> errors.
Of course a
complete Lisp system requires error-handling mechanisms, but many useful
portable programs do not require them. It is expected that a future
revision of Common Lisp will address the problem of portable error-handling
mechanisms.
<hr>
<br><img align=bottom alt="old_change_end" src="gif/old_change_end.gif">
<P>
<img align=bottom alt="change_begin" src="gif/change_begin.gif"><br>
X3J13 voted in June 1988
(CONDITION-SYSTEM) <A NAME=27856>&#160;</A>
to adopt a proposal for a Common Lisp Condition System.
This was the result of the research and experimentation
alluded to in the preceding paragraph.
Conditions subsume and generalize the notion of errors.
The condition system also provides means for handling
conditions (of which errors are a special case) and
for restarting a computation after a condition has been signaled.
See chapter <A HREF="node312.html#CONDITION">29</A>.
<br><img align=bottom alt="change_end" src="gif/change_end.gif">
<P>
<hr>
<b>Compatibility note:</b> What is here called ``continuing,''
Lisp Machine Lisp calls ``proceeding'' from an error.
<p>
<img align=bottom alt="change_begin" src="gif/change_begin.gif"><br>
In the new terminology introduced in chapter <A HREF="node312.html#CONDITION">29</A>,
what Lisp Machine Lisp called ``proceeding'' would be called
``restarting,'' and ``continuing'' refers to the particular
restart named <tt>continue</tt>.
<br><img align=bottom alt="change_end" src="gif/change_end.gif">
<hr>
<P>
<HR>
<UL>
<LI> <A NAME=tex2html4290 HREF="node220.html#SECTION002810000000000000000"> General Error-Signaling Functions</A>
<LI> <A NAME=tex2html4291 HREF="node221.html#SECTION002820000000000000000"> Specialized Error-Signaling Forms and Macros</A>
<LI> <A NAME=tex2html4292 HREF="node222.html#SECTION002830000000000000000"> Special Forms for Exhaustive Case Analysis</A>
</UL>
<BR> <HR><A NAME=tex2html4286 HREF="node220.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html4284 HREF="clm.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html4278 HREF="node218.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html4288 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html4289 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html4287 HREF="node220.html"> General Error-Signaling Functions</A>
<B>Up:</B> <A NAME=tex2html4285 HREF="clm.html">Common Lisp the Language</A>
<B> Previous:</B> <A NAME=tex2html4279 HREF="node218.html"> Accessing Directories</A>
<HR> <P>
<HR>
<P><ADDRESS>
AI.Repository@cs.cmu.edu
</ADDRESS>
</BODY>