Skip to main content

Module builtins

Module builtins 

Source
Expand description

The built-in library and the root scope.

root_scope creates the scope in which Swan code normally runs. It contains these bindings:

NameKindDescription
TRUE, FALSEconstantThe boolean values
typefunctionThe type name of a value
parsefunctionCompiles Swan source text into a function
bind, labelfunctionBind names in the global scope
boolnamespaceBoolean conversion and reduction
numbnamespaceNumber conversion
textnamespaceText inspection and manipulation
listnamespaceList inspection and manipulation
nspacenamespaceNamespace inspection
mathnamespaceMathematical constants and functions
timenamespaceTimestamps and calendar dates
promisenamespaceCreating and resolving promises
undefnamespaceCreating and inspecting undefined values

Every function is documented, with examples, in the built-in library reference of the Swan language manual.

Functionsยง

root_scope
Builds a fresh scope in which every built-in name is available.