Boolean operators
Kairo uses words, not symbols, for boolean logic. Both operands must be
Bool; there are no truthy/falsy conversions.
Equality operators
Operands must be compatible types. Custom equality rules are not part of the v0.1 executable subset.
Comparison operators
Operands must be compatible comparable types. Broad numeric promotion is not performed.
Arithmetic operators
Operands must be compatible. Kairo does not silently promote across numeric families.
Assignment
- Target must be a
varlocal orvarmember. - Expression must be assignment-compatible with the target type.
letbindings and immutable members cannot be reassigned outside valid construction.
Member access
- Reads a member on a value, object, or receiver.
- Chained access is supported:
customer.address.city.
Type membership access
- Calls a
type funcor reads a type-owned member. - Also used for enum cases:
OrderStatus.Draft.
Control expressions
if / else
Statement form. Condition must be Bool.
match (statement)
Block arms; used when each arm performs side effects.
match (expression)
Arrow arms; returns a value. Must be exhaustive with an else arm in v0.1.
- Literal values
- Enum cases
null- Type names
else
return
Precedence and grouping
Kairo evaluates expressions with these precedence levels, from highest to lowest:- Member access
., function/method calls(...) - Unary
not *,/+,-<,<=,>,>===,!=andor- Assignment
=
Related
Control flow
if, match, and bindings in prose.Types reference
Built-in types operators work on.
