I appear to have found a bug in the macroexpansion mechanism.
I have a macro which will expand into a structure setting call.
I want to be able to say
(cca x a b)
and turn it into
(setf (state-f x) '(a b))
so I write the macro as:
(defmacro cca (str &rest args)
(,(intern (string-upcase (concatenate 'string "STATE-" (string str))))
which works beautifully (and has been for some time).
However if I feed it the arguments:
(cca x ((not a) foo) (a bar))
it fails during file loading, giving the message:
*** - SYSTEM::%EXPAND-FORM: (NOT DF) should be a lambda expression
but since cca is a macro the arguments should be passed unevaluated.
When the arguments arrive (via &rest args) they should still be
unevaluated since they are form substituted into a quoted list.
This SHOULD expand into something like
(setf (state-f *state*)
'(((not a) foo) (a bar)))
Did I miss something or is this a bug?
It expands properly in other lisps.
Get latest updates about Open Source Projects, Conferences and News.