unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bounds of 1-dimensional empty arrays
@ 2006-11-30 13:21 SZAVAI Gyula
  2006-11-30 13:36 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: SZAVAI Gyula @ 2006-11-30 13:21 UTC (permalink / 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-12-01 19:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-30 13:21 bounds of 1-dimensional empty arrays SZAVAI Gyula
2006-11-30 13:36 ` Ludovic Courtès
2006-12-01 12:45   ` SZAVAI Gyula
2006-12-01 19:59   ` Kevin Ryde

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).