[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: in-package problems
- To: firstname.lastname@example.org (Macintosh Common Lisp)
- Subject: Re: in-package problems
- From: email@example.com (Guillaume Cartier)
- Date: Wed, 8 Jan 92 14:40:38 -0500
> I am having some problems with the IN-PACKAGE
>macro in MCL2.0b1. IN the old version (Mac. Allegro
>1.3.2) is is simple to use IN-PACKAGE with a variable
>name, however this appears no longer to be possible.
>(setf *name* Rpackage-nameS)
>(make-package *name*) ;; this bit works fine
>;;;this then returns
>> Error: There is no package named "*NAME*" .
>> While executing: CCL::SET-PACKAGE
>Am I doing something silly, if not how can I get around
>this problem and pass package names as variable?
>Thanks for any help
In CLtL2, an incompatible change was done to IN-PACKAGE. It was a function
and is now a macro that DOES NOT evaluate the argument passed to it.
The simple way to solve your problem is (EVAL `(IN-PACKAGE ,*NAME*))
but is not very elegant.
The other solution is to do the work of the IN-PACKAGE macro yourself,
i.e. something like
(LET ((PCKG (FIND-PACKAGE *NAME*)))
;; the test is important, as setting *PACKAGE* to nil will crash MCL
(SETF *PACKAGE* PCKG)))
LACIM, Universite du Quebec a Montreal.
Bureau: (514) 987-4290