1
0
Fork 0
cl-sites/HyperSpec-7-0/HyperSpec/Issues/iss315_w.htm

139 lines
7.4 KiB
HTML
Raw Permalink Normal View History

2024-04-01 10:24:07 +02:00
<!-- 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 SHARP-COMMA-CONFUSION 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/iss313_w.htm">
<LINK REL=UP HREF="../Issues/iss315.htm">
<LINK REL=NEXT HREF="../Issues/iss316_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/iss313_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss315.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss316_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>Issue SHARP-COMMA-CONFUSION Writeup</H2>
<PRE><B>Forum:</B> Compiler<P>
<B>Issue:</B> <A HREF="iss315.htm">SHARP-COMMA-CONFUSION</A><P>
<B>References:</B> CLtL p. 356<P>
Issue <A HREF="iss216_m.htm">LOAD-TIME-EVAL</A><P>
<B>Category:</B> CHANGE<P>
<B>Edit History:</B> V1, 17 Oct 1988, Sandra Loosemore<P>
V2, 30 Dec 1988, Sandra Loosemore (comments from Pitman)<P>
<B>Status:</B> Proposal <A REL=DEFINITION HREF="../Body/f_rm_rm.htm#remove"><B>REMOVE</B></A> passed Jan 89<P>
<P>
<P>
<B>Problem Description:<P>
</B><P>
The way the read macro #, is defined in CLtL does not make it clear<P>
that it can only appear inside of (implicitly) quoted <A REL=DEFINITION HREF="../Body/f_docume.htm#structure"><B>structure</B></A> to<P>
guarantee consistent handling between the interpreter and the<P>
compiler. Examples of inconsistent uses would be #, forms appearing<P>
outside of a <A REL=DEFINITION HREF="../Body/s_quote.htm#quote"><B>QUOTE</B></A> that expand into list or symbol forms that could be<P>
interpreted as code, or strings that could be interpreted as<P>
documentation strings. Users are even more likely to be confused<P>
because the wording in CLtL compares the behavior of #, to the special<P>
form <A REL=DEFINITION HREF="../Body/s_eval_w.htm#eval-when"><B>EVAL-WHEN</B></A>, which must appear in a for-evaluation position.<P>
<P>
#, also presents a serious problem to program-analyzing programs<P>
because evaluation is tied to the reader, rather than the interpreter<P>
or compiler. In theory, this could be handled by altering the read table<P>
to have #, construct a &quot;magic cookie&quot; instead of performing read-time<P>
evaluation and having the code walker examine quoted structures, but I've<P>
never seen this actually done in practice.<P>
<P>
<P>
<B>Proposal SHARP-COMMA-CONFUSION:REMOVE:<P>
</B><P>
Remove the #, read macro from the language.<P>
<P>
<P>
<B>Rationale:<P>
</B><P>
Removing #, is simpler than trying to redefine it. Removing it from<P>
the <A REL=DEFINITION HREF="../Body/07_ffb.htm#standard"><B>standard</B></A>, rather than redefining it to mean something else (see<P>
issue <A HREF="iss216_m.htm">LOAD-TIME-EVAL</A>), would allow implementations to continue to<P>
<A REL=DEFINITION HREF="../Body/f_provid.htm#provide"><B>provide</B></A> it as an extension. (Although CLtL does not appear to<P>
explicitly address the question of whether implementations may extend<P>
the reader syntax, some implementations already <A REL=DEFINITION HREF="../Body/f_provid.htm#provide"><B>provide</B></A> sharp-sign<P>
read macros other than those described in CLtL, such as #P syntax for<P>
pathnames.)<P>
<P>
<P>
<B>Current Practice:<P>
</B><P>
#, is not used very frequently, but the functionality it provides is<P>
important in some advanced applications; one such application that has<P>
been cited is CLOS. Maintainers of such applications have generally<P>
expressed a willingness to give up #, only if a suitable alternative<P>
is offered (see issue <A HREF="iss216_m.htm">LOAD-TIME-EVAL</A>).<P>
<P>
PSL/PCLS has never bothered to implement #, correctly (it's treated<P>
just like #.), and nobody has ever complained about it being broken.<P>
<P>
<P>
<B>Cost to implementors:<P>
</B><P>
None.<P>
<P>
<P>
<B>Cost to users:<P>
</B><P>
Because #, is used so infrequently, most users would probably not even<P>
notice its absence.<P>
<P>
Issue <A HREF="iss216_m.htm">LOAD-TIME-EVAL</A> proposes to add a special form that would <A REL=DEFINITION HREF="../Body/f_provid.htm#provide"><B>provide</B></A><P>
a somewhat cleaner mechanism for load-time evaluation.<P>
<P>
It is also possible to use a global variable to get the similar effect as<P>
#,, although this is sometimes awkward and carries a space and <P>
performance penalty in many implementations.<P>
<P>
<P>
<B>Benefits:<P>
</B><P>
The language specification is simplified by removing a peculiar<P>
feature of the language that is accessible only through the reader.<P>
<P>
Removing #, may also allow simpler strategies for implementing<P>
compiled file loaders to be used.<P>
<P>
<P>
<B>Discussion:<P>
</B><P>
If this proposal is rejected, the definition of #, in the <A REL=DEFINITION HREF="../Body/07_ffb.htm#standard"><B>standard</B></A> will<P>
still need to be clarified to indicate that #, can only appear in<P>
quoted <A REL=DEFINITION HREF="../Body/f_docume.htm#structure"><B>structure</B></A>. It should probably also include some mention of the<P>
problems that #, can cause code walkers.<P>
<P>
Kent Pitman says:<P>
<P>
I approve of the ideas being discussed, but ONLY contingent on<P>
<A REL=DEFINITION HREF="../Body/s_ld_tim.htm#load-time-value"><B>LOAD-TIME-VALUE</B></A> being introduced.<P>
<P>
I am optimistic that <A HREF="iss216_m.htm">LOAD-TIME-EVAL</A> will pass, and so I don't think this<P>
will keep #, from passing, but:<P>
- I want people who vote for this to realize the importance of voting<P>
for <A HREF="iss216_m.htm">LOAD-TIME-EVAL</A>.<P>
- On the off chance <A HREF="iss216_m.htm">LOAD-TIME-EVAL</A> doesn't pass, I want people to have<P>
been warned that the consequences were severe for some major <P>
applications.<P>
- I want the records to reflect the actual rationale people should and <P>
hopefully will be using to make these decisions.<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>