[plt-scheme] nested vectors

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sat Feb 14 16:40:24 EST 2009

(make-vector 17 V)  creates a vector with 17 entries that each have
the same value inside. So you got the same vector 17 times in the
outer vector. I think you wanted to use build-vector.

Robby

On Sat, Feb 14, 2009 at 3:28 PM, wooks <wookiz at hotmail.com> wrote:
> 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))
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>


Posted on the users mailing list.