unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Anton V. Belyaev" <anton.belyaev@gmail.com>
Subject: to big nest level of recursion
Date: 20 Mar 2006 04:35:08 -0800	[thread overview]
Message-ID: <1142858108.336902.127520@j33g2000cwa.googlegroups.com> (raw)

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	other threads:[~2006-03-20 12:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-20 12:35 Anton V. Belyaev [this message]
2006-03-20 12:45 ` to big nest level of recursion Hans-Christoph Wirth
2006-03-20 12:51 ` David Kastrup
2006-03-20 13:52 ` Pascal Bourguignon
2006-03-20 15:56   ` Anton V. Belyaev
2006-03-21 17:09     ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2006-03-21 21:31 David Reitter
     [not found] <mailman.21.1142976703.14011.help-gnu-emacs@gnu.org>
2006-03-25 10:30 ` Alan Mackenzie
2006-03-25 11:46   ` David Kastrup
2006-04-04 13:36     ` david.reitter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1142858108.336902.127520@j33g2000cwa.googlegroups.com \
    --to=anton.belyaev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).