Skip to main content
Reference for every operator and control expression in Kairo v0.1.

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 var local or var member.
  • Expression must be assignment-compatible with the target type.
  • let bindings 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 func or 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.
Supported v0.1 patterns:
  • Literal values
  • Enum cases
  • null
  • Type names
  • else
Destructuring patterns and guards are deferred.

return

Exits the current callable.

Precedence and grouping

Kairo evaluates expressions with these precedence levels, from highest to lowest:
  1. Member access ., function/method calls (...)
  2. Unary not
  3. *, /
  4. +, -
  5. <, <=, >, >=
  6. ==, !=
  7. and
  8. or
  9. Assignment =
Use parentheses to group explicitly when precedence is unclear.

Control flow

if, match, and bindings in prose.

Types reference

Built-in types operators work on.