Docs
Control
If, loops, match, break, continue.
If chain
? score >= 90 {
io.print('excellent')
}
: score >= 70 {
io.print('passing')
}
: {
io.print('try again')
}Loops
* { } ; infinite
* ready == _ { } ; while condition is true
* item : items { } ; for-in list or range
< ; break nearest loop
> ; continue nearest loopMatch
/ std/io
$ number = 5
| number {
1, 2, 3 {
io.print('small')
}
4..9 {
io.print('middle')
}
: {
io.print('other')
}
}
% user {
$ name
}
$ person = user { name: 'Ada' }
| person {
% user {
io.print(person.name)
}
: {
io.print('not a user')
}
}Value arms compare deeply and may list multiple expressions. Range arms test inclusive membership; % struct_name arms test a named struct tag. The default arm is optional. Result and option use their own arm shapes; see Result and option.