summaryrefslogtreecommitdiff
path: root/libguile/arrays.c
diff options
context:
space:
mode:
Diffstat (limited to 'libguile/arrays.c')
-rw-r--r--libguile/arrays.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libguile/arrays.c b/libguile/arrays.c
index de86023cd..0e8c6c286 100644
--- a/libguile/arrays.c
+++ b/libguile/arrays.c
@@ -594,6 +594,7 @@ SCM_DEFINE (scm_array_for_each_cell, "array-for-each-cell", 2, 0, 1,
{
// FIXME replace stack by scm_gc_malloc_pointerless()
int const N = scm_ilength(a_);
+ int const frank = scm_to_int(frank_);
scm_t_array_handle ah[N];
SCM a[N];
scm_t_array_dim * as[N];
@@ -606,7 +607,6 @@ SCM_DEFINE (scm_array_for_each_cell, "array-for-each-cell", 2, 0, 1,
rank[n] = scm_array_handle_rank(ah+n);
}
// checks.
- int const frank = scm_to_int(frank_);
ssize_t s[frank];
char const * msg = NULL;
if (frank<0)
@@ -757,6 +757,17 @@ SCM_DEFINE (scm_array_for_each_cell, "array-for-each-cell", 2, 0, 1,
#undef FUNC_NAME
+SCM_DEFINE (scm_array_for_each_cell_in_order, "array-for-each-cell-in-order", 2, 0, 1,
+ (SCM frank_, SCM op, SCM a_),
+ "Same as array-for-each-cell, but visit the cells sequentially\n"
+ "and in row-major order.\n")
+#define FUNC_NAME s_scm_array_for_each_cell_in_order
+{
+ return scm_array_for_each_cell (frank_, op, a_);
+}
+#undef FUNC_NAME
+
+
/* args are RA . DIMS */
SCM_DEFINE (scm_transpose_array, "transpose-array", 1, 0, 1,
(SCM ra, SCM args),
@@ -1131,6 +1142,7 @@ scm_i_print_array (SCM array, SCM port, scm_print_state *pstate)
return scm_i_print_array_dimension (&h, 0, 0, port, pstate);
}
+
void
scm_init_arrays ()
{