[Openmcl-devel] macroexpand-all

Ron Garret ron at flownet.com
Tue Jun 24 08:37:14 PDT 2014


This is defined in CL to be a symtax error.  The head of a form can be a symbol or a lambda expression but not a macro.  You will notice that not only does this code not macroexpand, it won’t run either.

It is possible to tweak macroexpand-all and the CCL compiler so that both accept ((…) …) syntax.  I’ve attached the code to do the latter; the former is left as an exercise.

rg

On Jun 24, 2014, at 4:39 AM, Taoufik Dachraoui <dachraoui.taoufik at gmail.com> wrote:

> Hi
> 
> Is there a reason why macroexpand-all does not expand macros placed in the
> head of a list:
> 
> ? (defmacro g (x y) `(lambda (,x) ,y))
> G
> ? (macroexpand-all '((g x (+ x 1)) 3))
> ((G X (+ X 1)) 3)
> 
> What if it is the case what could be the issue?
> 
> -Taoufik
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://lists.clozure.com/mailman/listinfo/openmcl-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: combination-hook.lisp
Type: application/octet-stream
Size: 3036 bytes
Desc: not available
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20140624/a95c1125/attachment.obj>


More information about the Openmcl-devel mailing list