Max-lisp-eval-depth in multirember function -
in book "the little schemer" fourth edition, in chapter 8 there function "multirember & co", did in "emacs lisp" lenguage , resulting in 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 (cdr lat) (lambda (newlat seen) (funcall col newlat (cons (car lat) seen))))) (t (multirember&co (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 wrong code?
thanks in advance
Comments
Post a Comment