Mercurial > emacs
changeset 64385:3b6714810ffc
(byte-compile-and-recursion): New function.
(byte-compile-and): Use byte-compile-and-recursion.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 16 Jul 2005 18:02:07 +0000 |
parents | 54d5227ff298 |
children | d24c0f192f20 |
files | lisp/emacs-lisp/bytecomp.el |
diffstat | 1 files changed, 12 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/emacs-lisp/bytecomp.el Sat Jul 16 17:42:49 2005 +0000 +++ b/lisp/emacs-lisp/bytecomp.el Sat Jul 16 18:02:07 2005 +0000 @@ -3448,12 +3448,19 @@ (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))