In article <···············@osf1.gmu.edu>, "Myriam Abramson"
<········@osf1.gmu.edu> wrote:
> Hi!
> I'm back into lisp after being away for more than 2 years, yeah!
Welcome back.
> Anyway, enough excuses, I want to write a macro such as
>(defmacro defcom (fn args &rest rules)
> `(defun ,fn (&key ,@args &allow-other-keys)
> (with-appropriate-vars (var ',fn)
> ,@rules)))
> (defmacro with-appropriate-vars ((var fn) &body body)
> `(let ((,var '(0 0 0 0)))
> (when (appropriate-p ,fn)
> (setf ,var (set-var)))
> ,@body))
> When expanded, the function created does not have with-appropriate-vars
> expanded to the let clause so I'm obviously doing something wrong.
> What's the best way to write defcom? TIA
So what's the problem? MACROEXPAND only recursively macroexpands the car
of its argument, not all the interior clauses. Does the resulting
function not "work?"
Tim