I can't use at all lambda function, because I get this error: Argument to apply/funcall is not a function: (LAMBDA (E) (COUNT_ATOMS M E)).
And the code is:
> (DEFUN count_atoms (m l)
> (COND ((ATOM l) (COND ((EQUAL m l) 1)
> (t 0)))
> (t (APPLY '+
> (MAPCAR '(LAMBDA (e) (count_atoms m e))
> l)))))
For
(count_atoms 3 '( (3 3) 3 (4 4) 5))
it should print 3.
What is wrong here?