bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in vector-move-right!


From: Andy Wingo
Subject: Re: Bug in vector-move-right!
Date: Wed, 04 Aug 2010 21:48:13 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Hi Michael,

Late reply, but better than never...

On Fri 26 Mar 2010 08:06, Michael Lucy <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]