Function: -splice
-splice is a byte-compiled function defined in dash.el.
Signature
(-splice PRED FUN LIST)
Documentation
Splice lists generated by FUN in place of items satisfying PRED in LIST.
Call PRED on each element of LIST. Whenever the result of PRED
is nil, leave that it as-is. Otherwise, call FUN on the same
it that satisfied PRED. The result should be a (possibly
empty) list of items to splice in place of it in LIST.
This can be useful as an alternative to the ,@ construct in a
``' structure, in case you need to splice several lists at
marked positions (for example with keywords).
This function's anaphoric counterpart is --splice.
See also: -splice-list, -insert-at.
Source Code
;; Defined in ~/.emacs.d/elpa/dash-20260221.1346/dash.el
(defun -splice (pred fun list)
"Splice lists generated by FUN in place of items satisfying PRED in LIST.
Call PRED on each element of LIST. Whenever the result of PRED
is nil, leave that `it' as-is. Otherwise, call FUN on the same
`it' that satisfied PRED. The result should be a (possibly
empty) list of items to splice in place of `it' in LIST.
This can be useful as an alternative to the `,@' construct in a
`\\=`' structure, in case you need to splice several lists at
marked positions (for example with keywords).
This function's anaphoric counterpart is `--splice'.
See also: `-splice-list', `-insert-at'."
(declare (important-return-value t))
(--splice (funcall pred it) (funcall fun it) list))