mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +02:00
New functions (array-for-each-cell, array-for-each-cell-in-order)
* libguile/array-map.c (scm_i_array_rebase, scm_array_for_each_cell): New functions. Export scm_array_for_each_cell() as (array-for-each-cell). (array-for-each-cell-in-order): Define additional export. * libguile/array-map.h (scm_i_array_rebase, scm_array_for_each_cell): Add prototypes. * doc/ref/api-compound.texi: New section 'Arrays as arrays of arrays'. Move the documentation for (array-from), (array-from*) and (array-amend!) in here. Add documentation for (array-for-each-cell). * test-suite/tests/array-map.test: Renamed from test-suite/tests/ramap.test, fix module name. Add tests for (array-for-each-cell). * test-suite/Makefile.am: Apply rename array-map.test -> ramap.test. * doc/ref/api-compound.texi: Minor documentation fixes.
This commit is contained in:
parent
1945cdf491
commit
a5bb9da6ea
6 changed files with 463 additions and 106 deletions
|
@ -28,7 +28,6 @@
|
|||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "verify.h"
|
||||
|
||||
|
@ -551,7 +550,7 @@ SCM_DEFINE (scm_array_amend_x, "array-amend!", 2, 0, 1,
|
|||
{ ARRAY_FROM_GET_O }
|
||||
scm_array_handle_release(&handle);
|
||||
/* an error is still possible here if o and b don't match. */
|
||||
/* TODO copying like this wastes the handle, and the bounds matching
|
||||
/* FIXME copying like this wastes the handle, and the bounds matching
|
||||
behavior of array-copy! is not strict. */
|
||||
scm_array_copy_x(b, o);
|
||||
}
|
||||
|
@ -569,7 +568,6 @@ SCM_DEFINE (scm_array_amend_x, "array-amend!", 2, 0, 1,
|
|||
}
|
||||
#undef FUNC_NAME
|
||||
|
||||
|
||||
#undef ARRAY_FROM_POS
|
||||
#undef ARRAY_FROM_GET_O
|
||||
|
||||
|
@ -948,6 +946,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 ()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue