Re: contents of empty shared array

2006-12-13 Thread Kevin Ryde
SZAVAI Gyula [EMAIL PROTECTED] writes:

 (let ((a (make-shared-array #() (lambda x #f) 0 2)))
  (array-contents a))
 == #f

I suppose an empty shared array ought to be considered contiguous.

 --- orig/libguile/unif.c2006-11-30 10:25:50.101433600 +0100
 +++ mod/libguile/unif.c 2006-11-30 13:03:16.24432 +0100
 @@ -900,6 +900,7 @@
{
  SCM_I_ARRAY_V (ra) = make_typed_vector (scm_array_type (ra), 0);
  scm_array_handle_release (old_handle);
 + SCM_SET_ARRAY_CONTIGUOUS_FLAG (ra);
  return ra;

Is that meant to be confined to the SCM_I_ARRAY_V case (per below)?
One of the lurking array experts will have to say ...

--- unif.c.~1.192.2.6.~	2006-12-13 09:38:49.0 +1100
+++ unif.c	2006-12-14 09:09:33.0 +1100
@@ -901,7 +901,10 @@
 	  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_SET_ARRAY_CONTIGUOUS_FLAG (ra);
+}
 	  scm_array_handle_release (old_handle);
 	  return ra;
 	}
___
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile


contents of empty shared array

2006-11-30 Thread SZAVAI Gyula


guile-1.8-20061126


(let ((a (make-shared-array #() (lambda x #f) 0 2)))
 (array-contents a))
== #f

---

(let ((a (make-shared-array #() (lambda x #f) 0 2)))
 (array-for-each display a)) ; and other scm_ramapc-based functions

Backtrace:
In current input:
  3: {0}* (let* ((a (make-shared-array # # ...))) (display a) ...)
  5: 1  [array-for-each #primitive-generic display #2:0:2()]

unnamed port:5:3: In procedure array-for-each in expression 
(array-for-each di

splay a):
unnamed port:5:3: Value out of range: 0
ABORT: (out-of-range)





--- orig/libguile/unif.c2006-11-30 10:25:50.101433600 +0100
+++ mod/libguile/unif.c 2006-11-30 13:03:16.24432 +0100
@@ -900,6 +900,7 @@
   {
 SCM_I_ARRAY_V (ra) = make_typed_vector (scm_array_type (ra), 0);
 scm_array_handle_release (old_handle);
+ SCM_SET_ARRAY_CONTIGUOUS_FLAG (ra);
 return ra;
   }
}




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