I am trying to find the even maximums from a list in Lisp.
(defun m(L)
(cond
((numberp L) L)
((atom L) most-negative-fixnum)
(T (apply #'max (mapcar #'m L)))
)
)
This "m" works for the maximum of a list(of lists) and the next to find the even maximums:
(defun _list (L)
(mapcan #'((lambda (v)
(cond
((= 0 (mod v 2)) (list v))
(t nil)
)
) (m L)
)
L
)
)
I get the error ((LAMBDA (V) (COND ((= 0 (MOD V 2)) (LIST V)) (T NIL))) (M L)) should be a lambda expression
And I can't figure out why. I played with the paranthesis a lot but still nothing. Can somebody give me some better ideas why this happens?