I want to implement filter
function that would filter a list based on a condition
(defun filter (func xs)
(mapcan
(lambda (x)
(when (func x) (list x))) xs ))
but I get an error:
*** - EVAL: undefined function FUNC
I thought that lambda should see func
. How to pass func
to lambda
correctly?
I use CLISP.