help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

to big nest level of recursion


From: Anton V. Belyaev
Subject: to big nest level of recursion
Date: 20 Mar 2006 04:35:08 -0800
User-agent: G2/0.2

Hi! I wrote a simple function which fails on lists long enougth with
reason "(error "Lisp nesting exceeds `max-lisp-eval-depth'")". But the
function contains right recursion. Does Emacs LISP interpreter unwind
right recursion calls?

(defun contains (lst el)
  (if (null lst)
      nil
    (if (eq (car lst) el)
        t
      (contains (cdr lst) el)
      )
    )
  )

PS: Does Emacs built-in functions have an equivalent of my contains?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]