(define-compiler-macro): Handle empty arglist.

This commit is contained in:
Richard M. Stallman 1998-01-22 02:26:48 +00:00
parent 5428ee0299
commit 16c9c10f0f

View file

@ -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