; is a number divisible by 7? (defun divis7 (x) (eq (rem x 7) 0)) (defun filter (f L) (cond ((null L) nil) ((funcall f (car L)) (filter f (cdr L))) (t (cons (car L) (filter f (cdr L)))))) (filter #'divis7 '(2 7 1 14 21 3 6 35 777 778)) (2 1 3 6 778) (filter (lambda (x) (zerop (rem x 3))) '(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16)) (1 2 4 5 7 8 10 11 13 14 16)