chickadee » scheme » vector-set!

vector-set! vector k objprocedure

k must be a valid index of vector. Vector-set! stores obj in element k of vector. The value returned by vector-set! is unspecified.

(let ((vec (vector 0 '(2 2 2 2) "Anna")))
  (vector-set! vec 1 '("Sue" "Sue"))
  vec)      
                ===>  #(0 ("Sue" "Sue") "Anna")

(vector-set! '#(0 1 2) 1 "doe")  
                ===>  error  ; constant vector