The assignment instruction

target := expression

The value of the expression is computed and then assigned to the target. Expressions incorporated in the target are computed after the expression on the right hand side of the assignment.

Assignment instructions of the form

    target := target + expression
    target := target - expression
    target := target * expression
    target := target / expression
can be abbreviated to
    target +:= expression
    target -:= expression
    target *:= expression
    target /:= expression
respectively.

When the latter form is used and the target includes expressions, the included expressions are computed once only.

See also: Multiple target assignment., type checking.


Herman Venter

This is Slim documentation as snarfed on 27 May 1999 by dB.