diff --git a/libguile/array-map.c b/libguile/array-map.c index 3d1b3e3a5..6c3772e8c 100644 --- a/libguile/array-map.c +++ b/libguile/array-map.c @@ -886,220 +886,6 @@ SCM_DEFINE (scm_array_for_each_cell, "array-for-each-cell", 2, 0, 1, } #undef FUNC_NAME -/* -SCM_DEFINE (scm_array_for_each_cell, "array-for-each-cell", 2, 0, 1, - (SCM frame_rank, SCM op, SCM args), - "Apply @var{op} to each of the cells of rank rank(@var{arg})-@var{frame_rank}\n" - "of the arrays @var{args}, in unspecified order. The first\n" - "@var{frame_rank} dimensions of each @var{arg} must match.\n" - "Rank-0 cells are passed as rank-0 arrays.\n\n" - "The value returned is unspecified.\n\n" - "For example:\n" - "@lisp\n" - ";; Sort the rows of rank-2 array A.\n\n" - "(array-for-each-cell 1 (lambda (x) (sort! x <)) a)\n" - "\n" - ";; Compute the arguments of the (x y) vectors in the rows of rank-2\n" - ";; array XYS and store them in rank-1 array ANGLES. Inside OP,\n" - ";; XY is a rank-1 (2-1) array, and ANGLE is a rank-0 (1-1) array.\n\n" - "(array-for-each-cell 1 \n" - " (lambda (xy angle)\n" - " (array-set! angle (atan (array-ref xy 1) (array-ref xy 0))))\n" - " xys angles)\n" - "@end lisp") -#define FUNC_NAME s_scm_array_for_each_cell -{ - // FIXME replace stack by scm_gc_malloc_pointerless() - int const N = scm_ilength (args); - int const frank = scm_to_int (frame_rank); - SCM dargs_ = SCM_EOL; - - scm_t_array_handle ah[N]; - SCM args_[N]; - scm_t_array_dim * as[N]; - int rank[N]; - - ssize_t s[frank]; - SCM ai[N]; - SCM * dargs[N]; - ssize_t i[frank]; - - int order[frank]; - size_t base[N]; - - for (int n=0; scm_is_pair(args); args=scm_cdr(args), ++n) - { - args_[n] = scm_car(args); - scm_array_get_handle(args_[n], ah+n); - as[n] = scm_array_handle_dims(ah+n); - rank[n] = scm_array_handle_rank(ah+n); - } - // checks. - char const * msg = NULL; - if (frank<0) - { - msg = "bad frame rank"; - } - else - { - for (int n=0; n!=N; ++n) - { - if (rank[n]