From: Gary Curtis
Subject: Macro Expansion
Date: 
Message-ID: <6n8s17$mkn$1@tnm.stsci.edu>
Hi,

I have a problem with macro expansion. I want to write
something along the lines of:

(defmacro macro-test ()
  `(identity ',(gensym)))

(defun use-macro ()
  (macro-test))

(defun test ()
  (eq (use-macro) (use-macro)))

When this is compiled the macro is expanded and the gensym is
evaluated leading to the same symbol used in subsequent calls
and #'test returns T. When the file is loaded, however, the
macro is not expanded until run time. In this case #'gensym is
called twice leading to #'test returning NIL.

Is there any way to have the macro expanded at load time?

Thanks,
Gary.
--