From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.devel Subject: Re: bug in sort.c Date: Tue, 19 Oct 2004 16:33:20 +0200 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: References: <1097755656.5281.3487.camel@localhost> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1098196440 19109 80.91.229.6 (19 Oct 2004 14:34:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 19 Oct 2004 14:34:00 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Oct 19 16:33:50 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CJv3e-0001XH-00 for ; Tue, 19 Oct 2004 16:33:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CJvAz-0007we-5e for guile-devel@m.gmane.org; Tue, 19 Oct 2004 10:41:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CJvAh-0007wH-IZ for guile-devel@gnu.org; Tue, 19 Oct 2004 10:41:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CJvAg-0007vl-T9 for guile-devel@gnu.org; Tue, 19 Oct 2004 10:41:07 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CJvAg-0007vP-Pr for guile-devel@gnu.org; Tue, 19 Oct 2004 10:41:06 -0400 Original-Received: from [129.217.163.1] (helo=mail.dt.e-technik.uni-dortmund.de) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CJv3D-0004Ox-A2 for guile-devel@gnu.org; Tue, 19 Oct 2004 10:33:23 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.dt.e-technik.uni-dortmund.de (Postfix) with ESMTP id 7378A442DE; Tue, 19 Oct 2004 16:33:22 +0200 (CEST) Original-Received: from mail.dt.e-technik.uni-dortmund.de ([127.0.0.1]) by localhost (krusty [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 26348-03-7; Tue, 19 Oct 2004 16:33:22 +0200 (CEST) Original-Received: from troy.dt.e-technik.uni-dortmund.de (troy.dt.e-technik.uni-dortmund.de [129.217.163.17]) by mail.dt.e-technik.uni-dortmund.de (Postfix) with ESMTP id 45C2244288; Tue, 19 Oct 2004 16:33:21 +0200 (CEST) Original-Received: by troy.dt.e-technik.uni-dortmund.de (Postfix, from userid 520) id D1A5DB983; Tue, 19 Oct 2004 16:33:20 +0200 (CEST) Original-To: Roland Orre In-Reply-To: <1097755656.5281.3487.camel@localhost> (Roland Orre's message of "Thu, 14 Oct 2004 14:07:36 +0200") User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) X-Virus-Scanned: by amavisd-new at dt.e-technik.uni-dortmund.de X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:4273 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:4273 Roland Orre writes: > The following two lines in scm_restricted_vector_sort_x > are wrong: > > SCM_VALIDATE_INUM_RANGE (4, endpos,0, vlen+1); > len = SCM_INUM (endpos) - spos; > > they should be: > > SCM_VALIDATE_INUM_RANGE (4, endpos,0, vlen); > len = SCM_INUM (endpos) - spos + 1; I think the code is correct: we need to have 0 <= startpos <= endpos <= vlen The element with index endpos is not included in the sort, thus we will sort len = endpos - spos elements. The docstring needs to be clearer about this, tho. _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel