[LISPWORKS][Common Lisp HyperSpec (TM)] [Previous][Up][Next]



unintern symbol &optional package => generalized-boolean

Arguments and Values:

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.


 (setq temps-unpack (intern "UNPACK" (make-package 'temp))) =>  TEMP::UNPACK 
 (unintern temps-unpack 'temp) =>  T
 (find-symbol "UNPACK" 'temp) =>  NIL, NIL 
 temps-unpack =>  #:UNPACK 

Side Effects:

unintern changes the state of the package system in such a way that the consistency rules do not hold across the change.

Affected By:

Current state of the package system.

Exceptional Situations:

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.

See Also:

Section 11.1 (Package Concepts)

Notes: None.

The following X3J13 cleanup issue, not part of the specification, applies to this section:

[Starting Points][Contents][Index][Symbols][Glossary][Issues]
Copyright 1996-2005, LispWorks Ltd. All rights reserved.