Subject: Re: how can I do this with macros?
From: (Rob Warnock)
Date: Mon, 18 Aug 2003 11:26:14 -0500
Newsgroups: comp.lang.lisp
Message-ID: <>
Wade Humeniuk <wade@nospam.nowhere> wrote:
| "Lowell" <> 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)
       `(,',macro ,@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		<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607