Andy Wingo
12e8772403
Move array-map / array-cell functions to Scheme module
...
* libguile/array-map.c:
* libguile/array-map.h: Remove.
* module/ice-9/deprecated.scm:
* libguile/deprecated.h:
* libguile/deprecated.c: Add deprecation shims.
* module/ice-9/arrays.scm: Move all array-map functionality here.
* libguile/Makefile.am:
* libguile/init.c:
* libguile.h: Remove array-map.h use.
* libguile/arrays.c (scm_i_array_equal_p, scm_i_array_copy): New
helpers.
(scm_array_cell_ref, scm_array_cell_set_x): Move to Scheme.
* libguile/arrays.h:
* libguile/eq.c (scm_equal_p):
* libguile/sort.c (scm_sort): Use new arrays.c helpers.
* module/ice-9/pretty-print.scm:
* module/oop/goops/save.scm: Import (ice-9 arrays).
2025-06-03 14:34:26 +02:00
Daniel Llorens
f52fc0566f
Support non-zero lower bounds in array-slice-for-each
...
* libguile/array-handle.c (scm_array_handle_writable_elements): Fix
error message.
* libguile/array-map.c (scm_array_slice_for_each): Support non-zero
lower bounds. Fix error messages.
* test-suite/tests/array-map.test: Test scm_array_slice_for_each with
non-zero lower bound argument.
2017-10-31 13:23:17 +01:00
Daniel Llorens
4212f29655
Allow scm_XXX_writable_elements on empty vectors, even if immutable
...
* libguile/array-handle.c (initialize_vector_handle): Set both element
pointers to NULL if the vector is empty.
* libguile/array-map.c (racp): Ignore immutability if destination is
empty.
* test-suite/tests/sort.test: Check empty/mutable/immutable vectors with
sort!.
* test-suite/tests/array-map.test: Check array-copy! with
empty/immutable destination.
2017-10-31 13:23:17 +01:00
Daniel Llorens
7e93950552
Final names for new array functions
...
Globally rename (array-from* -> array-slice), (array-from ->
array-cell-ref), (array-amend! -> array-cell-set!), (array-for-each-cell
-> array-slice-for-each).
2017-01-09 09:02:04 +01:00
Daniel Llorens
7ef9d0ac2b
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.
* 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.
2016-11-23 13:04:49 +01:00