From: Pascal Costanza on
On 13/03/2010 18:27, Vassil Nikolov wrote:
>
> On Fri, 12 Mar 2010 14:27:06 -0500, Raymond Toy<toy.raymond(a)gmail.com> said:
>
>> If FOO is already a macro, what should (compile 'foo ...) do? The CLHS
>> says the macro function should be updated, but it's not clear to me what
>> it should be updated to.
>
> I (too) think that when
>
> (macro-function 'foo) => true
>
> then
>
> (compile 'foo '(lambda (f e) ...))
>
> does the same as
>
> (setf (macro-function 'foo) (compile nil '(lambda (f e) ...)))
>
> (though not much can portably be done with the E parameter).

A lot can be done portably with the environment parameter: You can pass
it as a second parameter to macroexpand, which already gives you a lot
of expressive power: Encode information as local macro definitions, and
access that information later on by macroexpanding the right macros.


Pascal

--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/