Standard Library
The CLI installs the standard library before running a script. An embedding application chooses whether to install it and supplies its input and output callbacks. The examples here assume the library is available.
The library provides operations through ordinary calls. Names such as if
and declare are not keywords; see call syntax.
| Topic | Operations |
|---|---|
| Variables | declare, set, unset |
| Control flow | if, while, for_each, chain |
| Functions | function, parameter, vararg |
| Types and optionals | optional, is_none, unwrap, or_else |
| Numbers | Arithmetic and comparisons |
| Strings | Conversion, formatting, concatenation, and searching |
| Arrays | Array types, construction, access, and mutation |
| Records | Record types, construction, field access, and mutation |
| Input and output | print, read_line |
Reading the Reference
Each operation is marked as a Function or Control. Functions evaluate all arguments from left to right before selecting an overload. Controls decide which expressions to evaluate and can accept literal names or type descriptions. See evaluation for the difference.
Signatures in tables describe arguments and results; they are not declaration
syntax. ... means additional arguments. A name or field name argument must be an
identifier written directly in the call, not a string or an evaluated value.
No value means the operation completes without returning data. It is different
from returning none, which is a runtime value of type NoneType.
Type description, field descriptor, and parameter descriptor are evaluator
results, not values that can be stored in variables or passed to Functions.
See types and
expressions without values.
Wrong argument counts and incompatible argument types cause errors. Individual entries describe additional restrictions. Errors stop evaluation; mutations already performed are not rolled back.