Composed objects: rows

In Elan-0 the only composed objects are (one-dimensional) row-variables and row-constants. A declaration for a row-variable looks like


#litout1726#

After this declaration, the row-variable <#1643#>weight<#1643#> has 5 elements, numbered from 1 to 5. Each element has an (as yet undefined) value of the type <#1644#>INT<#1644#>.

The subscription


#litout1728#

denotes its <#1647#>i<#1647#>-th element provided the value of the expression <#1648#>i<#1648#> (the <#1649#>index<#1649#>) is between one and the number of elements. A subscription of a row-variable has the access attribute <#1650#>VAR<#1650#>, so it can be assigned to, e.g.


#litout1730#

After this assignment, the element whose index is equal to the value of <#1653#>i<#1653#>, which must be in the range <#1654#>1<#1654#> to <#1655#>5<#1655#>, is equal to <#1656#>144<#1656#>. Similarly, a row-constant can be declared like


#litout1732#

The construct with the square brackets in this example is a <#1659#>row-display<#1659#>, which acts as a denotation for a row. As with other constant declarations, the initialization (with a row-display or another row) in a row-constant declaration is obligatory. A subscription from a row-constant has the access attribute <#1660#>CONST<#1660#>, so it can not be assigned to.

Apart from the possibility of manipulating individual elements of a row, it is also possible to deal with the row as a whole, e.g. in the assignment


#litout1734#

In assignments and initializations, the number of elements in the left and right hand side must match. The elements of a row can in their turn be rows again, with a declaration like


#litout1736#

and a subscription like


#litout1738#

provided, of course, that <#1667#>1 ;SPMlt;= i ;SPMlt;= 10<#1667#> and <#1668#>1 ;SPMlt;= j + 1 ;SPMlt;= 20<#1668#>.