In article <············@senator-bedfellow.MIT.EDU> ······@athena.mit.edu (Volkan C Kubali) writes:
> Could anyone help me with this? How can I modify a macro inside
>another macro? Here is the example
>
>
>(defmacro MY-VALUE (@body form1)
>;;;;; modify the macro CHOOSER
> (RETURN-VALUE ...) ;;; Yet another macro that makes use of CHOOSER
>;;;;; unmodify CHOOSER
>)
It's not clear what you're trying to do here. Is RETURN-VALUE a function
called in the definition of MY-VALUE or is it part of the exapansion of
MY-VALUE? If it's part of the expansion, then nothing that's done only
during the dynamic extent of the execution of the MY-VALUE macro can have
an effect, because RETURN-VALUE won't be expanded until after MY-VALUE
returns.
If RETURN-VALUE is called during the execution of MY-VALUE, then it's
implementation-dependent. Some implementations will first compile or fully
macroexpand the body of MY-VALUE before executing it, so redefining CHOOSER
during the execution won't have any effect.
I suspect you're trying to do something that can be done more easily
another way. If you explain your higher-level goal, perhaps someone can
come up with a solution.
--
Barry Margolin
System Manager, Thinking Machines Corp.
······@think.com {uunet,harvard}!think!barmar