|
||||||||||||
|
|
||||||||||||
Assignments
Assignment is a top-level expression: it cannot be nested
using parenthesis.
The target of assignment can be identifiers (pointing to variable, others than
constants), attribute
reference, subscriptions or empty subscriptions (append).
There can be multiple targets, in which case the right-most expression
is enumerated and values generated by enumeration are assigned in the given order
to the target expressions on the left side. If enumeration ends
before all the targets have values assigned, Assignment can also take augmentation, meaning that the original value is modified with augmenting operator. Modification requires both a get and set operation for attributes and subscriptions. Empty subscriptions cannot be augmented, as they do not contain any value by default. Augmentation operators are addition (+=), substraction (-=), multiplication (*=), division (/=), remainder (%=) and concatenation (&=), and they behaviour is similar to binary aritmethic operators.
Assign-if-undefined operator (?=)
assign values to left side targets only if the current value of
target is ``
The right-most expression is an expression list, so it can contain multiple values
separated with commas, generating `` assignable-expr := ["&"] identifier accessor assign-target := assignable-expr assign-targets := assign-target ("," assign-target ) * assignment := assign-targets "=" expr-list assignment := assign-targets "+=" expr-list assignment := assign-targets "-=" expr-list assignment := assign-targets "*=" expr-list assignment := assign-targets "/=" expr-list assignment := assign-targets "%=" expr-list assignment := assign-targets "&=" expr-list assignment := assign-targets "?=" expr-list
See also
| Refs
| Assignable primaries
|
||||||||||||
|
|
||||||||||||