1
0
Fork 0
cl-sites/HyperSpec-7-0/HyperSpec/Issues/iss010_w.htm
2024-04-01 10:24:07 +02:00

93 lines
5.2 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: Issue ARGUMENT-MISMATCH-ERROR-AGAIN 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/iss009_w.htm">
<LINK REL=UP HREF="../Issues/iss010.htm">
<LINK REL=NEXT HREF="../Issues/iss011_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/iss009_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss010.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss011_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>Issue ARGUMENT-MISMATCH-ERROR-AGAIN Writeup</H2>
<PRE><B>Issue:</B> <A HREF="iss010.htm">ARGUMENT-MISMATCH-ERROR-AGAIN</A><P>
<B>Forum:</B> Cleanup<P>
<B>References:</B> <A HREF="iss012.htm">ARGUMENT-MISMATCH-ERROR</A>, draft 10.156 pp.3-44, 3-48<P>
<B>Category:</B> CHANGE<P>
<B>Edit history:</B> 9-Dec-91, Version 1 by Moon<P>
<B>Status:</B> Accepted 10-Dec-91; 10-1<P>
<P>
<B>Problem description:<P>
</B> <P>
<A HREF="iss012.htm">ARGUMENT-MISMATCH-ERROR</A> left out two cases of argument mismatch error:<P>
(1) a mismatch between a destructuring <A REL=DEFINITION HREF="../Body/a_lambda.htm#lambda"><B>lambda</B></A> list and the tree being destructured;<P>
(2) an odd number of arguments supplied to the keyword parameters.<P>
<P>
In the current specification, these are both &quot;the consequences are undefined.&quot;<P>
This is inconsistent with the handling of the other five argument mismatch errors.<P>
<P>
<B>Proposal (ARGUMENT-MISMATCH-ERROR-AGAIN:CONSISTENT):<P>
</B><P>
Add two new subsections to section 3.5, with wording analogous to the subsections<P>
already present, to cover these cases, as follows:<P>
<P>
(1) After the existing sentence &quot;The pattern and the \term{macro form} must have<P>
compatible \term{tree structure}; that is, their \term{tree structure} must be<P>
equivalent, or it must differ only in that some \term{leaves} of the pattern<P>
match \term{non-atomic} \term{objects} of the \term{macro form}.&quot; add &quot;In a safe<P>
call, an error of type <A REL=DEFINITION HREF="../Body/e_progra.htm#program-error"><B>program-error</B></A> must be signaled; otherwise, the situation<P>
has undefined consequences.&quot; followed by the boilerplate about the exact point of<P>
the signal.<P>
<P>
(2) Add the following: &quot;An odd number of arguments must not be supplied for the<P>
keyword parameters. In a \term{safe} \term{call}, an error \oftype{program-error}<P>
must be signaled unless either \keyref{allow-other-keys} was used in the<P>
\term{function}'s definition, or ``\f{:allow-other-keys \term{true}}'' was used<P>
in the \term{call}; otherwise, the \term{situation} has undefined consequences.&quot;<P>
followed by the boilerplate about the exact point of the signal. <P>
<P>
Move some text now on page 3-44 to the new subsection of 3.5 dealing with destructuring.<P>
<P>
<B>Rationale:<P>
</B> <P>
Consistency.<P>
<P>
<B>Current practice:<P>
</B><P>
CLtL did not <A REL=DEFINITION HREF="../Body/f_provid.htm#require"><B>require</B></A> this level of error checking, so it's entirely <P>
likely that there are implementations which do not conform.<P>
<P>
<B>Cost to Implementors:<P>
</B><P>
The cost of adding additional error checking in some implementations.<P>
<P>
<B>Cost to Users:<P>
</B><P>
More robust code.<P>
<P>
<B>Cost of non-adoption:<P>
</B><P>
Less safety when users use defmacro; inconsistency in the specification.<P>
<P>
<B>Performance impact:<P>
</B><P>
None.<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>