* lisp/emacs-lisp/byte-opt.el (byte-optimize-while): Move check...
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): ...here.
(list 'progn condition nil)))))
(defun byte-optimize-while (form)
- ;; FIXME: This check does not belong here, move!
- (when (< (length form) 2)
- (byte-compile-warn-x form "too few arguments for `while'"))
(let ((condition (nth 1 form)))
(if (byte-compile-nilconstp condition)
condition
(macroexp--all-forms body))
(cdr form))
form)))
+ (`(while)
+ (macroexp-warn-and-return
+ "missing `while' condition"
+ `(signal 'wrong-number-of-arguments '(while 0))
+ nil 'compile-only form))
(`(setq ,(and var (pred symbolp)
(pred (not booleanp)) (pred (not keywordp)))
,expr)