[Openmcl-devel] OpenMCL 1.0, compilation units and macroexpansion bug?

Vyacheslav Akhmechet coffeemug at gmail.com
Sat Nov 10 16:01:00 PST 2007


Hello,

I'm running OpenMCL 1.0 on PPC. I'm having trouble with the following
test snippet:

(defmacro foo (a)
  `(+ ,a ,a))

(defmacro bar ()
  `(print ',(macroexpand-1 '(foo 5))))

(defun baz ()
  (bar))

When run from the REPL, calling (baz) returns (+ 5 5), as expected.
However, when the definitions are placed into a file OpenMCL returns
(foo 5), while all other implementations I've tested on return (+ 5
5). It seems that OpenMCL doesn't add the macro FOO to the null
environment when MACROEXPAND-1 is called manually. I tried passing
&environment explicitly, but got the same result.

The spec for DEFMACRO says: "If a defmacro form appears as a top level
form, the compiler must store the macro definition at compile time, so
that occurrences of the macro later on in the file can be expanded
correctly." Is this a bug or am I misunderstanding the spec?

Regards,
Slava Akhmechet



More information about the Openmcl-devel mailing list