Packages are uninterned wether you prefix their names with #: or not

Bug #1973580 reported by Philippe de Rochambeau
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Invalid
Undecided
Unassigned

Bug Description

Hello,
according to https://stackoverflow.com/questions/7894548/why-are-uninterned-symbols-used-for-package-names-and-exports-in-common-lisp/7894917#7894917, prefixing package names with #: uninterns them. In SBCL 2.2.4 on MacOSX 12.3.1, packages are uninterned whether you prefix #: their names with #: or not:

* *package*
#<PACKAGE "COMMON-LISP-USER">
* (defpackage bar)
#<PACKAGE "BAR">
* (find-symbol "bar")
NIL
NIL
* *package*
#<PACKAGE "COMMON-LISP-USER">
* (defpackage #:bar)
#<PACKAGE "BAR">
* (find-symbol "bar")
NIL
NIL

description: updated
Revision history for this message
Christophe Rhodes (csr21-cantab) wrote :

I think this report confuses a couple of things.

Firstly, it's not the package itself that is interned or not, but the symbol that is used as a designator for the package.

Secondly, the default state of the reader when reading a symbol is to find a symbol with the name that is the uppercase version of the textual name. So not only does

  (defpackage bar)

define a package called "BAR", it has done so via interning a symbol whose name is "BAR" (not "bar").

Here is a transcript which hopefully illustrates the difference between using interned and uninterned symbols to name a package:

* (defpackage foo)
#<PACKAGE "FOO">
* (find-symbol "FOO")
FOO
:INTERNAL
* (defpackage #:bar)
#<PACKAGE "BAR">
* (find-symbol "BAR")
NIL
NIL

Changed in sbcl:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.