The predefined pattern Indexed may be sued to define indexed objects.   Indexed has the following interface:

Indexed(range: ? Integer, elm:< Object):
       %put V: ?elm %at% inx: ?integer:
          ...
       %get inx: ?integer -> V: ?integer:
          ...
       length -> res: ? integer:
          ...
       asString -> S: ?Object:
          ...

Range defines the number of elements in the indexed object and elm is the type of the elements.

%put%at% and %get assign and read elements of the indexed object respectively.

The pattern asString converts the indexed object to an immutable String - is however only meaningful if elm is Char.

The following example shows how to use Indexed:

values: ?Indexed(10,integer)

%for 1 %to% values.length %do%
   values.%put inx * 2 %at% inx

sum: ?integer

%for 1 %to% values.length %do%
   sum := sum + values.%get inx

Note. Length is not needed since we have range!?