Function: byte-compile-trueconstp

byte-compile-trueconstp is a byte-compiled function defined in byte-opt.el.gz.

Signature

(byte-compile-trueconstp FORM)

Documentation

Return non-nil if FORM always evaluates to a non-nil value.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/byte-opt.el.gz
;; some source-level optimizers
;;
;; when writing optimizers, be VERY careful that the optimizer returns
;; something not EQ to its argument if and ONLY if it has made a change.
;; This implies that you cannot simply destructively modify the list;
;; you must return something not EQ to it if you make an optimization.
;;
;; It is now safe to optimize code such that it introduces new bindings.

(defsubst byte-compile-trueconstp (form)
  "Return non-nil if FORM always evaluates to a non-nil value."
  (while (eq (car-safe form) 'progn)
    (setq form (car (last (cdr form)))))
  (cond ((consp form)
         (pcase (car form)
           ('quote (cadr form))
           ;; Can't use recursion in a defsubst.
           ;; (`progn (byte-compile-trueconstp (car (last (cdr form)))))
           ))
        ((not (symbolp form)))
        ((eq form t))
        ((keywordp form))))