up previous next

Selection Operators

The selection operators are
      
      []  .
Let N be of type INT and let L be of type STRING, VECTOR, LIST, or MAT. Then the meaning of L[N] depends on the type of L as explained in the following table:
    ------------------------------------------------------------
   |  Type of L    Meaning of L[N]                              |
    ------------------------------------------------------------
   | STRING       string consisting of the N-th character of L. |
   | VECTOR       N-th component of L                           | 
   | LIST         N-th element of L                             |
   | MAT          N-th element of L                             |
    ------------------------------------------------------------
                   Selection Operator
If N is an identifier and L is of type RECORD, then L.N indicates the object contained in the field N of the record L (see "Introduction to Records" and "Records").