Operators
Vexel supports arithmetic, comparison, logical, and compound assignment operators. Operator precedence follows standard mathematical conventions.
Arithmetic Operators
let a: int = 10
let b: int = 3
print(a + b) # 13
print(a - b) # 7
print(a * b) # 30
print(a / b) # 3 (integer division truncates)
print(a % b) # 1 Comparison Operators
Comparison operators return a bool.
let x: int = 5
print(x == 5) # true
print(x != 3) # true
print(x < 10) # true
print(x >= 5) # true Logical Operators
let a: bool = true
let b: bool = false
print(a and b) # false
print(a or b) # true
print(not a) # false Compound Assignment
Compound assignment operators modify a variable in place.
Ternary Expression
The ternary expression evaluates to one of two values based on a condition. The syntax is value_if_true if condition else value_if_false.
let x: int = 10
let label: str = "big" if x > 5 else "small"
print(label) # big