chickadee » scheme » base » list-set!

list-set! list k objprocedure

It is an error if k is not a valid index of list.

The list-set! procedure stores obj in element k of list.

(let ((ls (list 'one 'two 'five!)))
  (list-set! ls 2 'three)
  ls)      
==>  (one two three)

(list-set! '(0 1 2) 1 "oops")  
==> error  ; constant list