Function: cl-subst-if

cl-subst-if is an autoloaded and byte-compiled function defined in cl-seq.el.gz.

Signature

(cl-subst-if NEW PREDICATE TREE [KEYWORD VALUE]...)

Documentation

Substitute NEW for elements matching PREDICATE in TREE (non-destructively).

Return a copy of TREE with all matching elements replaced by NEW.

Keywords supported: :key

Aliases

subst-if (obsolete since 27.1)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/cl-seq.el.gz
;;;###autoload
(defun cl-subst-if (cl-new cl-pred cl-tree &rest cl-keys)
  "Substitute NEW for elements matching PREDICATE in TREE (non-destructively).
Return a copy of TREE with all matching elements replaced by NEW.
\nKeywords supported:  :key
\n(fn NEW PREDICATE TREE [KEYWORD VALUE]...)"
  (apply 'cl-sublis (list (cons nil cl-new)) cl-tree :if cl-pred cl-keys))