[plt-scheme] vector-fill! seems working out the wrong result
On 9/4/07, aladdin <buaa_aladdin at 163.com> wrote:
>
> Running the code under mzscheme works out the same result. Is it a bug?
> Or is there something wrong with my code? Could anybody help? Thanks.
>
This line:
> (set! v (make-vector 2 (make-vector 2 1)))
...doesn't mean what you think it means. It does not execute
(make-vector 2 1) for each of the two slots in the 'outer' vector. It
creates a single vector that is referenced by both slots.
-Jon