shadow
shadow symbol-names &optional package → t
symbol-names—a designator for a list of string designators.
package—a package designator. The default is the current package.
shadow assures that symbols with names given by symbol-names are present as \term{internal symbols} ofin the package.
11.2.0 34Specifically, package is searched for symbols with the names supplied by symbol-names. For each such name, if a corresponding symbol oops! --sjl 7 Mar 92 is \term{present} in \param{package} (directly, not by inheritance),is not present in package (directly, not by inheritance), then a corresponding symbol is created with that name, and inserted into package as an internal symbol. The corresponding symbol, whether pre-existing or newly created, is then added, if not already present, to the shadowing symbols list of package.
(package-shadowing-symbols (make-package 'temp)) → NIL (find-symbol "CAR" 'temp) → CAR, :INHERITED (shadow 'car 'temp) → T (find-symbol "CAR" 'temp) → TEMP::CAR, :INTERNAL (package-shadowing-symbols 'temp) → (TEMP::CAR)
!!! What is this "should not error" biz, and what does USE-PACKAGE return...?
(make-package 'test-1) → #<PACKAGE "TEST-1">
(intern "TEST" (find-package 'test-1)) → TEST-1::TEST, NIL
(shadow 'test-1::test (find-package 'test-1)) → T
(shadow 'TEST (find-package 'test-1)) → T
(assert (not (null (member 'test-1::test (package-shadowing-symbols
(find-package 'test-1))))))
(make-package 'test-2) → #<PACKAGE "TEST-2">
(intern "TEST" (find-package 'test-2)) → TEST-2::TEST, NIL
(export 'test-2::test (find-package 'test-2)) → T
(use-package 'test-2 (find-package 'test-1)) ;should not error
11.2.0 35shadow changes the state of the package system in such a way that the package consistency rules do not hold across the change.
Current state of the package system.
None.
package-shadowing-symbols, ?? Ref ?? -kmp 22-Oct-91
``Character Reader'',Section 11.1 (Package Concepts)
11.0.0 52 \funref{shadow} does name-conflict checking to the extent that it checks whether a distinct existing \term{symbol} with the same name as one of \param{symbol-names} is \term{accessible} and, if so, whether it is directly \term{present} in \param{package} or inherited. In the latter case, a new \term{symbol} is created to shadow it.
If a symbol with a name in symbol-names already exists in package, but by inheritance, the inherited symbol becomes shadowed3 by a newly created internal symbol.