I'm not very deep into CL yet and struggling with this problem:
The following macro won't compile because ,@body is not a list (sbcl)
However if try a (listp ,body) it will return true. Can you please help me to understand this?
(the code is reduced beyond usefulness to show the problem)
TIA
murph
Code: Select all
(defmacro gen-name-broken (name)
(let ((body (intern "BODY")))
`(defmacro ,name (&body body)
(let ((result (progn ,@body)))
result))))
Code: Select all
(defmacro gen-name-eval (name)
(let ((body (intern "BODY")))
`(defmacro ,name (&body body)
(warn "is-list? ~S~%" (listp ,body))
(let ((result (apply #'eval ,body)))
result))))