1
0
Fork 0
cl-sites/HyperSpec-7-0/HyperSpec/Issues/iss016_w.htm

100 lines
5.6 KiB
HTML
Raw Permalink Normal View History

2024-04-01 10:24:07 +02:00
<!-- Common Lisp HyperSpec (TM), version 7.0 generated by Kent M. Pitman on Mon, 11-Apr-2005 2:31am EDT -->
<HTML>
<HEAD>
<TITLE>CLHS: Issue ASSERT-ERROR-TYPE Writeup</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="../Issues/iss015_w.htm">
<LINK REL=UP HREF="../Issues/iss016.htm">
<LINK REL=NEXT HREF="../Issues/iss017_w.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="../Issues/iss015_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss016.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss017_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>Issue ASSERT-ERROR-TYPE Writeup</H2>
<PRE><B>Status:</B> Proposal <A REL=DEFINITION HREF="../Body/a_error.htm#error"><B>ERROR</B></A> accepted 12/91<P>
<B>Issue:</B> <A HREF="iss016.htm">ASSERT-ERROR-TYPE</A><P>
<B>Forum:</B> Cleanup<P>
<B>References:</B> <A REL=DEFINITION HREF="../Body/m_assert.htm#assert"><B>ASSERT</B></A> (Condition System, Revision #18, p27)<P>
<B>Category:</B> CHANGE<P>
<B>Edit history:</B> 15-Mar-91, Version 1 by Pitman<P>
<P>
<B>Problem Description:<P>
</B><P>
The condition system proposal says that <A REL=DEFINITION HREF="../Body/m_assert.htm#assert"><B>ASSERT</B></A> signals <A REL=DEFINITION HREF="../Body/e_smp_er.htm#simple-error"><B>SIMPLE-ERROR</B></A><P>
if the datum is omitted. This unnecessarily restricts an <P>
implementation's options.<P>
<P>
<B>Proposal (ASSERT-ERROR-TYPE:ERROR):<P>
</B><P>
Define that if the datum is omitted, <A REL=DEFINITION HREF="../Body/m_assert.htm#assert"><B>ASSERT</B></A> signals <A REL=DEFINITION HREF="../Body/a_error.htm#error"><B>ERROR</B></A>.<P>
<P>
<B>Test Case:<P>
</B><P>
(<A REL=DEFINITION HREF="../Body/m_hand_1.htm#handler-case"><B>HANDLER-CASE</B></A> (<A REL=DEFINITION HREF="../Body/m_hand_1.htm#handler-case"><B>HANDLER-CASE</B></A> (<A REL=DEFINITION HREF="../Body/m_assert.htm#assert"><B>ASSERT</B></A> <A REL=DEFINITION HREF="../Body/a_nil.htm#nil"><B>NIL</B></A>) (<A REL=DEFINITION HREF="../Body/e_smp_er.htm#simple-error"><B>SIMPLE-ERROR</B></A> 1)) (<A REL=DEFINITION HREF="../Body/a_error.htm#error"><B>ERROR</B></A> 2))<P>
<P>
Under Conditions System revision #18, this must return 1.<P>
Under proposal <A HREF="iss016.htm">ASSERT-ERROR-TYPE:ERROR</A>, this might return either 1 or 2.<P>
<P>
<B>Rationale:<P>
</B><P>
This leaves an implementation free to experiment with error types <P>
specific to assertions. Since the user is free to specify whatever<P>
type he needs, he can always work around any implementation-specific<P>
type in any way he wants.<P>
<P>
<B>Current Practice:<P>
</B><P>
In Symbolics Genera 8.1, the test case returns 1.<P>
<P>
<B>Cost to Implementors:<P>
</B><P>
None. (Since <A REL=DEFINITION HREF="../Body/e_smp_er.htm#simple-error"><B>SIMPLE-ERROR</B></A> is a subtype of <A REL=DEFINITION HREF="../Body/a_error.htm#error"><B>ERROR</B></A>, no change is forced.<P>
This just adds flexibility to implementations which want to do this <P>
differently.<P>
<P>
<B>Cost to Users:<P>
</B><P>
Little or none. There are probably very few people who are <P>
specifically doing <A REL=DEFINITION HREF="../Body/m_hand_1.htm#handler-case"><B>HANDLER-CASE</B></A> for <A REL=DEFINITION HREF="../Body/e_smp_er.htm#simple-error"><B>SIMPLE-ERROR</B></A> with the intent<P>
of specifically catching <A REL=DEFINITION HREF="../Body/m_assert.htm#assert"><B>ASSERT</B></A>.<P>
<P>
<B>Cost of Non-Adoption:<P>
</B><P>
Implementations have their hands tied unnecessarily.<P>
<P>
<B>Benefits:<P>
</B><P>
Aesthetics. Implementation flexibility.<P>
<P>
<B>Aesthetics:<P>
</B><P>
Makes language more consistent in that this was the only place where<P>
<A REL=DEFINITION HREF="../Body/e_smp_er.htm#simple-error"><B>SIMPLE-ERROR</B></A> was forced in a situation where the user wasn't supplying<P>
a format string.<P>
<P>
<B>Discussion:<P>
</B><P>
This issue was raised by Barrett several meetings ago, but was never<P>
formally written up.<P>
<P>
Pitman supports this.<P>
<P>
</PRE>
<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>