next up previous contents index
Next: equal? Up: LinearStructureType Previous: firstIndex   Contents   Index


set!


Usage

set!(a, n, x)
a.n := x;


Signature

set!: (%, MachineInteger, T) $\to$ T


Parameter Type Description
a % a linear structure
n MachineInteger an index
x T an entry


Description

Sets the element of $a$ with index $n$ to $x$ and returns $x$. The position of that element depends on the indexing scheme of each actual type, for example if it is $0$-indexed, then $a.n := x$ sets the ${(n+1)}^{{\rm st}}$ element of $a$, while if it is $1$-indexed, then $a.n := x$ sets 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