In the book "the little schemer" fourth edition, in chapter 8 there is the function "multirember & co", I did it in the "emacs lisp" lenguage , resulting in the following problem: Emacs: nesting exceeds `max-lisp-eval-depth '
(defun multirember&co (a lat col)
(cond ((null lat) (funcall col '() '()))
((eq (car lat) a) (multirember&co a
(cdr lat)
(lambda (newlat seen)
(funcall col newlat
(cons (car lat) seen)))))
(t (multirember&co a
(cdr lat)
(lambda (newlat seen)
(funcall col (cons (car lat) newlat)
seen))))))
(defun a-friend (x y)
(null y))
(multirember&co 'tuna '(tuna) 'a-friend)
Emacs: nesting exceeds max-lisp-eval-depth'
What is wrong with my code?
Thanks in advance