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

110 lines
5.8 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 DEFTYPE-DESTRUCTURING 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/iss120_w.htm">
<LINK REL=UP HREF="../Issues/iss121.htm">
<LINK REL=NEXT HREF="../Issues/iss122_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/iss120_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss121.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss122_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>Issue DEFTYPE-DESTRUCTURING Writeup</H2>
<PRE><B>Issue:</B> <A HREF="iss121.htm">DEFTYPE-DESTRUCTURING</A><P>
<B>References:</B> <A REL=DEFINITION HREF="../Body/m_deftp.htm#deftype"><B>DEFTYPE</B></A><P>
Related issues: <A HREF="iss122.htm">DEFTYPE-KEY</A><P>
<B>Category:</B> CLARIFICATION, CHANGE<P>
<B>Edit history:</B> V1, 23 May 90, Sandra Loosemore<P>
<P>
<B>Problem description:<P>
</B><P>
The specification of <A REL=DEFINITION HREF="../Body/m_deftp.htm#deftype"><B>DEFTYPE</B></A> is not clear on the issue of whether<P>
it is supposed to support destructuring. The description in CLtL<P>
twice compares its syntax to that of <A REL=DEFINITION HREF="../Body/m_defmac.htm#defmacro"><B>DEFMACRO</B></A>, leading some<P>
people to think that it does support destructuring. However,<P>
since destructuring is not explicitly mentioned, other people<P>
think it does not.<P>
<P>
There are two proposals, YES and NO.<P>
<P>
<B>Proposal (DEFTYPE-DESTRUCTURING:YES):<P>
</B> <P>
Clarify that <A REL=DEFINITION HREF="../Body/m_deftp.htm#deftype"><B>DEFTYPE</B></A> does support destructuring of the <A REL=DEFINITION HREF="../Body/a_lambda.htm#lambda"><B>lambda</B></A> list.<P>
The lambda-list syntax for <A REL=DEFINITION HREF="../Body/m_deftp.htm#deftype"><B>DEFTYPE</B></A> is identical to that of<P>
<A REL=DEFINITION HREF="../Body/m_defmac.htm#defmacro"><B>DEFMACRO</B></A>.<P>
<P>
Rationale for proposal YES:<P>
Some people think this is the way it was really supposed to<P>
work, and that supporting destructuring makes the syntax of <P>
<A REL=DEFINITION HREF="../Body/m_deftp.htm#deftype"><B>DEFTYPE</B></A> more consistent with other defining macros.<P>
<P>
<B>Proposal (DEFTYPE-DESTRUCTURING:NO):<P>
</B><P>
Clarify that <A REL=DEFINITION HREF="../Body/m_deftp.htm#deftype"><B>DEFTYPE</B></A> does not support destructuring of the <A REL=DEFINITION HREF="../Body/a_lambda.htm#lambda"><B>lambda</B></A><P>
list. <P>
<P>
Rationale for proposal NO:<P>
This requires minimal changes for implementors. The use of<P>
destructuring with <A REL=DEFINITION HREF="../Body/m_deftp.htm#deftype"><B>DEFTYPE</B></A> is rare and since some<P>
implementations do not support it now, code that relies on<P>
it working is already nonportable.<P>
<P>
<B>Current Practice:<P>
</B><P>
Spice Lisp implemented a destructuring <A REL=DEFINITION HREF="../Body/m_deftp.htm#deftype"><B>DEFTYPE</B></A>, and a number<P>
of implementations have copied this behavior. Other<P>
implementations do not support destructuring in <A REL=DEFINITION HREF="../Body/m_deftp.htm#deftype"><B>DEFTYPE</B></A>.<P>
<P>
<B>Cost to Implementors:<P>
</B><P>
For proposal YES, fairly small, since every implementation<P>
already has support for destructuring for other parts of<P>
the language.<P>
<P>
For proposal NO, none. Implementations that now support <P>
destructuring can continue to do so as an extension.<P>
<P>
<B>Cost to Users:<P>
</B><P>
None for either proposal. Code that relies on destructuring <P>
with <A REL=DEFINITION HREF="../Body/m_deftp.htm#deftype"><B>DEFTYPE</B></A> is already not portable, but on the other hand<P>
adding destructing support shouldn't break code that doesn't<P>
use it.<P>
<P>
<B>Cost of non-adoption:<P>
</B><P>
Continuing vagueness in this part of the language specification.<P>
<P>
<B>Performance impact:<P>
</B><P>
Probably insignificant.<P>
<P>
<B>Benefits:<P>
</B><P>
This part of the language specification is made more clear.<P>
<P>
<B>Esthetics:<P>
</B><P>
Seems to be a matter of personal taste.<P>
<P>
<B>Discussion:<P>
</B>-------<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>