[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Package Question (Making NIL external).
;Given this package setup:
> (in-package :user)
> (make-package :my-cl :use '(:cl))
#<Package MY-CL 41305541>
;In the package MY-CL I shadow various symbols and add some new ones. In
;order to allow users to "USE" my package and have access to the external
;common-lisp package symbols, my shadowed symbols and my other
;miscellaneous symbols I have been doing this:
(do-external-symbols (sym :cl) (export sym :my-cl))
> (export <my-new-symbols-list> :my-cl)
; Thus I want a user to be able to just "USE" my package and no others.
; However, if I make a new package and "USE" MY-CL like this:
(make-package :my-cl-user :use '(:my-cl))
#<Package MY-CL-USER 41305541>
;I get every symbol I'm supposed to EXCEPT FOR NIL.
MY-CL-USER::NIL is in the MY-CL-USER package.
> (symbol-value 'my-cl-user::nil)
Trap: The variable MY-CL-USER::NIL is unbound.
> (intern "NIL" :my-cl-user)
;When I look at the symbol in the MY-CL package via intern it reveals
;that it is not external:
(intern "NIL" :my-cl)
> (symbol-value 'my-cl::nil)
;Attempts to make NIL external via export fail:
(export (intern "NIL" :my-cl) :my-cl)
> (intern "NIL" :my-cl)
So, I guess my question is: "How can I make NIL an external symbol in my
own package?" I assume it can be done since I can create a package
which "USES" the SCL package and I do get NIL. What am I doing wrong?