GENERATE/PREV.gifGENERATE/NEXT.gif

Assignment

The syntax for general assignment, >SP<assignment>, is:

<destination> = <expr>

where >SP<destination> can be one of:

<name>

<property>

<array_index>

The last two forms provide a way of assigning to the components of a compound value, like an array or 3D Point. If the <destination> is a name, it identifies the variable to assign a value to, as shown in the following examples.

x = 2 + 2 * 3

y = [1, 2, 3] + pos

z = #(1, 2, "foo", "bar")

z = #oops      -- oops, changed my mind