41 lines
2.2 KiB
HTML
41 lines
2.2 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.8. Restart Functions</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<meta name="description" value=" Restart Functions">
|
|
<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=tex2html5731 HREF="node324.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html5729 HREF="node315.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html5723 HREF="node322.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html5733 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html5734 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A NAME=tex2html5732 HREF="node324.html"> Comparison of Restarts </A>
|
|
<B>Up:</B> <A NAME=tex2html5730 HREF="node315.html"> Survey of Concepts</A>
|
|
<B> Previous:</B> <A NAME=tex2html5724 HREF="node322.html"> Named Restarts</A>
|
|
<HR> <P>
|
|
<H2><A NAME=SECTION003338000000000000000>29.3.8. Restart Functions</A></H2>
|
|
<P>
|
|
<img align=bottom alt="change_begin" src="gif/change_begin.gif"><br>
|
|
For commonly used restarts, it is conventional to define a program interface
|
|
that hides the use of <tt>invoke-restart</tt>. Such program interfaces to restarts
|
|
are called <i>restart functions</i>.
|
|
<P>
|
|
The normal convention is for the function to share the name of the restart.
|
|
The pre-defined functions <tt>abort</tt>, <tt>continue</tt>, <tt>muffle-warning</tt>, <tt>store-value</tt>, and
|
|
<tt>use-value</tt> are restart functions. With <tt>use-value</tt> the above example of
|
|
<tt>handler-bind</tt> could have been written more concisely as
|
|
<P><pre>
|
|
(handler-bind ((unbound-variable
|
|
#'(lambda (c) ;Argument <tt>c</tt> is a condition
|
|
(use-value (cell-error-name c)))))
|
|
<i>body</i>)
|
|
</pre><P>
|
|
<br><img align=bottom alt="change_end" src="gif/change_end.gif">
|
|
<P>
|
|
<HR>
|
|
<P><ADDRESS>
|
|
AI.Repository@cs.cmu.edu
|
|
</ADDRESS>
|
|
</BODY>
|