Except for access granted by specialized functions, the index is the only way to manipulate the components of an indexed object. The index is also used to indicate operations to be performed on the object as a whole during the evaluation of an algebraic expression (see below, and Chapter 3).
As has been mentioned, the index itself consists of a set of integers and/or identifiers, separated by commas and enclosed in square brackets. There are two distinctly different kinds of index possible:
The identifiers used in a pattern index are (aside from the indices used to indicate contractions) completely arbitrary. As such, they are not evaluated, so that any values they might have do not interfere with their use as indices. For example, the algebraic value of a does not affect its use in the index of g:
#: a := 324$ #: g[a,b]; % no problem with ``a'' having a value. g a bTo accommodate the possibility where the user may wish to use a REDUCE for loop to, for example, copy an indexed object to a REDUCE matrix, the switch evalindex is provided. If on, this switch causes all identifiers in an index to be evaluated; of course, if they do not evaluate either to an integer or an identifier, an error will result (in the above example, with evalindex on, an index-out-of-range error would occur).
There are three operators that can be used in an index which denote operations that are applied to individual indexed objects: differentiation, raising and lowering of indices via metric contractions (``shifting''), and symmetrization of indices. As of REDTEN v4.00 this last operation can also be applied across a product of indexed objects using the function symz().
In general only the symmetrization operation is performed immediately (but this can be suppressed if the switch symzexp is turned off, see below), the other operations are held pending the use of the object in an indexed assignment (the subject of Chapter 3). In special cases, as noted elsewhere, the operations may be evaluated immediately.