From: Richard M. Stallman Date: Sat, 16 Jul 2005 18:02:07 +0000 (+0000) Subject: (byte-compile-and-recursion): New function. X-Git-Tag: emacs-pretest-22.0.90~8092 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8877fa6fb302a09353e675dea42b40e85e48eeb2;p=emacs.git (byte-compile-and-recursion): New function. (byte-compile-and): Use byte-compile-and-recursion. --- diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 36ce227df91..15549ea039f 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3448,12 +3448,19 @@ warnings during execution of BODY." (args (cdr form))) (if (null args) (byte-compile-form-do-effect t) - (while (cdr args) - (byte-compile-form (car args)) + (byte-compile-and-recursion args failtag)))) + +;; Handle compilation of a multi-argument `and' call. +;; We use tail recursion so we can use byte-compile-maybe-guarded. +(defun byte-compile-and-recursion (rest failtag) + (if (cdr rest) + (progn + (byte-compile-form (car rest)) (byte-compile-goto-if nil for-effect failtag) - (setq args (cdr args))) - (byte-compile-form-do-effect (car args)) - (byte-compile-out-tag failtag)))) + (byte-compile-maybe-guarded (car rest) + (byte-compile-and-recursion (cdr rest) failtag))) + (byte-compile-form-do-effect (car rest)) + (byte-compile-out-tag failtag))) (defun byte-compile-or (form) (let ((wintag (byte-compile-make-tag))