Function: -remove-at-indices

-remove-at-indices is a byte-compiled function defined in dash.el.

Signature

(-remove-at-indices INDICES LIST)

Documentation

Return LIST with its elements at INDICES removed.

That is, for each index I in INDICES, remove any element selected as (nth I LIST) from LIST.

This is a non-destructive operation: parts of LIST (but not necessarily all of it) are copied as needed to avoid destructively modifying it.

See also: -remove-at, -remove.

View in manual

Source Code

;; Defined in ~/.emacs.d/elpa/dash-20260221.1346/dash.el
(defun -remove-at-indices (indices list)
  "Return LIST with its elements at INDICES removed.
That is, for each index I in INDICES, remove any element selected
as (nth I LIST) from LIST.

This is a non-destructive operation: parts of LIST (but not
necessarily all of it) are copied as needed to avoid
destructively modifying it.

See also: `-remove-at', `-remove'."
  (declare (pure t) (side-effect-free t))
  (setq indices (--drop-while (< it 0) (-sort #'< indices)))
  (let ((i (pop indices)) res)
    (--each-while list i
      (pop list)
      (if (/= it-index i)
          (push it res)
        (while (and indices (= (car indices) i))
          (pop indices))
        (setq i (pop indices))))
    (nconc (nreverse res) list)))