The Freya Programming Language

Assignment statements

See also

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#.

Syntax

This is the syntax of all assignment kinds:

variable operator expression

The operator can be any of these:

OperatorMeaning
x := ySimple assignment
x += yAddition:  x = x + y
x -= ySubstraction:  x = x - y
x *= yMultiplication:  x = x * y
x /= yDivision:  x = x / y
x \= yInteger division:  x = x div y
x %= yRemainder:  x = x mod y
x ^= yBitwise xor:  x = x xor y
x |= yBitwise or:  x = x | y
x &= yBitwise and:  x = x & y
x <<= yShift left:  x = x << y
x >>= yShift right:  x = x >> y

See also

The Freya Programming Language
Statements
Increment/decrement statements
Method calls
Expressions