Blake McBride
8/27/2015 4:11:00 PM
SHADOW did the trick. Thanks!!
Blake
On 08/27/2015 09:20 AM, Kaz Kylheku wrote:
> On 2015-08-27, Blake McBride <blake1024@gmail.com> wrote:
>> Hi,
>>
>> I am trying to re-define defun while still being able to use the old
>> version. For example, presuming I am in the common-lisp-user package, I
>> am doing:
>>
>> (defmacro defun (&rest args)
>> `(progn
>> (common-lisp:defun ,(car args)
>
> If this doesn't work, it must be because the unqualified symbol defun
> is actually common-lisp:defun.
>
> This is the case in common-lisp-user by default, because it is set up
> to use the common-lisp package; all external symbols in common-lisp
> are *visible* in common-lisp-user.
>
> There is no common-lisp-user:defun.
>
> We can ensure that a symbol called "DEFUN" is actually present in
> common-lisp-user, and also that it defeats the one that is otherwise
> visible from common-lisp:
>
> COMMON-LISP-USER> (shadow 'defun)
>
> Done! Now defun is common-lisp-user::defun, and so you can do:
>
> COMMON-LISP-USER> (defmacro defun (...) `(cl:defun ...))
>
> The shadow function ensures that the symbol is present in the package (if not
> already) and adds it to the shadowing list: the list of symbols which
> automatically win visibility clashes arising from the use of use-package.
> That is to say, common-lisp-user continues to use common-lisp,
> but because it contains a shadowing symbol defun, common-lisp:defun is
> not visible any more through common-lisp-user; rather, the shadowing symbol is.
>