Arrays

These provide N-dimensional, zero-based arrays and
are in the structure arrays.
The array interface is derived from one invented by Alan Bawden.

(make-array value dimension0 ...) -> array

(array dimensions element0 ...) -> array

(copy-array array) -> array

Make-array makes a new array with the given dimensions, each of which
must be a non-negative integer.
Every element is initially set to value.
Array Returns a new array with the given dimensions and elements.
Dimensions must be a list of non-negative integers,
The number of elements should be the equal to the product of the
dimensions.
The elements are stored in row-major order.

Array->vector returns a vector containing the elements of array
in row-major order.
Array-dimensions returns the dimensions of
the array as a list.

(make-shared-array array linear-map dimension0 ...) -> array

Make-shared-array makes a new array that shares storage with array
and uses linear-map to map indexes to elements.
Linear-map must accept as many arguments as the number of
dimensions given and must return a list of non-negative integers
that are valid indexes into array.
<

(array-ref (make-shared-array a f i0 i1 ...)
j0 j1 ...)

is equivalent to

(apply array-ref a (f j0 j1 ...))

As an example, the following function makes the transpose of a two-dimensional
array: