* lisp/emacs-lisp/byte-opt.el (byte-optimize-let-form): Move warnings...
* lisp/emacs-lisp/cconv.el (cconv-convert): ...here, which is an
overall better place (closer to the front-end).
(let-vars nil))
(dolist (binding (car form))
(let (name expr)
- (cond ((consp binding)
- (setq name (car binding))
- (unless (symbolp name)
- (byte-compile-warn "let-bind nonvariable: `%S'" name))
- (setq expr (byte-optimize-form (cadr binding) nil)))
- ((symbolp binding)
- (setq name binding))
- (t (byte-compile-warn "malformed let binding: `%S'" binding)))
- (let* (
- (value (and (byte-optimize--substitutable-p expr)
+ (if (atom binding)
+ (setq name binding)
+ (setq name (car binding))
+ (setq expr (byte-optimize-form (cadr binding) nil)))
+ (let* ((value (and (byte-optimize--substitutable-p expr)
(list expr)))
(lexical (not (or (and (symbolp name)
(special-variable-p name))
letsym binder))
(setq value (cadr binder))
(car binder)))
+ (_ (cond
+ ((not (symbolp var))
+ (byte-compile-warn "attempt to let-bind nonvariable `%S'"
+ var))
+ ((or (booleanp var) (keywordp var))
+ (byte-compile-warn "attempt to let-bind constant `%S'"
+ var))))
(new-val
(pcase (cconv--var-classification binder form)
;; Check if var is a candidate for lambda lifting.