emacs.d/clones/lisp/www.cs.cmu.edu/Groups/AI/html/cltl/clm/node340.html

41 lines
2.1 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.4.6. Creating Conditions</TITLE>
</HEAD>
<BODY>
<meta name="description" value=" Creating 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=tex2html5944 HREF="node341.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html5942 HREF="node334.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html5936 HREF="node339.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html5946 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html5947 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html5945 HREF="node341.html"> Establishing Restarts</A>
<B>Up:</B> <A NAME=tex2html5943 HREF="node334.html"> Program Interface to </A>
<B> Previous:</B> <A NAME=tex2html5937 HREF="node339.html"> Defining Conditions</A>
<HR> <P>
<H2><A NAME=SECTION003346000000000000000>29.4.6. Creating Conditions</A></H2>
<P>
<img align=bottom alt="change_begin" src="gif/change_begin.gif"><br>
The function <tt>make-condition</tt> is the basic means for
creating condition objects.
<P>
<BR><b>[Function]</b><BR>
<tt>make-condition <i>type</i> &amp;rest <i>slot-initializations</i> </tt><P> Constructs a condition object of the given <i>type</i> using <i>slot-initializations</i>
as a specification of the initial value of the slots. The newly created
condition is returned.
<P>
The <i>slot-initializations</i> are alternating keyword/value pairs.
For example:
<P><pre>
(make-condition 'peg/hole-mismatch
:peg-shape 'square :hole-shape 'round)
</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>