From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.bugs Subject: Re: Bug in make-shared-array. Date: 02 May 2006 01:13:22 +0300 Message-ID: <87aca1pf5p.fsf@minimini.mvo.home> References: <56190b6c0602271512x5b43963fh174f5335906b6dcf@mail.gmail.com> <87ek1jjdcu.fsf@zip.com.au> <87mzfxvo7k.fsf@ossau.uklinux.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1146521616 27015 80.91.229.2 (1 May 2006 22:13:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 1 May 2006 22:13:36 +0000 (UTC) Cc: bug-guile@gnu.org, Steve Juranich , Kevin Ryde Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue May 02 00:13:33 2006 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fage2-0008Rc-AQ for guile-bugs@m.gmane.org; Tue, 02 May 2006 00:13:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fage1-0007tA-Ok for guile-bugs@m.gmane.org; Mon, 01 May 2006 18:13:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fagdy-0007sv-UW for bug-guile@gnu.org; Mon, 01 May 2006 18:13:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fagdx-0007qy-D5 for bug-guile@gnu.org; Mon, 01 May 2006 18:13:26 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fagdx-0007qc-37 for bug-guile@gnu.org; Mon, 01 May 2006 18:13:25 -0400 Original-Received: from [213.243.153.35] (helo=smtp2.pp.htv.fi) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fagdy-0000XK-6P for bug-guile@gnu.org; Mon, 01 May 2006 18:13:26 -0400 Original-Received: from zagadka.ping.de (cs181072157.pp.htv.fi [82.181.72.157]) by smtp2.pp.htv.fi (Postfix) with SMTP id 34BB2296C08 for ; Tue, 2 May 2006 01:13:24 +0300 (EEST) Original-Received: (qmail 14878 invoked by uid 1000); 2 May 2006 01:13:22 +0300 Original-To: Neil Jerram In-Reply-To: <87mzfxvo7k.fsf@ossau.uklinux.net> Original-Lines: 26 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:3224 Archived-At: Neil Jerram writes: > And at line 899 this code - > > if (s[k].ubnd < s[k].lbnd) > { > if (1 == SCM_I_ARRAY_NDIM (ra)) > ra = make_typed_vector (scm_array_type (ra), 0); > else > SCM_I_ARRAY_V (ra) = make_typed_vector (scm_array_type (ra), 0); > scm_array_handle_release (&old_handle); > return ra; > } > > - suggests that the function will do something completely different if > one of the dimensions of the new array has a negative increment. No, ubnd < lbnd does not mean that the increment is negative. Ubnd and lbnd are always sorted so that the smallest legal index is lbnd and the largest legal index is ubnd (for the dimension at hand). When ubnd is smaller than lbnd, the index range in that dimension is emtpy and the whole array has zero elements, consequently. The test in your snippet 'optimizes' for that case. (Makes me cringe.) -- GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405 _______________________________________________ Bug-guile mailing list Bug-guile@gnu.org http://lists.gnu.org/mailman/listinfo/bug-guile