Little help here please . I am trying to create this lisp macro which takes a list (of numbers) as input and returns the sum of those numbers. The code
(setf g (list 1 2 3 4))
(defmacro add-test(var)
`(+ ,@var))
(add-test g)
gives this error
The value G is not of type LIST.
[Condition of type TYPE-ERROR]
At the same time (add-test (1 2 3 4))
gives the correct result which is 10.
Can you please explain , why is it not working when variable is passed in to the function?
Other details -
Lispbox - SBCL
Ubuntu Linux
Thanks in advance