unintern
symbol &optional package ⇒ generalized-boolean
symbol | a symbol. |
package | a package designator.
The default is the current package. |
generalized-boolean | a generalized boolean. |
unintern removes symbol from package. If symbol is present in package, it is removed from package and also from package’s shadowing symbols list if it is present there. If package is the home package for symbol, symbol is made to have no home package. Symbol may continue to be accessible in package by inheritance.
Use of unintern can result in a symbol
that has no
recorded home package,
but that in fact is accessible in some package.
Common Lisp does not check for this pathological case,
and such symbols
are always printed preceded by #:
.
unintern returns true if it removes symbol, and nil otherwise.
(in-package "COMMON-LISP-USER") ⇒ #<PACKAGE "COMMON-LISP-USER">
(setq temps-unpack (intern "UNPACK" (make-package 'temp))) ⇒ TEMP::UNPACK
(unintern temps-unpack 'temp) ⇒ T
(find-symbol "UNPACK" 'temp) ⇒ NIL, NIL
temps-unpack ⇒ #:UNPACK
unintern changes the state of the package system in such a way that the consistency rules do not hold across the change.
Current state of the package system.
Giving a shadowing symbol to unintern
can uncover a name conflict that had
previously been resolved by the shadowing. If package A uses packages
B and C, A contains a shadowing symbol x
, and B and C each contain external
symbols named x
, then removing the shadowing symbol x
from A will reveal a name
conflict between b:x
and c:x
if those two symbols are distinct.
In this case unintern will signal an error.