DELETE-PACKAGE or MAKE-PACKAGE do not work correctly with LOAD in fasls
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Charles |
Bug Description
The following bug was reported on sbcl-bugs (unmangled here):
Consider the sequence of operations defined by FOO:
(in-package :cl-user)
(defun foo ()
(let ((package (find-package :bar)))
(if package
(progn
(print (list 'package-exists package))
(describe package)
(print (list 'deleting-package package)) (delete-package (find-package :bar))
(print (list 'package-
(progn
(print (list 'package-
(print (list 'creating-
(make-package "BAR" :use ())
(let ((package (find-package :bar)))
(print (list 'package-
(describe package)
(print (list 'interning-
(eval (read-from-string
"(progn (defun bar::a ()) (defun bar::b ()))"))))
And a file tmp.lisp with only the single line:
(foo)
Then, consider the following sequence of operations at the REPL:
CL-USER> (if (find-package "BAR") (delete-package "BAR"))
T
CL-USER> (compile-file "~/ram-
=snip=
CL-USER> (load "~/ram-
(PACKAGE-
(CREATING-
(PACKAGE-
#<PACKAGE "BAR">
[package] 0 internal symbols.
(INTERNING-
T
CL-USER> (load "~/ram-
(PACKAGE-EXISTS #<PACKAGE "BAR">)
#<PACKAGE "BAR">
[package] 2 internal symbols.
(DELETING-PACKAGE #<PACKAGE "BAR">)
(PACKAGE-
(CREATING-
(PACKAGE-
#<PACKAGE "BAR">
[package] 2 internal symbols.
(INTERNING-
WARNING: redefining BAR::A in DEFUN
WARNING: redefining BAR::B in DEFUN
T
The issue is in what is happening in the last (LOAD "~/ram-
CL-USER> (load "~/ram-
(PACKAGE-EXISTS #<PACKAGE "BAR">)
#<PACKAGE "BAR">
[package] 2 internal symbols.
(DELETING-PACKAGE #<PACKAGE "BAR">)
(PACKAGE-
(CREATING-
(PACKAGE-
#<PACKAGE "BAR">
[package] 0 internal symbols.
(INTERNING-
T
I'm able to reproduce this with both SBCL 2.2.5 and 2.2.6.
- Shubhamkar
Changed in sbcl: | |
status: | New → Confirmed |
assignee: | nobody → Charles (karlosz) |
Changed in sbcl: | |
status: | Confirmed → Fix Committed |
Changed in sbcl: | |
status: | Fix Committed → Confirmed |
Changed in sbcl: | |
status: | Confirmed → Fix Committed |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |