[Openmcl-devel] importing COMMON-LISP:NIL
ron at flownet.com
Sat Jan 23 00:03:18 PST 2010
The first argument to IMPORT can be either a symbol or a list of symbols. When you import NIL, it's treated as the empty list. To import the symbol NIL you have to make it unambiguous:
? (make-package :foo :use nil)
? (import '(nil) :foo)
On Jan 22, 2010, at 11:51 PM, Taoufik Dachraoui wrote:
> I am implementing a packaging tool and I found the following issue:
> > *package*
> #<Package "COMMON-LISP">
> > (defvar *x* 123)
> > (make-package 'temp :use nil)
> #<Package "TEMP">
> >(import 'x 'temp)
> >(import 'nil 'temp)
> > Error: Unbound variable: TEMP::NIL
> > While executing: CCL::TOPLEVEL-EVAL, in process listener(1).
> > Type :GO to continue, :POP to abort, :R for a list of available restarts.
> > If continued: Retry getting the value of TEMP::NIL.
> > Type :? for other options.
> 1 >
> Why I cannot import 'NIL into TEMP package?
> I am trying to implement a package system that can be used as follows:
> ;; in package APP
> @::use (common-lisp ccl utils)
> @::use will import all external symbols of COMMON-LISP into APP, then
> import all external symbols of CCL into APP, and finally
> import all external symbols of UTILS into APP
> All imports are done using shadowing-import.
> The issue is that it appears that when I use NIL in the package APP I receive
> the "Unbound variable NIL" error (I cannot import COMMON-LISP:NIL to APP).
> Thank you for your help and explanations.
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
More information about the Openmcl-devel