Function: comp--cstrs-homogeneous

comp--cstrs-homogeneous is a byte-compiled function defined in comp-cstr.el.gz.

Signature

(comp--cstrs-homogeneous CSTRS)

Documentation

Check if constraints CSTRS are all homogeneously negated or non-negated.

Return pos if they are all positive, neg if they are all negated or nil otherwise.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/comp-cstr.el.gz
(defun comp--cstrs-homogeneous (cstrs)
  "Check if constraints CSTRS are all homogeneously negated or non-negated.
Return `pos' if they are all positive, `neg' if they are all
negated or nil otherwise."
  (cl-loop
   for cstr in cstrs
   unless (comp-cstr-neg cstr)
     count t into n-pos
   else
     count t into n-neg
   finally
   (cond
    ((zerop n-neg) (cl-return 'pos))
    ((zerop n-pos) (cl-return 'neg)))))