I try to do this directly to the interpret:
(setf example (coerce "blablabla" 'list))
and works fine. Infact (car example)
returns #\b
but if I try this:
(defun myfun (string) ( (setf example (coerce string 'list))))
(myfun "blablabla")
I don't get the same!
How can I fix?
Remove the extra parentheses around the
setf
in thedefun
:Now you'll get the same. Note that the outer parenthesis have meaning. In Lisp, either it is quoted, or must be a function call. If the first element is, as in this case, a list, it cannot be a function to call, hence the error.