From: Richard M. Stallman Date: Thu, 22 Jan 1998 02:26:48 +0000 (+0000) Subject: (define-compiler-macro): Handle empty arglist. X-Git-Tag: emacs-20.3~2324 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=16c9c10f0ffeabcd838ced945dbb9da819899345;p=emacs.git (define-compiler-macro): Handle empty arglist. --- diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 37d02b564cb..e6656a168b1 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2440,9 +2440,9 @@ compiler macros are expanded repeatedly until no further expansions are possible. Unlike regular macros, BODY can decide to \"punt\" and leave the original function call alone by declaring an initial `&whole foo' parameter and then returning foo." - (let ((p (if (listp args) args (list '&rest args))) (res nil)) + (let ((p args) (res nil)) (while (consp p) (cl-push (cl-pop p) res)) - (setq args (nreverse res)) (setcdr res (and p (list '&rest p)))) + (setq args (nconc (nreverse res) (and p (list '&rest p))))) (list 'eval-when '(compile load eval) (cl-transform-function-property func 'cl-compiler-macro