Function: -update-at

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

Signature

(-update-at N FUNC LIST)

Documentation

Use FUNC to update the Nth element of LIST.

Return a copy of LIST where the Nth element is replaced with the result of calling FUNC on it.

See also: -map-when

View in manual

Source Code

;; Defined in ~/.emacs.d/elpa/dash-20260221.1346/dash.el
(defun -update-at (n func list)
  "Use FUNC to update the Nth element of LIST.
Return a copy of LIST where the Nth element is replaced with the
result of calling FUNC on it.

See also: `-map-when'"
  (declare (important-return-value t))
  (let ((split-list (-split-at n list)))
    (nconc (car split-list)
           (cons (funcall func (car (cadr split-list)))
                 (cdr (cadr split-list))))))