Standard Libraries¶
zb provides the following standard libraries from Lua:
The basic functions (globals and as
_G
)The math library (
math
)The string manipulation library (
string
)The table manipulation library (
table
)The UTF-8 library (
utf8
)The operating system library (
os
), albeit in a very limited capacity
Each of these libraries are available as globals and do not require importing. Unless otherwise noted, the behavior of every symbol in this section is as documented in the Lua 5.4 manual.
Basics (_G
)¶
The following basic functions are available as globals:
The following variables are available as globals:
Intentionally absent are:
Mathematics¶
The following symbols are available in the math
library:
Intentionally absent are:
String Manipulation¶
The following symbols are available in the string
library:
Intentionally absent is:
string.unpack
is currently missing but planned.
zb also sets a metatable for strings where the __index
field points to the string
table.
Patterns¶
Patterns behave a little differently in zb’s implementation
in order to avoid pathological runtime performance and clean up some confusing behaviors.
Patterns do not support backreferences (i.e. %0
- %9
) or balances (i.e. %b
).
Attempting to use either of these pattern items will raise an error.
In patterns, character sets with classes in ranges (e.g. [%a-z]
)
raise an error instead of silently exhibiting undefined behavior.
However, ranges using escapes (e.g. [%]-`]
) are well-defined in this implementation.
Table Manipulation¶
All of the symbols in the table
library are available:
UTF-8¶
All of the symbols in the utf8
library are available:
Operating System¶
The only symbol available in the os
library
is os.getenv
.