Plange


place the given value(s) into the given variable(s)

syntax

[XML_DOC_STRING {IC}] IDENTIFIER {IC} ("←"|"<-") {IC} (EXPRESSION|ASSIGNMENT_CHAIN)

Example

iPow2 ← -1;

Notes

Note that the left hand side of assignments need not be trivial expressions mapping to a single memory structure - a so called lvalue in some other languages. Rather, arbitrary expressions can be solved when a single free variable is present. Revisiting the above example:

A variable

iPow2 ← -1;

is assigned

iPow2  -1;

a value

iPow2 ← -1;

It is straightforward in that a single value is being put in a single variable, and both of them are clearly defined. However:

Example

x + 1 ← 0;

The above example is contrived, but provides a simple segue to constraint based programming. When this statement is executed the value -1 is stored in x. Substituting -1 for x yields (-1) + 1 = 0.

Assignment operations can be chained together

Example

a ← b ← c;

copyright © Brent Lewis 2017