From: Andy Wingo <wingo@pobox.com>
To: Michael Lucy <MichaelGLucy@Gmail.com>
Cc: bug-guile@gnu.org
Subject: Re: Bug in vector-move-right!
Date: Wed, 04 Aug 2010 21:48:13 +0200 [thread overview]
Message-ID: <m3lj8m2m82.fsf@unquote.localdomain> (raw)
In-Reply-To: <52c42c3e1003260006o71310c3en51c92d91f5cc4e0a@mail.gmail.com> (Michael Lucy's message of "Fri, 26 Mar 2010 01:06:06 -0600")
Hi Michael,
Late reply, but better than never...
On Fri 26 Mar 2010 08:06, Michael Lucy <MichaelGLucy@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/
prev parent reply other threads:[~2010-08-04 19:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-26 7:06 Bug in vector-move-right! Michael Lucy
2010-08-04 19:48 ` Andy Wingo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3lj8m2m82.fsf@unquote.localdomain \
--to=wingo@pobox.com \
--cc=MichaelGLucy@Gmail.com \
--cc=bug-guile@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).