Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
type dummy = element
The function alloc
expects a dummy element.
type t = element array
The type of arrays.
An index into an array is an integer value in the semi-open interval [0,n)
, where n
is the length of the array.
An offset into an array is an integer value in the closed interval [0,n]
, where n
is the length of the array. When an offset o
and a length k
are used in concert to designate an array segment, both o
and o+k
must be valid offsets.
val empty : t
The empty array.
unsafe_get a i
returns the element found at index i
in the array a
. The index i
must be valid, or all hell may break loose.
unsafe_set a i x
writes the value x
at index i
in the array a
. The index i
must be valid, or all hell may break loose.
alloc n d
returns a new array of length n
. The dummy element d
may be used to initialize this array, but this is not guaranteed. Thus, this array must be considered uninitialized: every slot must be written before it is read.
make n x
returns a new array of length n
, where every slot contains the value x
.
grow n d a k
returns a new array of length n
. The lower segment of this array, determined by offset 0
and length k
, is initialized by copying data from array a
, at offset 0
and length k
. The inequality k <= n
must hold. The upper segment of this array, determined by offset k
and length n - k
, must be considered uninitialized: every slot must be written before it is read.
init n f
returns a new array of length n
, where the slot at index i
contains the value f i
.
sub a o k
returns a new array of length k
whose content is the content of the array segment identified by array a
, offset o
, and length k
.
unsafe_blit a1 o1 a2 o2 k
copies the content of the array segment identified by array a1
, offset o1
, and length k
into the array segment identified by array a2
, offset o2
, and length k
. No bounds check is performed.
blit a1 o1 a2 o2 k
copies the content of the array segment identified by array a1
, offset o1
, and length k
into the array segment identified by array a2
, offset o2
, and length k
.