115 lines
5.3 KiB
HTML
115 lines
5.3 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 DEFSTRUCT-COPIER-ARGUMENT-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/iss111_w.htm">
|
|
<LINK REL=UP HREF="../Issues/iss112.htm">
|
|
<LINK REL=NEXT HREF="../Issues/iss113_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/iss111_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss112.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss113_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<H2>Issue DEFSTRUCT-COPIER-ARGUMENT-TYPE Writeup</H2>
|
|
|
|
<PRE><B>Issue:</B> <A HREF="iss112.htm">DEFSTRUCT-COPIER-ARGUMENT-TYPE</A><P>
|
|
<B>Forum:</B> X3J13<P>
|
|
<B>References:</B> <A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>DEFSTRUCT</B></A> (X3J13/92-102, pp8-5..6)<P>
|
|
<B>Category:</B> CLARIFICATION<P>
|
|
<B>Edit history:</B> 07-Jul-93, Version 1 by Pitman<P>
|
|
<B>Status:</B> Proposal RESTRICT passed 11-1 on letter ballot 93-306.<P>
|
|
<P>
|
|
<P>
|
|
<B>Problem Description:<P>
|
|
</B><P>
|
|
The description of the :COPIER <A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>defstruct</B></A> option doesn't say that the<P>
|
|
consequences of applying the defined copier to an object not of the<P>
|
|
<A REL=DEFINITION HREF="../Body/f_docume.htm#structure"><B>structure</B></A> type are undefined.<P>
|
|
<P>
|
|
<B>Proposal (DEFSTRUCT-COPIER-ARGUMENT-TYPE:RESTRICT):<P>
|
|
</B><P>
|
|
Change the first sentence of the second paragraph of the description<P>
|
|
of the :COPIER to:<P>
|
|
<P>
|
|
The automatically defined copier function is a function of one<P>
|
|
\term{argument}, which must be of the <A REL=DEFINITION HREF="../Body/f_docume.htm#structure"><B>structure</B></A> type being defined.<P>
|
|
<P>
|
|
In addition, the last sentence can be changed to the following:<P>
|
|
<P>
|
|
If the <A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>DEFSTRUCT</B></A> :TYPE option was not used, the following<P>
|
|
equivalence applies:<P>
|
|
<P>
|
|
(<copier> x) = (<A REL=DEFINITION HREF="../Body/f_cp_stu.htm#copy-structure"><B>copy-structure</B></A> (the \param{structure-name} x))<P>
|
|
<P>
|
|
<B>Test Case:<P>
|
|
</B><P>
|
|
(<A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>DEFSTRUCT</B></A> S1 A B C)<P>
|
|
(<A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>DEFSTRUCT</B></A> S2 A B C)<P>
|
|
<P>
|
|
(COPY-S2 (MAKE-S1 :A 3)) => ??<P>
|
|
<P>
|
|
Before this proposal, it is possible to interpret the definition to say<P>
|
|
that #S(S1 :A 3) might be returned here. This proposal makes it clear<P>
|
|
that the consequences are in fact undefined.<P>
|
|
<P>
|
|
<B>Rationale:<P>
|
|
</B><P>
|
|
This gives implementational freedom in a situation where no reasonable<P>
|
|
programmer would say that the behavior should be well-defined. <P>
|
|
<P>
|
|
<B>Current Practice:<P>
|
|
</B><P>
|
|
LispWorks 3.1.0 signals an error in the test case (even in low safety code).<P>
|
|
<P>
|
|
Symbolics Genera 8.3 returns #S(S1 :A 3) in the test case.<P>
|
|
<P>
|
|
<B>Cost to Implementors:<P>
|
|
</B><P>
|
|
None. This change is upward compatible.<P>
|
|
<P>
|
|
<B>Cost to Users:<P>
|
|
</B><P>
|
|
HOPEFULLY none. It would be really ugly to imagine anyone taking advantage<P>
|
|
of the room that there is now.<P>
|
|
<P>
|
|
<B>Cost of Non-Adoption:<P>
|
|
</B><P>
|
|
The spec is less tight.<P>
|
|
<P>
|
|
<B>Benefits:<P>
|
|
</B><P>
|
|
Aesthetics.<P>
|
|
<P>
|
|
<B>Editorial Impact:<P>
|
|
</B><P>
|
|
Very small.<P>
|
|
<P>
|
|
<B>Aesthetics:<P>
|
|
</B><P>
|
|
Mostly the spec (and any resulting code) will be slightly cleaner this way.<P>
|
|
<P>
|
|
<B>Discussion:<P>
|
|
</B><P>
|
|
This change is in response to comment Margolin #8.<P>
|
|
<P>
|
|
Pitman doubts that anyone will actually abuse the loophole that <P>
|
|
this comment is about, but think's it's reasonable to tighten things<P>
|
|
up just in case.<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>
|