Function: pcase--if

pcase--if is a byte-compiled function defined in pcase.el.gz.

Signature

(pcase--if TEST THEN ELSE)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/pcase.el.gz
;; Try to use `cond' rather than a sequence of `if's, so as to reduce
;; the depth of the generated tree.
(defun pcase--if (test then else)
  (cond
   ((eq else :pcase--dontcare) `(progn (ignore ,test) ,then))
   ;; This happens very rarely.  Known case:
   ;;     (pcase EXP ((and 1 pcase--dontcare) FOO))
   ((eq then :pcase--dontcare) `(progn (ignore ,test) ,else))
   (t (macroexp-if test then else))))