unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: SZAVAI Gyula <szgyg@ludens.elte.hu>
Subject: bounds of 1-dimensional empty arrays
Date: Thu, 30 Nov 2006 14:21:08 +0100	[thread overview]
Message-ID: <456EDAC4.1010805@ludens.elte.hu> (raw)


guile-1.8-20061126


#1@10()
==> #()

(array-shape (make-array #t '(10 9)))
==> ((0 -1))

(make-shared-array #() (lambda x #f) '(10 9))
==> #()




--- orig/libguile/unif.c        2006-11-29 23:05:46.526091200 +0100
+++ mod/libguile/unif.c 2006-11-30 01:08:03.876683200 +0100
@@ -764,7 +764,7 @@
   SCM_I_ARRAY_V (ra) = creator (scm_from_size_t (rlen), fill);

   if (1 == SCM_I_ARRAY_NDIM (ra) && 0 == SCM_I_ARRAY_BASE (ra))
-    if (s->ubnd < s->lbnd || (0 == s->lbnd && 1 == s->inc))
+    if (0 == s->lbnd && 1 == s->inc)
       return SCM_I_ARRAY_V (ra);
   return ra;
 }
@@ -898,10 +898,7 @@
       inds = scm_cons (scm_from_long (s[k].lbnd), inds);
       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_I_ARRAY_V (ra) = make_typed_vector (scm_array_type (ra), 0);
          scm_array_handle_release (&old_handle);
          return ra;
        }




_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


             reply	other threads:[~2006-11-30 13:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-30 13:21 SZAVAI Gyula [this message]
2006-11-30 13:36 ` bounds of 1-dimensional empty arrays Ludovic Courtès
2006-12-01 12:45   ` SZAVAI Gyula
2006-12-01 19:59   ` Kevin Ryde

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=456EDAC4.1010805@ludens.elte.hu \
    --to=szgyg@ludens.elte.hu \
    /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).