124 lines
7.4 KiB
HTML
124 lines
7.4 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 SHARPSIGN-PLUS-MINUS-PACKAGE 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/iss317_w.htm">
|
|
<LINK REL=UP HREF="../Issues/iss318.htm">
|
|
<LINK REL=NEXT HREF="../Issues/iss319_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/iss317_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss318.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss319_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<H2>Issue SHARPSIGN-PLUS-MINUS-PACKAGE Writeup</H2>
|
|
|
|
<PRE><B>Issue:</B> <A HREF="iss318.htm">SHARPSIGN-PLUS-MINUS-PACKAGE</A><P>
|
|
<B>References:</B> #+ (p. 358), #- (p. 359), <A REL=DEFINITION HREF="../Body/v_featur.htm#STfeaturesST"><B>*FEATURES*</B></A> (p. 448)<P>
|
|
<B>Category:</B> CLARIFICATION/CHANGE<P>
|
|
<B>Edit history:</B> Version 1 by Pitman 01-Mar-87<P>
|
|
Version 2 by Masinter 10-Nov-87<P>
|
|
Version 3 by Masinter 14-Nov-87<P>
|
|
<P>
|
|
<B>Problem Description:<P>
|
|
</B><P>
|
|
No information is provided in the description of #+ and #- (pp. 358-359) about<P>
|
|
what package the features are read on.<P>
|
|
<P>
|
|
In some systems, the current package is used. Since there is no wording in CLtL<P>
|
|
to the contrary, it's reasonable to assume that this would be done, but a<P>
|
|
consequence of this is that you must be much more sensitive to the package<P>
|
|
you're in at any given time when using #+ or #- even for system-provided<P>
|
|
features. (This is a problem if the LISP package can contain only the symbols in<P>
|
|
CLtL because system-provided features will likely not have the names of symbols<P>
|
|
on LISP and hence will <A REL=DEFINITION HREF="../Body/f_provid.htm#require"><B>require</B></A> package prefixes. Having a symbol named<P>
|
|
LISP:SYMBOLICS or LISP:LUCID would not be possible, so something like<P>
|
|
#+Symbolics would not be possible; you'd have to write #+SYSTEM:SYMBOLICS or<P>
|
|
some such, which might get a read error in a non-Symbolics implementation that<P>
|
|
didn't <A REL=DEFINITION HREF="../Body/f_export.htm#export"><B>export</B></A> SYMBOLICS from SYSTEM...)<P>
|
|
<P>
|
|
In some systems, a canonical package (such as <A REL=DEFINITION HREF="../Body/t_kwd.htm#keyword"><B>KEYWORD</B></A>) is used. This means that<P>
|
|
package prefixes are rarely necessary in sharpsign conditionals for<P>
|
|
system-provided features regardless of the current package or restrictions about<P>
|
|
what may be in LISP. (For example, the <A REL=DEFINITION HREF="../Body/t_kwd.htm#keyword"><B>KEYWORD</B></A> package can have any symbol so<P>
|
|
it's not a problem to push :SYMBOLICS or :LUCID on <A REL=DEFINITION HREF="../Body/v_featur.htm#STfeaturesST"><B>*FEATURES*</B></A>).<P>
|
|
<P>
|
|
This has implications about what goes on the <A REL=DEFINITION HREF="../Body/v_featur.htm#STfeaturesST"><B>*FEATURES*</B></A> list (p. 448).<P>
|
|
<P>
|
|
<P>
|
|
<B>Proposal (SHARPSIGN-PLUS-MINUS-PACKAGE:KEYWORD):<P>
|
|
</B><P>
|
|
Specify that the default package while reading feature specs is the keyword<P>
|
|
package. Other packages may be designated by use of explicit package prefixes.<P>
|
|
<P>
|
|
Symbols on <A REL=DEFINITION HREF="../Body/v_featur.htm#STfeaturesST"><B>*FEATURES*</B></A> may be in any package but that in practice they will<P>
|
|
mostly be on the keyword package because that's the package #+/#- uses by<P>
|
|
default. If symbols in a package other than keyword appear on <A REL=DEFINITION HREF="../Body/v_featur.htm#STfeaturesST"><B>*FEATURES*</B></A>, they<P>
|
|
will be seen by #+/#- only if marked by explicit package prefixes in the<P>
|
|
written feature-spec.<P>
|
|
<P>
|
|
Clarify that the package of the IEEE-FLOATING-POINT symbol mentioned on p. 448<P>
|
|
is <A REL=DEFINITION HREF="../Body/t_kwd.htm#keyword"><B>KEYWORD</B></A>.<P>
|
|
<P>
|
|
<B>Rationale:<P>
|
|
</B><P>
|
|
Making the behavior of #+ and #- well defined is important for people writing<P>
|
|
portable code that manipulate <A REL=DEFINITION HREF="../Body/v_featur.htm#STfeaturesST"><B>*FEATURES*</B></A> directly.<P>
|
|
<P>
|
|
<B>Current Practice:<P>
|
|
</B><P>
|
|
Some implementations bind <A REL=DEFINITION HREF="../Body/v_pkg.htm#STpackageST"><B>*PACKAGE*</B></A> while reading feature specs and others do<P>
|
|
not.<P>
|
|
<P>
|
|
<B>Adoption Cost:<P>
|
|
</B><P>
|
|
Changes to implementations to make them conform should be fairly minor if not<P>
|
|
trivial.<P>
|
|
<P>
|
|
<B>Benefits:<P>
|
|
</B><P>
|
|
As currently specified, using #+ and #- in truly portable code can have<P>
|
|
bootstrapping problems, since it is sometimes required to conditionally set up<P>
|
|
<A REL=DEFINITION HREF="../Body/v_featur.htm#STfeaturesST"><B>*FEATURES*</B></A> in different ways for different systems.<P>
|
|
<P>
|
|
<B>Conversion Cost:<P>
|
|
</B><P>
|
|
Few changes to user code will be required; code that uses #+ and #- will<P>
|
|
continue to work, although code that manipulates <A REL=DEFINITION HREF="../Body/v_featur.htm#STfeaturesST"><B>*FEATURES*</B></A> directly may <A REL=DEFINITION HREF="../Body/f_provid.htm#require"><B>require</B></A><P>
|
|
editing. <P>
|
|
<P>
|
|
<B>Aesthetics:<P>
|
|
</B><P>
|
|
Most users would perceive this as a bug fix either to CLtL or to certain<P>
|
|
implementations.<P>
|
|
<P>
|
|
<B>Discussion:<P>
|
|
</B><P>
|
|
The cleanup committee supports this proposal.<P>
|
|
<P>
|
|
It might be reasonable to suggest that only vendors should add keyword symbols<P>
|
|
to the <A REL=DEFINITION HREF="../Body/v_featur.htm#STfeaturesST"><B>*FEATURES*</B></A> list, and that users should add features on their personal<P>
|
|
packages so that collisions due to user applications were less likely. This idea<P>
|
|
might be a subject of controversy though, so is not part of this proposal.<P>
|
|
<P>
|
|
It would be useful to create a non-binding registry of feature names (and<P>
|
|
package names) already in use, so that Lisp implementors could pick otherwise<P>
|
|
unused feature names, and users who wanted to write portable code could know<P>
|
|
what feature names were preferred.<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>
|