Docs
Binds and functions
Bind leaders and function values.
Binds
$ x = 1, y = 2 ; sequential immutable binds
~ total = 0 ; mutable bind
~ total = x + y ; reassign
# A = 21 ; compile-time constant
# B = A + A ; constants may use other constants
Functions
$ add = (a, b) {
^ a + b
}
add(20, 22)Free functions are ordinary values: pass them to another function, return them, or rebind a mutable function slot. They are introduced with $ / ~ / #. ^ expr returns a value. Bare ^ is option none. ! expr is result err, only inside a function (see Result page).
Scope
A name is available only after its bind. Echo does not shadow a name in the same region; update a mutable with ~ name =. Function parameters and local binds belong to the function body.
Const expressions
# accepts literals and operations over other constants. Runtime calls are not constant expressions. Constant names use SCREAMING_SNAKE.