wingo pushed a commit to branch wip-whippet in repository guile. commit 14764297fae06a6e2bb71823951dff61f4bb7e9f Author: Andy Wingo <wi...@pobox.com> AuthorDate: Tue Jul 15 12:44:57 2025 +0200
Add missing array-map-in-order! * module/ice-9/arrays.scm: (array-map-in-order!): Whoops, this got lost. * module/ice-9/deprecated.scm: Add deprecation trampolines. * module/ice-9/sandbox.scm (array-bindings, mutating-array-bindings): Update expected locations of array procedures. --- module/ice-9/arrays.scm | 5 +++++ module/ice-9/deprecated.scm | 3 +++ module/ice-9/sandbox.scm | 19 ++++++++++--------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/module/ice-9/arrays.scm b/module/ice-9/arrays.scm index ac1f656d3..cc56e3ce3 100644 --- a/module/ice-9/arrays.scm +++ b/module/ice-9/arrays.scm @@ -27,6 +27,7 @@ array-copy! array-copy-in-order! array-map! + array-map-in-order! array-for-each array-index-map! array-equal? @@ -283,6 +284,10 @@ (advance-src-offsets! dim) (lp (1+ n) (+ dst-offset dst-inc)))))))))))) +(define (array-map-in-order! dst proc . src*) + "Like @code{array-map!}, but guaranteed to proceed in row-major order." + (apply array-map! dst proc src*)) + (define (array-fill! array fill) "Store @var{fill} in every element of array @var{array}. The value returned is unspecified." diff --git a/module/ice-9/deprecated.scm b/module/ice-9/deprecated.scm index d9bd4f2b9..20c715a20 100644 --- a/module/ice-9/deprecated.scm +++ b/module/ice-9/deprecated.scm @@ -47,6 +47,7 @@ (array-copy!* . array-copy!) (array-copy-in-order!* . array-copy-in-order!) (array-map!* . array-map!) + (array-map-in-order!* . array-map-in-order!) (array-for-each* . array-for-each) (array-index-map!* . array-index-map!) (array-equal?* . array-equal?) @@ -230,6 +231,8 @@ (define-deprecated-trampoline (((ice-9 arrays) array-map!) dst proc . src*) (apply array-map! dst proc src*)) +(define-deprecated-trampoline (((ice-9 arrays) array-map-in-order!) dst proc . src*) + (apply array-map-in-order! dst proc src*)) (define-deprecated-trampoline (((ice-9 arrays) array-for-each) proc array . arrays) (apply array-for-each proc array arrays)) (define-deprecated-trampoline (((ice-9 arrays) array-equal?) . arrays) diff --git a/module/ice-9/sandbox.scm b/module/ice-9/sandbox.scm index 20d27fb29..ae933818d 100644 --- a/module/ice-9/sandbox.scm +++ b/module/ice-9/sandbox.scm @@ -801,24 +801,24 @@ allocation limit is exceeded, an exception will be thrown to the ucs-range->char-set!))) (define array-bindings - '(((guile) - array->list + '(((ice-9 arrays) array-cell-ref - array-contents - array-dimensions array-equal? array-for-each + array-slice-for-each + array-slice-for-each-in-order) + ((guile) + array->list + array-contents + array-dimensions array-in-bounds? array-length array-rank array-ref array-shape array-slice - array-slice-for-each - array-slice-for-each-in-order array-type array-type-code - array? list->array list->typed-array make-array @@ -834,14 +834,15 @@ allocation limit is exceeded, an exception will be thrown to the ;; bitvector, bytevector, srfi-4 vector, or array is exposed to the ;; sandbox. (define mutating-array-bindings - '(((guile) + '(((ice-9 arrays) array-cell-set! array-copy! array-copy-in-order! array-fill! array-index-map! array-map! - array-map-in-order! + array-map-in-order!) + ((guile) array-set!))) (define hash-bindings