The assignment statement changes the value of a variable, a field, a property or a event. Freya provides an assignment statement and a handful of compound assignments, in the sake of efficiency. However, Freya statements are not considered expressions, as they are in C#.
This is the syntax of all assignment kinds:
variable operator expression
The operator can be any of these:
Operator | Meaning |
---|---|
x := y | Simple assignment |
x += y | Addition: x = x + y |
x -= y | Substraction: x = x - y |
x *= y | Multiplication: x = x * y |
x /= y | Division: x = x / y |
x \= y | Integer division: x = x div y |
x %= y | Remainder: x = x mod y |
x ^= y | Bitwise xor: x = x xor y |
x |= y | Bitwise or: x = x | y |
x &= y | Bitwise and: x = x & y |
x <<= y | Shift left: x = x << y |
x >>= y | Shift right: x = x >> y |
The Freya Programming Language
Statements
Increment/decrement statements
Method calls
Expressions