An array class declaration D may inherit an array class C taking over C's bounds including their names. This is indicated by supplying the symbol * in the inheritance as parameter for the index bounds to be taken over. The number of stars must match the dimension of D. The class must not inherit multiply in this way.
Every array class should define the procedures aget and aset with the appropriate number and types of parameters.
The replacements of a[i,j] by a.aget(i,j) or a.aset(i,j,v) described in 4.5 are made in any case, also if a does not belong to an array class. The correct number of indices in a[i,j] is determined by the (method) types of aget and aset respectively.
A class specifier must give values to all its bounds when it is used as a type constructor or when it is of the form ROW[asize](T). In all other cases some bounds may be replaced by stars. In case of an assignment a:= b to a variable declared by a: C[10,*] it is checked that the first bound of b has the value 10 whereas the second bound is not checked.
Hint: Since for value types v:V is equivalent to v:#V
which is short for v:V:=#V, and since an explicit size must be
given for ARR creation, a specification a:ARR[*]; is legal for
method parameters only.
The built-in classes for handling arrays are:
ARR[
and ARRAY[
are not
user-definable because it exists for any number k of
dimensions.
No class may transitiveley inherit from ARR more than once.