[plt-scheme] vector-fill! seems working out the wrong result

From: Jon Zeppieri (zeppieri at gmail.com)
Date: Tue Sep 4 02:54:30 EDT 2007

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


Posted on the users mailing list.