From: Douglas K. <do...@go...> - 2014-03-08 14:00:46
|
The correctable error that is signaled from MAKE-PACKAGE should probably perform a delete-package if you continue from it, not just pretend everything is AOK. I would infer that from the use of the word "Clobber" in the error message. Though one could claim that that means only clobber its entry in the package graph, not its contents, which is what effectively happens. Is that deliberate, in that we chose "clobber" to mean: 'here's how you can, by design, create several packages with the same name'? COMMON-LISP-USER> (defvar *p* (make-package "TEST")) *P* COMMON-LISP-USER> (defvar *s* (intern "SOMESYM" *p*)) *S* COMMON-LISP-USER> (export *s* 'test) T COMMON-LISP-USER> (make-package "TEST-USER" :use '("TEST")) #<PACKAGE "TEST-USER"> COMMON-LISP-USER> (make-package "TEST") debugger invoked on a SB-KERNEL:SIMPLE-PACKAGE-ERROR in thread #<THREAD "main thread" RUNNING {11DB1AC9}>: A package named "TEST" already exists restarts (invokable by number or by possibly-abbreviated name): 0: [CONTINUE] Clobber existing package. 1: [ABORT ] Exit debugger, returning to top level. (MAKE-PACKAGE "TEST" :USE NIL :NICKNAMES NIL :INTERNAL-SYMBOLS 10 :EXTERNAL-SYMBOLS 10) 0] 0 #<PACKAGE "TEST"> COMMON-LISP-USER> (find-symbol "SOMESYM" "TEST-USER") TEST:SOMESYM :INHERITED and (symbol-package (find-symbol "SOMESYM" "TEST-USER")) => #<PACKAGE "TEST"> (eq (symbol-package (find-symbol "SOMESYM" "TEST-USER")) (find-package "TEST")) => NIL |