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

104 lines
5.5 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-INCLUDE-DEFTYPE 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/iss114_w.htm">
<LINK REL=UP HREF="../Issues/iss115.htm">
<LINK REL=NEXT HREF="../Issues/iss116_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/iss114_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss115.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss116_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>Issue DEFSTRUCT-INCLUDE-DEFTYPE Writeup</H2>
<PRE><B>Issue:</B> <A HREF="iss115.htm">DEFSTRUCT-INCLUDE-DEFTYPE</A><P>
<B>Forum:</B> Editorial<P>
<B>References:</B> <A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>DEFSTRUCT</B></A>'s :INCLUDE option (pp312-314)<P>
<B>Category:</B> CLARIFICATION<P>
<B>Edit history:</B> 01-Mar-91, Version 1 by Pitman<P>
<B>Status:</B> For X3J13 consideration<P>
<P>
<B>Problem Description:<P>
</B><P>
From time to time, people ask whether they can specify in a :INCLUDE<P>
to <A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>DEFSTRUCT</B></A> the name of a type which is defined by <A REL=DEFINITION HREF="../Body/m_deftp.htm#deftype"><B>DEFTYPE</B></A> to expand<P>
into a type that was defined by <A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>DEFSTRUCT</B></A>.<P>
<P>
<B>Proposal (DEFSTRUCT-INCLUDE-DEFTYPE:EXPLICITLY-UNDEFINED):<P>
</B><P>
Clarify that the only names which are permissible as type names to<P>
the :INCLUDE option of <A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>DEFSTRUCT</B></A> are actual names previously defined<P>
by <A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>DEFSTRUCT</B></A>.<P>
<P>
Clarify that one implication of this is that the consequences are <P>
undefined if a type given to <A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>DEFSTRUCT</B></A>'s :INCLUDE option is a type<P>
defined by <A REL=DEFINITION HREF="../Body/m_deftp.htm#deftype"><B>DEFTYPE</B></A>, even if it expands into a type defined by <A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>DEFSTRUCT</B></A>.<P>
<P>
<B>Test Case:<P>
</B><P>
(<A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>DEFSTRUCT</B></A> FOO A B)<P>
<P>
(<A REL=DEFINITION HREF="../Body/m_deftp.htm#deftype"><B>DEFTYPE</B></A> FU () 'FOO)<P>
<P>
(<A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>DEFSTRUCT</B></A> (BAR (:INCLUDE FU)) C)<P>
<P>
<B>Rationale:<P>
</B><P>
Permitting DEFTYPE-defined types here might open the door to other<P>
inconsistencies with DEFTYPE-defined types not being accepted in other<P>
`reasonable' places.<P>
<P>
Most implementations probably don't allow this and a change would<P>
be extra work for implementors.<P>
<P>
<B>Current Practice:<P>
</B><P>
Symbolics Genera signals an error if the :INCLUDE'd type was not<P>
specifically defined by <A REL=DEFINITION HREF="../Body/m_defstr.htm#defstruct"><B>DEFSTRUCT</B></A>.<P>
<P>
<B>Cost to Implementors:<P>
</B><P>
None. &quot;The consequences are undefined&quot; leaves implementations free to<P>
do whatever they want.<P>
<P>
<B>Cost to Users:<P>
</B><P>
None. Users de facto can't really rely on this now so portable<P>
programs shouldn't be effected.<P>
<P>
<B>Cost of Non-Adoption:<P>
</B><P>
Some users will continue to be puzzled about whether the perceived-to-be <P>
fascist behavior of some implementations is what was intended.<P>
<P>
<B>Benefits:<P>
</B><P>
Users will know what to expect.<P>
<P>
<B>Aesthetics:<P>
</B><P>
Doing the full job of making DEFTYPE-defined types acceptable in any<P>
place might be aesthetic, but that's not what is proposed here, and making<P>
a lot of little special case exceptions probably isn't so aesthetic.<P>
<P>
<B>Discussion:<P>
</B><P>
Pitman supports this proposal.<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>