0

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

Rovaceni23
  • 19
  • 4
  • This doesn't answer what's wrong with your code, but contains more discussion about the function: [Explain the continuation example on p.137 of The Little Schemer](https://stackoverflow.com/q/7004636/1281433). Perhaps it will help you. – Joshua Taylor Jul 26 '17 at 13:22
  • 1
    One thing obviously wrong is the space between `null` and `?`. If you fix the spaces and indentation, you might find other errors. – sds Jul 26 '17 at 13:26
  • 1
    Possible duplicate of [Emacs: nesting exceeds \`max-lisp-eval-depth'](https://stackoverflow.com/questions/11807128/emacs-nesting-exceeds-max-lisp-eval-depth) – Sylwester Jul 26 '17 at 22:49

0 Answers0