References: CLtL p.186
Edit history: Version 1 Moon 24 Aug 87
Version 2 Moon 27 Aug 87 incorporate JonL's suggestions
Version 3 Masinter 26-Oct-87
Version 4 Masinter 10-Nov-87
The description of the SHADOW function can be interpreted as saying that the
function has no effect, if the symbol is already present in the package. This
happens if the third sentence in the description ("then nothing is done") is
interpreted as applying to the entire description rather than just to the fourth
SHADOW is said to take symbols as arguments, however only the print-name is
meaningful for this operation (that fact is already documented).
1) The SHADOW function always adds the symbol to the PACKAGE-SHADOWING-SYMBOLS
list, even when the symbol is already present in the package.
2) The first argument to SHADOW is allowed to be or contain strings as well as
symbols. The specification "the print name of each symbol is extracted" is to be
;;; SHADOW always adds the symbol to the PACKAGE-SHADOWING-SYMBOLS
;;; list of a package
(intern "TEST" (find-package 'test-1))
(shadow 'test-1::test (find-package 'test-1))
(assert (not (null (member 'test-1::test (package-shadowing-symbols
(intern "TEST" (find-package 'test-2))
(export 'test-2::test (find-package 'test-2))
(use-package 'test-2 (find-package 'test-1)) ;should not error
;;; To test the use of strings in place of symbols
;;; change the third line of the test case to
;;; (shadow "TEST" (find-package 'test-1))
;;; Note the use of capital letters in the string.
CLtL p. 180 describes a name conflict problem that can occur when calling the
function USE-PACKAGE. The name conflict is between a symbol directly present in
the using package and an external symbol of the used package. This name conflict
may be resolved in favor of the symbol directly present in the using package by
making it a shadowing symbol. For this to work, SHADOW must add the symbol to
the PACKAGE-SHADOWING-SYMBOLS list even when it is already present in the
Since only the print name of a symbol argument is meaningful, a string should
also be accepted. This is particularly useful to avoid problems when compiling
code in one package environment and loading it into a slightly different package
environment, where the symbol that was referred to at compile time may not be
present at load time. This is particularly important because the symbol
referred to by the print name may be changed by evaluation of the SHADOW form.
A close reading of CLtL shows that one can already use (shadow '#:bar) in place
of (shadow 'bar), to achieve much the same effect as (shadow "BAR"). But the
user should not have to play such games, strings should be accepted.
Symbolics and Spice Lisp add the symbol to the PACKAGE-SHADOWING-SYMBOLS list,
even when the symbol is already present in the package. Kyoto Common Lisp,
Lucid Common Lisp, and Xerox Common Lisp ignore SHADOW when the symbol is
already present in the package. It seems likely that we will find several
implementations in each camp.
SHADOW accepts strings in Symbolics Common Lisp.
Cost to implementors:
This should be a minor change to implementations that do not currently work this
Cost to users:
Technically this would be an incompatible change to implementations that do not
already behave as proposed, however it is difficult to conceive of a user
program that would require any conversion to cope with the change. Some users
might want to remove kludges that were only necessary to get around the former
misbehavior of SHADOW.
Cost of non-adoption:
Inconsistency among implementations and lack of a clear way to resolve the name
conflict mentioned in Rationale.
Consistency among implementations and fewer mysterious package problems.
The proposal would remove an unnecessary special case, thus simplifying the
The issue was raised by Dieter Kolb on the Common-Lisp mailing list.
It would be useless for SHADOW to fail to put a symbol that is already present
in the package onto the PACKAGE-SHADOWING-SYMBOLS list. Moon believes CLtL
intended to describe what is being proposed, but unfortunately used ambiguous
The cleanup committee endorses this proposal.