Hi!
I am trying to write a macro, which dynamically binds the current package:
What do I miss?
I am trying to write a macro, which dynamically binds the current package:
(defmacro with-in-package (package-designator &body body)
`(let ((*package* (find-package ,package-designator)))
,@body))
which expands like this:
(macroexpand-1 '(with-in-package :sb-cltl2 (variable-information '*package*)))
(LET ((*PACKAGE* (FIND-PACKAGE :SB-CLTL2)))
(VARIABLE-INFORMATION '*PACKAGE*))
but evaluating it gives me an error [SBCL]:
(with-in-package :sb-cltl2 (variable-information '*package*))
->The function VARIABLE-INFORMATION is undefined.
but this works:
(sb-cltl2:variable-information '*package*)
:SPECIAL
NIL
((TYPE . PACKAGE))
The macro IN-PACKAGE does nothing else than setting the value of *PACKAGE* (http://www.lispworks.com/documentation/ ... in_pkg.htm).What do I miss?