/usr/lib/s9fes/help/make-array is in scheme9 2010.11.13-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | S9 LIB (make-array integer ...) ==> array
(array object ...) ==> array
(array? object) ==> boolean
(array-dimensions array) ==> list
(array-map procedure array ...) ==> array
(array-rank array) ==> integer
(array-ref array integer ...) ==> object
(array-set! array integer ... object) ==> unspecific
(subarray array (list integer1,1 integer1,2) ...) ==> array
(load-from-library "array.scm")
MAKE-ARRAY creates a new array whose rank (number of dimensions)
equals the number of integers specified. Each integer specifies
the size of one dimension, e.g.: (make-array 2 3 4) creates an
array with two elements in the first dimensions, three in the
second and four in the third.
ARRAY creates a fresh array of rank one and stores the given
elemenys in it. Arrays of higher rank can be created by nesting
applications of ARRAY.
(Array? x) returns #T if X is an array and otherwise #F. The array
is a subtype of the vector, so (vector? x) follows from (array? x).
ARRAY-DIMENIONS returns a list of the dimensions of the given
ARRAY. For a zero-dimensional array it returns ().
ARRAY-MAP maps a procedure over the elements of the given arrays.
The arity of PROCECURE must match the number of ARRAYs. ARRAY-MAP
returns a new array in which the elements of the input arrays have
been tuple-wise combined with PROCEDURE, e.g.:
(new1,1 ... new1,N = ((P a1,1,1 ... aK,1,1) ... (P a1,1,N aK,1,N)
... ...
newM,1 ... newM,N) (P a1,M,1 ... aK,M,1) ... (P a1,M,N aK,M,N))
where K is the number of arrays, P is the procedure, M is the number
of rows and N is the number of columns of a matrix. When more than
two dimensions are involved the number of parameters grows accordingly.
ARRAY-RANK returns the number of dimensions of the given ARRAY.
Note that a one-dimensional array with one element has a rank
of 0.
(Array-ref a i1 ... iN) returns element <i1,...,iN> of the array A.
N must be equal to the rank of A.
(Array-set! a i1 ... iN v) sets element <i1,...,iN> of the array A
to the value V. N must be equal to the rank of A.
SUBARRAY creates a fresh array with the same rank as the given ARRAY
and copies the specified elements to the new array. Each INTEGER1
specifies the first element to copy from the corresponding dimension
and INTEGER2 specifies the first element not to copy. The dimensions
of the new array are INTEGER1,2-INTEGER1,1 ... INTEGERn,2-INTEGERn,1
where N is the rank of the array.
(let ((a (make-array 3 3 3)))
(array-set! a 1 1 1 'foo)
(array-ref a 1 1 1)) ==> foo
(let ((a (array (array 1 2 3 4)
(array 3 4 5 6)
(array 5 6 7 8))))
(list (array-rank a)
(array-dimensions a))) ==> (2 (3 4))
|