;;; slib-arraymap.scm -*- Scheme -*- (module slib-arraymap (;export array-map! array-map array-for-each array-indexes array-index-for-each array-index-map! array:copy! array-copy) (import scheme) (import (chicken module)) (import (only (chicken base) include identity)) (import (chicken type)) (import (only (srfi 1) last-pair)) (import (srfi 63)) ;; Types (define-type array-strict (struct array)) ;SRFI 63 (define-type array (or string vector array-strict)) (: array-map! (array (#!rest -> *) #!rest array -> void)) (: array-map (array (#!rest -> *) #!rest array -> array)) (: array-for-each ((#!rest -> void) #!rest array -> void)) (: array-indexes (array -> array)) (: array-index-for-each (array (#!rest -> void) -> void)) (: array-index-map! (array (#!rest -> *) -> void)) (: array:copy! (array array -> void)) (: array-copy (array -> array)) (include "arraymap") (define (array-copy src) (let ((dst (apply make-array src (array-dimensions src)))) (array:copy! dst src) dst ) ) ) ;module slib-arraymap