"Learning" Lisp for school but don't feel I'm learning correctly. I'm trying to write a function to add all the numbers in a list that is composed of lists, numbers, and strings. I'm ignoring the strings and entering the lists. I'm getting quite lost with all the parenthesis...
Im receiving the error Illegal argument in functor position 0
(defun add-all (L)
(cond
(
(null L)
(0)
)
(
(listp (car L) )
(+ (add-all (car L)) (add-all (cdr L)) )
)
(
(stringp (car L) )
(+ (add-all (cdr L)) )
)
(
t
(+ (car L) (add-all (cdr L)) )
)
)
)