(defun union (a b &key (test #'eq)) (cond ((null a) b) ((member (car a) b :test test) (union (cdr a) b :test test)) (t (cons (car a) (union (cdr a) b :test test))))) (defun intersection (a b &key (test #'eq)) (cond ((null a) nil) ((member (car a) b :test test) (cons (car a) (intersection (cdr a) b :test test))) (t (intersection (cdr a) b :test test))))