Function: byte-compile--list-with-n

byte-compile--list-with-n is a byte-compiled function defined in bytecomp.el.gz.

Signature

(byte-compile--list-with-n LIST N ELEM)

Documentation

Return LIST with its Nth element replaced by ELEM.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/bytecomp.el.gz
(defun byte-compile--list-with-n (list n elem)
  "Return LIST with its Nth element replaced by ELEM."
  (if (eq elem (nth n list))
      list
    (nconc (take n list)
           (list elem)
           (nthcdr (1+ n) list))))