`(require 'array)`

or `(require 'srfi-63)`

*Note:* Arrays are not disjoint from other Scheme types.
Vectors and possibly strings also satisfy `array?`

.
A disjoint array predicate can be written:

(define (strict-array? obj) (and (array? obj) (not (string? obj)) (not (vector? obj))))

— Function: **equal?**` obj1 obj2`

Returns

`#t`

ifobj1andobj2have the same rank and dimensions and the corresponding elements ofobj1andobj2are`equal?`

.

`equal?`

recursively compares the contents of pairs, vectors, strings, andarrays, applying`eqv?`

on other objects such as numbers and symbols. A rule of thumb is that objects are generally`equal?`

if they print the same.`equal?`

may fail to terminate if its arguments are circular data structures.(equal? 'a 'a) ⇒ #t (equal? '(a) '(a)) ⇒ #t (equal? '(a (b) c) '(a (b) c)) ⇒ #t (equal? "abc" "abc") ⇒ #t (equal? 2 2) ⇒ #t (equal? (make-vector 5 'a) (make-vector 5 'a)) ⇒ #t (equal? (make-array (A:fixN32b 4) 5 3) (make-array (A:fixN32b 4) 5 3)) ⇒ #t (equal? (make-array '#(foo) 3 3) (make-array '#(foo) 3 3)) ⇒ #t (equal? (lambda (x) x) (lambda (y) y)) ⇒unspecified

— Function: **array-rank**` obj`

Returns the number of dimensions of

obj. Ifobjis not an array, 0 is returned.

— Function: **array-dimensions**` array`

Returns a list of dimensions.

(array-dimensions (make-array '#() 3 5)) ⇒ (3 5)

— Function: **make-array**` prototype k1 ...`

Creates and returns an array of type

prototypewith dimensionsk1, ... and filled with elements fromprototype.prototypemust be an array, vector, or string. The implementation-dependent type of the returned array will be the same as the type ofprototype; except if that would be a vector or string with rank not equal to one, in which case some variety of array will be returned.If the

prototypehas no elements, then the initial contents of the returned array are unspecified. Otherwise, the returned array will be filled with the element at the origin ofprototype.

— Function: **make-shared-array**` array mapper k1 ...`

`make-shared-array`

can be used to create shared subarrays of other arrays. Themapperis a function that translates coordinates in the new array into coordinates in the old array. Amappermust be linear, and its range must stay within the bounds of the old array, but it can be otherwise arbitrary. A simple example:(define fred (make-array '#(#f) 8 8)) (define freds-diagonal (make-shared-array fred (lambda (i) (list i i)) 8)) (array-set! freds-diagonal 'foo 3) (array-ref fred 3 3) ⇒ FOO (define freds-center (make-shared-array fred (lambda (i j) (list (+ 3 i) (+ 3 j))) 2 2)) (array-ref freds-center 0 0) ⇒ FOO

— Function: **list->array**` rank proto list`

listmust be a rank-nested list consisting of all the elements, in row-major order, of the array to be created.

`list->array`

returns an array of rankrankand typeprotoconsisting of all the elements, in row-major order, oflist. Whenrankis 0,listis the lone array element; not necessarily a list.(list->array 2 '#() '((1 2) (3 4))) ⇒ #2A((1 2) (3 4)) (list->array 0 '#() 3) ⇒ #0A 3

— Function: **array->list**` array`

Returns a rank-nested list consisting of all the elements, in row-major order, of

array. In the case of a rank-0 array,`array->list`

returns the single element.(array->list #2A((ho ho ho) (ho oh oh))) ⇒ ((ho ho ho) (ho oh oh)) (array->list #0A ho) ⇒ ho

— Function: **vector->array**` vect proto dim1 ...`

vectmust be a vector of length equal to the product of exact nonnegative integersdim1, ....

`vector->array`

returns an array of typeprotoconsisting of all the elements, in row-major order, ofvect. In the case of a rank-0 array,vecthas a single element.(vector->array #(1 2 3 4) #() 2 2) ⇒ #2A((1 2) (3 4)) (vector->array '#(3) '#()) ⇒ #0A 3

— Function: **array->vector**` array`

Returns a new vector consisting of all the elements of

arrayin row-major order.(array->vector #2A ((1 2)( 3 4))) ⇒ #(1 2 3 4) (array->vector #0A ho) ⇒ #(ho)

— Function: **array-in-bounds?**` array index1 ...`

Returns

`#t`

if its arguments would be acceptable to`array-ref`

.

— Procedure: **array-set!**` array obj k1 ...`

Stores

objin the (k1, ...) element ofarray. The value returned by`array-set!`

is unspecified.

These functions return a prototypical uniform-array enclosing the optional argument (which must be of the correct type). If the uniform-array type is supported by the implementation, then it is returned; defaulting to the next larger precision type; resorting finally to vector.

— Function: **A:floC128b**` z`

— Function:**A:floC128b**

— Function:

Returns an inexact 128.bit flonum complex uniform-array prototype.

— Function: **A:floC64b**` z`

— Function:**A:floC64b**

— Function:

Returns an inexact 64.bit flonum complex uniform-array prototype.

— Function: **A:floC32b**` z`

— Function:**A:floC32b**

— Function:

Returns an inexact 32.bit flonum complex uniform-array prototype.

— Function: **A:floC16b**` z`

— Function:**A:floC16b**

— Function:

Returns an inexact 16.bit flonum complex uniform-array prototype.

— Function: **A:floR128b**` x`

— Function:**A:floR128b**

— Function:

Returns an inexact 128.bit flonum real uniform-array prototype.

— Function: **A:floR64b**` x`

— Function:**A:floR64b**

— Function:

Returns an inexact 64.bit flonum real uniform-array prototype.

— Function: **A:floR32b**` x`

— Function:**A:floR32b**

— Function:

Returns an inexact 32.bit flonum real uniform-array prototype.

— Function: **A:floR16b**` x`

— Function:**A:floR16b**

— Function:

Returns an inexact 16.bit flonum real uniform-array prototype.

— Function: **A:floR128d**` q`

— Function:**A:floR128d**

— Function:

Returns an exact 128.bit decimal flonum rational uniform-array prototype.

— Function: **A:floR64d**` q`

— Function:**A:floR64d**

— Function:

Returns an exact 64.bit decimal flonum rational uniform-array prototype.

— Function: **A:floR32d**` q`

— Function:**A:floR32d**

— Function:

Returns an exact 32.bit decimal flonum rational uniform-array prototype.

— Function: **A:fixZ64b**` n`

— Function:**A:fixZ64b**

— Function:

Returns an exact binary fixnum uniform-array prototype with at least 64 bits of precision.

— Function: **A:fixZ32b**` n`

— Function:**A:fixZ32b**

— Function:

Returns an exact binary fixnum uniform-array prototype with at least 32 bits of precision.

— Function: **A:fixZ16b**` n`

— Function:**A:fixZ16b**

— Function:

Returns an exact binary fixnum uniform-array prototype with at least 16 bits of precision.

— Function: **A:fixZ8b**` n`

— Function:**A:fixZ8b**

— Function:

Returns an exact binary fixnum uniform-array prototype with at least 8 bits of precision.

— Function: **A:fixN64b**` k`

— Function:**A:fixN64b**

— Function:

Returns an exact non-negative binary fixnum uniform-array prototype with at least 64 bits of precision.

— Function: **A:fixN32b**` k`

— Function:**A:fixN32b**

— Function:

Returns an exact non-negative binary fixnum uniform-array prototype with at least 32 bits of precision.

— Function: **A:fixN16b**` k`

— Function:**A:fixN16b**

— Function:

Returns an exact non-negative binary fixnum uniform-array prototype with at least 16 bits of precision.