Thanks for your response; I take it there is no exceedingly simple
explanation for why CMUCL does things the way it does.

> (3) Use MACROEXPAND-1 to debug macros.

But that does not (seem to) work well in at least some circumstances:

- with MACROLET,

,----
| CL-USER> (macrolet ((baz () `1)) (macroexpand '(baz)))
| (BAZ)
| NIL
`----

- with certain arguments such as, e.g., gensyms,

,----
| CL-USER> (defmacro jkl (a b) (if (eq a b) 1 2 ))
| JKL
| CL-USER> (defmacro use-jkl () (with-gensyms (a) `(let () (jkl ,a ,a))))
| USE-JKL
| CL-USER> (use-jkl)
| 1
| CL-USER> (macroexpand '(use-jkl))
| (LET ()
|   (JKL #:A5644 #:A5644))
| T
| CL-USER> (LET ()
|            (JKL #:A5644 #:A5644))
| 2
| CL-USER> 
`----

- and presumably with uninterned macro names (though I don't think I
  ever used those except with MACROLET).

It is precisely in the former two cases that I have used (PRINT
`(...)) instead of MACROEXPAND.

Thanks again,

Albert.


Reply via email to