change-at-index   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/runtime/scheme.xtm

Implementation

; change list item at index
(define change-at-index
   (lambda (k lst obj)
      (cond ((or (null? lst)
     (< k 0))
       lst)
      ((>= k (length lst))
       lst)
      (else (set-car! (cl:nthcdr k lst) obj)
      lst))))


Back to Index