Control flow and functions¶
Functions (def)¶
Parameters¶
- Positional parameters with types.
- Generic parameters:
def id[T](x: T) -> T. extern procfor C linkage (runtime or libraries).
Return¶
return expror implicit on last expression (when supported).-> unitor no value for procedures that only run effects.
Conditionals¶
Both branches must agree on effects and types where required.
Loops¶
while¶
decreases is mandatory.
parallel for¶
See SIMD and parallel.
Variables¶
let / immutability rules follow the borrow checker (v1 focuses on var and borrows).
Borrowing (memory)¶
| Modifier | Meaning |
|---|---|
imm | Shared read-only reference |
mut | Exclusive mutable reference |
Double mut or use-after-move is rejected. Tests: li-tests/borrow/.
Assignment¶
Index assignment on arrays requires valid indices.
echo and expressions¶
echo is a built-in for simple output. General expressions include arithmetic, calls, and indexing.
cast with proof¶
Bare cast without proof is forbidden.