Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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.

TopicOperations
Variablesdeclare, set, unset
Control flowif, while, for_each, chain
Functionsfunction, parameter, vararg
Types and optionalsoptional, is_none, unwrap, or_else
NumbersArithmetic and comparisons
StringsConversion, formatting, concatenation, and searching
ArraysArray types, construction, access, and mutation
RecordsRecord types, construction, field access, and mutation
Input and outputprint, 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.