91 lines
5.2 KiB
HTML
91 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 COPY-SYMBOL-PRINT-NAME 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/iss087_w.htm">
|
|
<LINK REL=UP HREF="../Issues/iss088.htm">
|
|
<LINK REL=NEXT HREF="../Issues/iss089_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/iss087_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss088.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss089_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<H2>Issue COPY-SYMBOL-PRINT-NAME Writeup</H2>
|
|
|
|
<PRE><B>Issue:</B> <A HREF="iss088.htm">COPY-SYMBOL-PRINT-NAME</A><P>
|
|
<B>References:</B> <A REL=DEFINITION HREF="../Body/f_cp_sym.htm#copy-symbol"><B>COPY-SYMBOL</B></A> (p. 169)<P>
|
|
<B>Category:</B> CLARIFICATION<P>
|
|
<B>Edit history:</B> 1-MAR-89, Version 1 by Chapman<P>
|
|
15-MAR-89, Version 2 by Chapman<P>
|
|
<P>
|
|
<B>Problem Description:<P>
|
|
</B> <P>
|
|
The description of <A REL=DEFINITION HREF="../Body/f_cp_sym.htm#copy-symbol"><B>COPY-SYMBOL</B></A> states that it "returns a new uninterned<P>
|
|
symbol with the same print name as sym (its first argument)". The words<P>
|
|
"the same as" are not defined in CLtL. Do they mean <A REL=DEFINITION HREF="../Body/f_eq.htm#eq"><B>EQ</B></A>, <A REL=DEFINITION HREF="../Body/f_equal.htm#equal"><B>EQUAL</B></A>, ...?<P>
|
|
<P>
|
|
Proposal (<A HREF="iss088.htm">COPY-SYMBOL-PRINT-NAME:EQUAL</A>)<P>
|
|
<P>
|
|
The description of <A REL=DEFINITION HREF="../Body/f_cp_sym.htm#copy-symbol"><B>COPY-SYMBOL</B></A> should read as follows:<P>
|
|
"COPY-SYMBOL returns an uninterned<P>
|
|
symbol whose print name is <A REL=DEFINITION HREF="../Body/f_stgeq_.htm#stringEQ"><B>STRING=</B></A> to<P>
|
|
the print name of the symbol that is the first argument to <A REL=DEFINITION HREF="../Body/f_cp_sym.htm#copy-symbol"><B>COPY-SYMBOL</B></A>."<P>
|
|
<P>
|
|
Suggested implementation note:<P>
|
|
The string should not be copied unnecessarily. In this case, the uninterned<P>
|
|
symbol's print name would be <A REL=DEFINITION HREF="../Body/f_eq.htm#eq"><B>EQ</B></A> to the print name of the argument symbol.<P>
|
|
<P>
|
|
<B>Rationale:<P>
|
|
</B> <P>
|
|
This clarification resolves any possibility of ambiguity.<P>
|
|
<P>
|
|
<B>Current Practice:<P>
|
|
</B> <P>
|
|
Medley did this: the symbol names didn't really have a string header and<P>
|
|
some symbol names (the "initial symbols" ) had a different place for<P>
|
|
storing the actual characters than symbols created later. Unfortunately,<P>
|
|
that means that <A REL=DEFINITION HREF="../Body/f_symb_2.htm#symbol-name"><B>SYMBOL-NAME</B></A> has to <A REL=DEFINITION HREF="../Body/a_cons.htm#cons"><B>CONS</B></A>.<P>
|
|
It wasn't so much a problem for Interlisp since most of the "string"<P>
|
|
functions in Interlisp will take symbols, but in Common Lisp, it is a<P>
|
|
performance hit. Poor design, but there's no reason to <A REL=DEFINITION HREF="../Body/f_provid.htm#require"><B>require</B></A> <A REL=DEFINITION HREF="../Body/f_symb_2.htm#symbol-name"><B>SYMBOL-NAME</B></A><P>
|
|
to return <A REL=DEFINITION HREF="../Body/f_eq.htm#eq"><B>EQ</B></A> strings. <P>
|
|
In this case, the strings aren't <A REL=DEFINITION HREF="../Body/f_eq.htm#eq"><B>EQ</B></A> even though the string characters are<P>
|
|
shared. (Think of it as strings displaced to a shared area.)<P>
|
|
<P>
|
|
<P>
|
|
<B>Adoption Cost:<P>
|
|
</B> <P>
|
|
?<P>
|
|
<P>
|
|
<B>Benefits:<P>
|
|
</B> <P>
|
|
Less ambiguity in the specification, and potentially more portable code.<P>
|
|
<P>
|
|
<B>Conversion Cost:<P>
|
|
</B> <P>
|
|
?<P>
|
|
<P>
|
|
<B>Aesthetics:<P>
|
|
</B> <P>
|
|
None.<P>
|
|
<P>
|
|
<B>Discussion:<P>
|
|
</B> <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>
|