Module std
Global namespace scribbler.
For backwards compatibility with older releases, require "std"
will inject the same functions into the global namespace as it
has done previously, even though it is now deprecated.
For new code, much better than scribbling all over the global namespace, it's more hygienic to explicitly assign the results of requiring just the submodules you actually use to a local variable, and access its functions via that table.
Functions
_G.assert () | Extend to allow formatted arguments. |
_G.bind () | Partially apply a function. |
_G.collect () | Collect the results of an iterator. |
_G.compose () | Compose functions. |
_G.curry () | Curry a function. |
_G.die () | Die with an error. |
_G.eval () | Evaluate a string. |
_G.filter () | Filter an iterator with a predicate. |
_G.fold () | Fold a binary function into an iterator. |
_G.id () | Identity function. |
_G.ileaves () | Tree iterator which returns just numbered leaves, in order. |
_G.inodes () | Tree iterator over numbered nodes, in order. |
_G.leaves () | Tree iterator which returns just leaves. |
_G.map () | Map a function over an iterator. |
_G.memoize () | Memoize a function, by wrapping it in a functable. |
_G.metamethod () | Return given metamethod, if any, else nil. |
_G.nodes () | Tree iterator. |
_G.pack () | Turn a tuple into a list. |
_G.pickle () | Convert a value to a string. |
_G.prettytostring () | Pretty-print a table. |
_G.render () | Turn tables into strings with recursion detection. |
_G.require_version () | Require a module with a particular version. |
_G.ripairs () | An iterator like ipairs, but in reverse. |
_G.tostring () | Extend tostring to work better on tables. |
_G.totable () | Turn an object into a table, according to __totable metamethod. |
_G.warn () | Give a warning with the name of program and file (if any). |
Tables
_G.op | Functional forms of infix operators. |
std | Module table. |
Metamethods
__index (name) | Lazy loading of stdlib modules. |
Functions
- _G.assert ()
-
Extend to allow formatted arguments.
See also:
- _G.bind ()
-
Partially apply a function.
See also:
- _G.collect ()
-
Collect the results of an iterator.
See also:
- _G.compose ()
-
Compose functions.
See also:
- _G.curry ()
-
Curry a function.
See also:
- _G.die ()
-
Die with an error.
See also:
- _G.eval ()
-
Evaluate a string.
See also:
- _G.filter ()
-
Filter an iterator with a predicate.
See also:
- _G.fold ()
-
Fold a binary function into an iterator.
See also:
- _G.id ()
-
Identity function.
See also:
- _G.ileaves ()
-
Tree iterator which returns just numbered leaves, in order.
See also:
- _G.inodes ()
-
Tree iterator over numbered nodes, in order.
See also:
- _G.leaves ()
-
Tree iterator which returns just leaves.
See also:
- _G.map ()
-
Map a function over an iterator.
See also:
- _G.memoize ()
-
Memoize a function, by wrapping it in a functable.
See also:
- _G.metamethod ()
-
Return given metamethod, if any, else nil.
See also:
- _G.nodes ()
-
Tree iterator.
See also:
- _G.pack ()
-
Turn a tuple into a list.
See also:
- _G.pickle ()
-
Convert a value to a string.
See also:
- _G.prettytostring ()
-
Pretty-print a table.
See also:
- _G.render ()
-
Turn tables into strings with recursion detection.
See also:
- _G.require_version ()
-
Require a module with a particular version.
See also:
- _G.ripairs ()
-
An iterator like ipairs, but in reverse.
See also:
- _G.tostring ()
-
Extend tostring to work better on tables.
See also:
- _G.totable ()
-
Turn an object into a table, according to
__totable
metamethod.See also:
- _G.warn ()
-
Give a warning with the name of program and file (if any).
See also:
Tables
- _G.op
-
Functional forms of infix operators.
See also:
- std
-
Module table. Lazy load submodules into std on first reference. On initial load, std has the usual single
version
entry, but the __index metatable will automatically require submodules on first reference:local std = require "std" local prototype = std.container.prototype
Fields:
- version release version string
Metamethods
- __index (name)
-
Lazy loading of stdlib modules.
Don't load everything on initial startup, wait until first attempt
to access a submodule, and then load it on demand.
Parameters:
- name string submodule name
Returns:
-
the submodule that was loaded to satisfy the missing
name