Inhalte

ST/ExST Practices: Assignment as Expression

See ExST

Assignments as Expressions are generally to be avoided outside of assigning many VARs with the same value (A := B := C := 3).

They can however sometimes increase the readability of your code, when used in WHILE, IF, … conditions.

Avoided should be structures like:

tmp := 2 + (tmp2 := 1);

Assignments always have the weakest binding (a := b := TRUE AND FALSE; → a and b will be false, however a := (b := TRUE) AND FALSE; → a will be false and b will be true)