Hi Michael,

Late reply, but better than never...

On Fri 26 Mar 2010 08:06, Michael Lucy <michaelgl...@gmail.com> writes:

> I think there's a bug in vector-move-right!.  I'm using guile 1.9.9 as
> built from the git repository earlier today.
>
> This is the behavior I see:
> "
> scheme@(guile-user)> (define *v1* #(1 2 3 4 5 6 7 8 9))
> scheme@(guile-user)> (define *v2* #(10 20 30 40 50 60 70 80 90))
> scheme@(guile-user)> (vector-move-right! *v1* 0 2 *v2* 5)
> scheme@(guile-user)> *v2*
> #(10 20 30 1 2 60 70 80 90)
> "
>
> It seems to interpret the argument start2 as an ending index.  I
> thought for a second that this might be intended behavior, but it says
> in the documentation that start2 is supposed to be an inclusive index,
> which it isn't.
>
> This is the behavior I expect:
> "
> scheme@(guile-user)> (define *v1* #(1 2 3 4 5 6 7 8 9))
> scheme@(guile-user)> (define *v2* #(10 20 30 40 50 60 70 80 90))
> scheme@(guile-user)> (vector-move-right! *v1* 0 2 *v2* 5)
> scheme@(guile-user)> *v2*
> #(10 20 30 40 50 1 2 80 90)
> "

Well, there are more bugs:

scheme@(guile-user)> (define *v1* #(1 2 3 4 5 6 7 8 9))
scheme@(guile-user)> (define *v2* #(10 20 30 40 50 60 70 80 90))
scheme@(guile-user)> (vector-move-left! *v1* 0 2 *v2* 9)
scheme@(guile-user)> *v2*
$1 = #(10 20 30 40 50 60 70 80 90)

Hmm, what memory did we just overwrite? :)

I have fixed all of the bugs that I can see here, but there might be
more, so please do give this a poke.

Andy
-- 
http://wingolog.org/

Reply via email to