Comment 0 for bug 1859841

Revision history for this message
Paul F. Dietz (paul-f-dietz) wrote :

* (defpackage :foo (:use) (:export "BAR"))
#<PACKAGE "FOO">
* (import 'foo:bar (find-package "KEYWORD"))
T
* 'foo:bar
FOO:BAR
* foo:bar

==> error, foo:bar is unbound

However:

Importing a symbol S into package P counts as "interning" it in that package (see glossary defn of intern, and the text for the unintern function.) And for the keyword package:

"Interning a symbol in the KEYWORD package has three automatic effects:

1. It causes the symbol to become bound to itself.
2. It causes the symbol to become an external symbol of the KEYWORD package.
3. It causes the symbol to become a constant variable."

So, foo:bar should have become a constant that evaluates to itself when it was imported into the keyword package.

There are subtle issues here with the different between a symbol being accessible in a package, being present in the package, and having the package as its home package. All three of these are distinct concepts.