Wade Humeniuk <email@example.com> wrote:
| "Lowell" <firstname.lastname@example.org> wrote:
| > I created a (simple) function called make-alias which creates a function
| > with the same semantics as another function. It which works like this:
| > How can I do this?
| (defmacro macro-alias (alias macro)
| (let ((body (gensym)))
| `(defmacro ,alias (&body ,body)
| `(,',macro ,@,body))))
Is the GENSYM really necessary in this case, given that the *only* thing
the aliased macro does is expand into a single call of the original?
Wouldn't this be good enough?
(defmacro macro-alias (alias macro)
`(defmacro ,alias (&body body)
I understand how in general you want to be careful about variable capture,
but in this case won't the variable BODY have disappeared before the aliased
macro ever expands? And thus there won't be any BODY to capture?
What am I missing?
Rob Warnock, PP-ASEL-IA <email@example.com>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607