Function: cvs-partition

cvs-partition is a byte-compiled function defined in pcvs-util.el.gz.

Signature

(cvs-partition P L)

Documentation

Partition a list L into two lists based on predicate P.

The function returns a cons cell where the car contains elements of L for which P is true while the cdr contains the other elements. The ordering among elements is maintained.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/pcvs-util.el.gz
(defun cvs-partition (p l)
  "Partition a list L into two lists based on predicate P.
The function returns a `cons' cell where the `car' contains
elements of L for which P is true while the `cdr' contains
the other elements.  The ordering among elements is maintained."
  (let ((res (seq-group-by p l)))
    (cons (cdr (assq t res))
          (cdr (assq nil res)))))