Search code examples
lispcommon-lispslimesbcl

How to make Lisp forget about previously exported symbols?


This is how I export symbols :bar and :baz from package foo:

(in-package :cl-user)
(defpackage foo
   (:use :cl)
   (:export :bar :baz))
(in-package :foo)

When I remove :baz from the list of exported symbols SBCL complains and the compilation fails.

 warning: 
     FOO also exports the following symbols:
       (FOO:BAZ)

How can I make SBCL make forget about :baz without reloading SLIME?


Solution

  • SBCL:

    * (apropos "unexport")
    
    UNEXPORT (fbound)
    
    
    * (documentation 'unexport 'function)
    
    "Makes SYMBOLS no longer exported from PACKAGE."
    
    
    * (apropos "unintern")
    
    UNINTERN (fbound)
    
    
    * (documentation 'unintern 'function)
    
    "Makes SYMBOL no longer present in PACKAGE. If SYMBOL was present then T is
    returned, otherwise NIL. If PACKAGE is SYMBOL's home package, then it is made
    uninterned."