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

236 lines
13 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 LISP-PACKAGE-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/iss211_w.htm">
<LINK REL=UP HREF="../Issues/iss212.htm">
<LINK REL=NEXT HREF="../Issues/iss213_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/iss211_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss212.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss213_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>Issue LISP-PACKAGE-NAME Writeup</H2>
<PRE><B>Status:</B> passed, as amended, Mar 89 X3J13<P>
<P>
<B>Issue:</B> <A HREF="iss212.htm">LISP-PACKAGE-NAME</A><P>
<B>References:</B> 11.6 Built-in Packages (pp181-182)<P>
<B>Category:</B> CHANGE<P>
<B>Edit history:</B> 22-Dec-88, Version 1 by Pitman<P>
9-Apr-89, version 2 by Masinter, incorporate<P>
changes per Mar 89 amendments.<P>
<P>
<B>Problem Description:<P>
</B><P>
Since ANSI Common Lisp will differ from the Common Lisp described by CLtL,<P>
it will not be possible to have support for both in the same Lisp image<P>
if ANSI Common Lisp insists on placing its functionality in the package<P>
named LISP.<P>
<P>
Further, use of the name unqualified name LISP by the ANSI Common Lisp<P>
community is inconsistent with ANSI's expressed position to ISO that <P>
the term &quot;LISP&quot; names a language family rather than a specific dialect<P>
within that family.<P>
<P>
<B>Proposal (LISP-PACKAGE-NAME:COMMON-LISP):<P>
</B><P>
Define that ANSI Common Lisp uses the package name COMMON-LISP, not LISP.<P>
Define that the COMMON-LISP package has nickname CL.<P>
<P>
Since some symbols (e.g., T, <A REL=DEFINITION HREF="../Body/a_nil.htm#nil"><B>NIL</B></A>, and <A REL=DEFINITION HREF="../Body/a_lambda.htm#lambda"><B>LAMBDA</B></A>) might have to be shared<P>
between COMMON-LISP and LISP in implementations simultaneously supporting<P>
both, clarify that the initial symbols specified by ANSI Common Lisp as<P>
belonging in the COMMON-LISP package need not have a home package of <P>
Common-Lisp.<P>
<P>
Similarly, rename the package USER to be COMMON-LISP-USER with<P>
nickname CL-USER.<P>
<P>
<B>Test Case:<P>
</B><P>
In an implementation supporting CLtL's LISP package and <P>
the ANSI Common Lisp CL package proposed here:<P>
<P>
(<A REL=DEFINITION HREF="../Body/f_eq.htm#eq"><B>EQ</B></A> 'LISP:T 'CL:T)<P>
=&gt; not specified, due to this proposal, but probably T<P>
<P>
(<A REL=DEFINITION HREF="../Body/f_eq.htm#eq"><B>EQ</B></A> 'LISP:CAR 'CL:CAR)<P>
=&gt; not specified, due to this proposal, but probably T<P>
<P>
(<A REL=DEFINITION HREF="../Body/f_eq.htm#eq"><B>EQ</B></A> 'LISP:FUNCTIONP 'CL:FUNCTIONP)<P>
=&gt; not specified, due to this proposal, but since <A REL=DEFINITION HREF="../Body/f_fnp.htm#functionp"><B>FUNCTIONP</B></A> is<P>
changed incompatibly between CLtL (LISP) and CL (ANSI), there<P>
are good reasons why this might return <A REL=DEFINITION HREF="../Body/a_nil.htm#nil"><B>NIL</B></A>.<P>
<P>
(<A REL=DEFINITION HREF="../Body/f_symb_3.htm#symbol-package"><B>SYMBOL-PACKAGE</B></A> 'CL:T)<P>
=&gt; not specified, due to this proposal. Perhaps #&lt;Package CL&gt;, <P>
perhaps #&lt;Package LISP&gt;, or perhaps something implementation-specific.<P>
<P>
(<A REL=DEFINITION HREF="../Body/f_symb_3.htm#symbol-package"><B>SYMBOL-PACKAGE</B></A> 'LISP:T)<P>
=&gt; not specified, not due to this proposal, but because CLtL didn't<P>
specify this explicitly.<P>
<P>
<B>Rationale:<P>
</B><P>
In practice, some implementations will have very legitimate reasons for <P>
wanting to Lisp dialects to be coresident. As it stands, they will have<P>
little other choice than to make the two use different packages, and so<P>
will be forced to be incompatible with one or the other dialect unless<P>
we choose a different package name for the one dialect for which there<P>
is currently no existing code.<P>
<P>
Not only is this important the CLtL and ANSI Common Lisp communities, but<P>
also, if we continue to use the name LISP, it sends a signal to the ISO<P>
Lisp community that the &quot;latest and greatest&quot; Lisp should use the generic<P>
name LISP, and they may try to use it as well. If ISO Lisp turns out to<P>
be very different than ANSI Common Lisp, there may be motivation down the<P>
line for having ISO Lisp and ANSI Common Lisp co-resident, and conflicts<P>
will inevitably arise if both want to use the name LISP. This will almost<P>
certainly lead to a confrontation where one Lisp dialect tries to force<P>
the other out by the artificial means of asserting its right to this<P>
generic name. Choosing a name which compatibly admits the option of<P>
introducing other dialects into the environment at a later date without<P>
conflict is a good way to avoid a <A REL=DEFINITION HREF="../Body/t_class.htm#class"><B>class</B></A> of potential problems.<P>
<P>
Although there are a few problems which could come up due to the symbol<P>
package of initial symbols being unspecified, experience with <P>
implementations that do this suggests that they are very few.<P>
Problems occur only in the rare circumstance that all of the following<P>
conditions are met:<P>
<P>
- A symbol S on the LISP package but with home package H (that is not &quot;LISP&quot;)<P>
is shadowed in some package P of implementation A.<P>
<P>
- A program F in package P uses the shadowed symbol H:S by an explicit<P>
LISP: or H: package qualification. (Only the case of using &quot;LISP:&quot; is<P>
interesting, of course, since if H were named explicitly, we would be<P>
outside the bounds of portable code).<P>
<P>
- The program F, referring to H:S, is printed out in implementation A <P>
while using package P (or some other package that shadows S, so that<P>
the H package qualifier appears explicitly) and an attempt is made to<P>
re-read it in implementation B.<P>
<P>
- Implementation B has no package named H, has a package named H but no<P>
external symbol named S, or has a package named H with external symbol<P>
S but the symbol H:S has different semantics in implementation B than<P>
it did in implementation A.<P>
<P>
In practice, this hardly ever happens. It would happen even less if <P>
programmers were explicitly alerted that it was a potential problem they<P>
needed to guard against.<P>
<P>
<B>Current Practice:<P>
</B><P>
Symbolics Genera already has a package named COMMON-LISP with nicknames<P>
CL and LISP. As such, this would be an incompatible change for Genera.<P>
<P>
<B>Cost to Implementors:<P>
</B><P>
Small.<P>
<P>
In some cases, this may even have `negative cost' because it will <A REL=DEFINITION HREF="../Body/f_provid.htm#provide"><B>provide</B></A><P>
implementors a way of avoiding incompatible changes to released operators.<P>
<P>
<B>Cost to Users:<P>
</B><P>
Small.<P>
<P>
In some cases, this may even have `negative cost' because existing code<P>
would be able to continue to run in implementations which chose to support<P>
both CLtL's LISP and ANSI Common Lisp's CL packages, thereby allowing<P>
developers to put off a massover changeover, perhaps doing the transition<P>
more incrementally.<P>
<P>
<B>Cost of Non-Adoption:<P>
</B><P>
Implementations trying to support multiple dialects in the same environment<P>
would be forced to violate one or the other spec.<P>
<P>
Worse, different implementations faced with the same set of hard choices<P>
about which spec to violate in order to concurrently support two dialects<P>
might not make the same choices, leading to even more gratuitous <P>
incompatibility.<P>
<P>
ANSI's position in ISO that we are not trying to legislate the meaning of<P>
-the- LISP dialect would be weakened.<P>
<P>
<B>Benefits:<P>
</B><P>
Needless incompatibility would be avoided in a variety of situations.<P>
<P>
<B>Aesthetics:<P>
</B><P>
Failing to specify the home package of symbols in the LISP and CL packages<P>
seems unaesthetic because it appears to diminish print/read invertability,<P>
but as observed above, that case is rare.<P>
<P>
Failiing to specify a way in which lisp dialects can be co-resident is also<P>
unaesthetic because in practice implementors with a need to do this will do<P>
so whether the <A REL=DEFINITION HREF="../Body/07_ffb.htm#standard"><B>standard</B></A> allows them or not, and it will be a source of <P>
severe divergence among implementations.<P>
<P>
<B>Discussion:<P>
</B><P>
Symbolics Genera offers two co-resident dialects of Lisp: Zetalisp and<P>
Symbolics Common Lisp. The Symbolics Cloe development environment adds<P>
a third co-resident dialect, making an environment in which two differing<P>
Common Lisp dialects (Symbolics Common Lisp and Cloe) must cooperate.<P>
Already in Cloe it is not possible for the home package to contain <P>
package &quot;LISP&quot; since Cloe's concept of what the &quot;LISP&quot; package is differs<P>
from Genera's concept of what the &quot;LISP&quot; package is, yet they are forced<P>
by efficiency constraints to share the same symbol. It is Pitman's belief,<P>
based on extensive experience with Cloe, that failure to pass this proposal<P>
(or something very like it) will lead to all sorts of trouble for Common<P>
Lisp users and implementors down the road.<P>
<P>
Pitman strongly supports this proposal.<P>
<P>
Additional comments:<P>
<P>
Is it permissible for implementations to define<P>
&quot;LISP&quot; as a nickname for this package, for the<P>
sake of backward compatibility?<P>
<P>
Anyone wanting to make LISP a nickname could just as well create a LISP<P>
package which simply imported the appropriate symbols from the CL package.<P>
<P>
With only modest additional effort, they could try to make new symbols where<P>
feasable (especially for most functions) and put borrowed functions plopped<P>
in their function cells. The amount of additional storage is small (compared<P>
to implementing a whole new lisp), but it would leave open the possibility for<P>
users upgrading the level of compatibility without hurting the core<P>
system. eg, if I wanted <A REL=DEFINITION HREF="../Body/f_append.htm#append"><B>APPEND</B></A> to signal an error on dotted lists, I<P>
would not consider redefining the system's <A REL=DEFINITION HREF="../Body/f_append.htm#append"><B>APPEND</B></A> for fear of breaking<P>
the world, but if they told me that nothing depended on LISP other than<P>
compatibility code, I might feel ok about redefining (or doing<P>
<A REL=DEFINITION HREF="../Body/f_shdw_i.htm#shadowing-import"><B>SHADOWING-IMPORT</B></A> of LISP:APPEND on a per-implementation basis (with<P>
appropriate sharp conditionals)) in order to up the level of<P>
compatibility.<P>
<P>
In fact, though, my guess is that implementations which are not going to<P>
do a serious compatibility effort are better off leaving the package<P>
missing. My experience has been that customers are often happier growing<P>
their own compatibility [or getting it from a public library] than being<P>
stuck with something which really doesn't do what they want but which<P>
seals off the place in the namespace which they needed in order to do<P>
their own thing.<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>