Hi there,
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
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
(defmacro gen-name-broken (name)
(let ((body (intern "BODY")))
`(defmacro ,name (&body body)
(let ((result (progn ,@body)))
result))))
Of course I can use eval like this, but I want to avoid it
(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))))