[plt-scheme] nested vectors

From: wooks (wookiz at hotmail.com)
Date: Sat Feb 14 16:28:15 EST 2009

working in Pretty Big

(define deposits (make-vector 17 (make-vector 17)))

Now I want to set the value of the index entry [0,11] in deposits to
39.

(vector-set! (vector-ref deposits 0) 11 39) gives a weird result.
Please explain the result and correct me.

#(#(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0)
  #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0)
  #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0)
  #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0)
  #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0)
  #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0)
  #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0)
  #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0)
  #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0)
  #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0)
  #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0)
  #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0)
  #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0)
  #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0)
  #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0)
  #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0)
  #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0))


Posted on the users mailing list.