63 lines
5.4 KiB
HTML
63 lines
5.4 KiB
HTML
<!-- Common Lisp HyperSpec (TM), version 7.0 generated by Kent M. Pitman on Mon, 11-Apr-2005 2:31am EDT -->
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>CLHS: Section 9.1.2.1</TITLE>
|
|
<LINK HREF="../Data/clhs.css" REL="stylesheet" TYPE="text/css" />
|
|
<META HTTP-EQUIV="Author" CONTENT="Kent M. Pitman">
|
|
<META HTTP-EQUIV="Organization" CONTENT="LispWorks Ltd.">
|
|
<LINK REL=TOP HREF="../Front/index.htm">
|
|
<LINK REL=COPYRIGHT HREF="../Front/Help.htm#Legal">
|
|
<LINK REL=DISCLAIMER HREF="../Front/Help.htm#Disclaimer">
|
|
<LINK REL=PREV HREF="09_ab.htm">
|
|
<LINK REL=UP HREF="09_ab.htm">
|
|
<LINK REL=NEXT HREF="09_ac.htm">
|
|
</HEAD>
|
|
<BODY>
|
|
<H1><A REV=MADE HREF="http://www.lispworks.com/"><IMG WIDTH=80 HEIGHT=65 ALT="[LISPWORKS]" SRC="../Graphics/LWSmall.gif" ALIGN=Bottom></A><A REL=TOP HREF="../Front/index.htm"><IMG WIDTH=237 HEIGHT=65 ALT="[Common Lisp HyperSpec (TM)]" SRC="../Graphics/CLHS_Sm.gif" ALIGN=Bottom></A> <A REL=PREV HREF="09_ab.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="09_ab.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="09_ac.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
<H2>
|
|
9.1.2.1 Condition Designators</H2> <P>
|
|
A number of the functions in the condition system take arguments which are identified as <A REL=DEFINITION HREF="26_glo_c.htm#condition_designator"><I>condition designators</I></A>. By convention, those arguments are notated as <P>
|
|
<I>datum</I> <TT>&rest</TT> <I>arguments</I> <P>
|
|
Taken together, the <I>datum</I> and the <I>arguments</I> are ``<A REL=DEFINITION HREF="26_glo_d.htm#designator"><I>designators</I></A> for a <A REL=DEFINITION HREF="26_glo_c.htm#condition"><I>condition</I></A> of default type <I>default-type</I>.'' How the denoted <A REL=DEFINITION HREF="26_glo_c.htm#condition"><I>condition</I></A> is computed depends on the type of the <I>datum</I>: <P>
|
|
<P><DL><P>
|
|
<DT>* If the <I>datum</I> is a <A REL=DEFINITION HREF="26_glo_s.htm#symbol"><I>symbol</I></A> naming a <A REL=DEFINITION HREF="26_glo_c.htm#condition"><I>condition</I></A> <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A> ... <P><DD>
|
|
The denoted <A REL=DEFINITION HREF="26_glo_c.htm#condition"><I>condition</I></A> is the result of <P>
|
|
<PRE>
|
|
(apply #'make-condition datum arguments)
|
|
</PRE>
|
|
</TT> <P>
|
|
<DT>* If the <I>datum</I> is a <A REL=DEFINITION HREF="26_glo_f.htm#format_control"><I>format control</I></A> ... <P><DD>
|
|
The denoted <A REL=DEFINITION HREF="26_glo_c.htm#condition"><I>condition</I></A> is the result of <P>
|
|
|
|
<PRE>
|
|
(make-condition defaulted-type
|
|
:format-control datum
|
|
:format-arguments arguments)
|
|
</PRE>
|
|
</TT> <P>
|
|
where the <I>defaulted-type</I> is a <A REL=DEFINITION HREF="26_glo_s.htm#subtype"><I>subtype</I></A> of <I>default-type</I>. <P>
|
|
<DT>* If the <I>datum</I> is a <A REL=DEFINITION HREF="26_glo_c.htm#condition"><I>condition</I></A> ... <P><DD>
|
|
The denoted <A REL=DEFINITION HREF="26_glo_c.htm#condition"><I>condition</I></A> is the <I>datum</I> itself. In this case, unless otherwise specified by the description of the <A REL=DEFINITION HREF="26_glo_o.htm#operator"><I>operator</I></A> in question, the <A REL=DEFINITION HREF="26_glo_a.htm#argument"><I>arguments</I></A> must be <A REL=DEFINITION HREF="26_glo_n.htm#null"><I>null</I></A>; that is, the consequences are undefined if any <I>arguments</I> were supplied. <P>
|
|
<P></DL><P>
|
|
Note that the <I>default-type</I> gets used only in the case where the <I>datum</I> <A REL=DEFINITION HREF="26_glo_s.htm#string"><I>string</I></A> is supplied. In the other situations, the resulting condition is not necessarily of <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A> <I>default-type</I>. <P>
|
|
Here are some illustrations of how different <A REL=DEFINITION HREF="26_glo_c.htm#condition_designator"><I>condition designators</I></A> can denote equivalent <A REL=DEFINITION HREF="26_glo_c.htm#condition"><I>condition</I></A> <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>objects</I></A>: <P>
|
|
|
|
<PRE>
|
|
(let ((c (make-condition 'arithmetic-error :operator '/ :operands '(7 0))))
|
|
(error c))
|
|
== (error 'arithmetic-error :operator '/ :operands '(7 0))
|
|
|
|
(error "Bad luck.")
|
|
== (error 'simple-error :format-control "Bad luck." :format-arguments '())
|
|
</PRE>
|
|
</TT> <P>
|
|
<P><HR>The following <A REL=META HREF="../Front/X3J13Iss.htm">X3J13 cleanup issue</A>, <I>not part of the specification</I>, applies to this section:<P><UL><LI> <A REL=CHILD HREF="../Issues/iss170.htm">FORMAT-STRING-ARGUMENTS:SPECIFY</A><P></UL><HR>
|
|
|
|
<A REL=NAVIGATOR HREF="../Front/StartPts.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Starting Points]" SRC="../Graphics/StartPts.gif" ALIGN=Bottom></A><A REL=TOC HREF="../Front/Contents.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Contents]" SRC="../Graphics/Contents.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Master.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Index]" SRC="../Graphics/Index.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Symbol.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Symbols]" SRC="../Graphics/Symbols.gif" ALIGN=Bottom></A><A REL=GLOSSARY HREF="../Body/26_a.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Glossary]" SRC="../Graphics/Glossary.gif" ALIGN=Bottom></A><A HREF="../Front/X3J13Iss.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Issues]" SRC="../Graphics/Issues.gif" ALIGN=Bottom></A><BR>
|
|
|
|
<A REL=COPYRIGHT HREF="../Front/Help.htm#Legal"><I>Copyright 1996-2005, LispWorks Ltd. All rights reserved.</I></A><P>
|
|
</BODY>
|
|
</HTML>
|