next up previous contents index
Next: firstIndex Up: LinearStructureType Previous: []   Contents   Index


apply


Usage

apply(a, n)
a.n


Signature

apply: (%, MachineInteger) $\to$ T


Parameter Type Description
a % a linear structure
n MachineInteger an index


Returns

Returns the element of $a$ with index $n$. The position of that element depends on the indexing scheme of each actual type, for example if it is $0$-indexed, then $a.n$ returns the ${(n+1)}^{{\rm st}}$ element of $a$, while if it is $1$-indexed, then $a.n$ returns the ${n}^{{\rm th}}$ element of $a$.


Remarks

Bound checking depends on the actual type, some perform it and some do not.



Manuel Bronstein 2004-06-28