From bbc55f8e523cdc0382c99f4132bfa188cac52339 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Mon, 8 Apr 2013 09:24:36 +0700 Subject: [PATCH 01/15] gh-pages: initial documentation import. --- files/base.html | 1535 ++++++++++++++++++++++++++++++++++++++++ files/bin.html | 270 +++++++ files/debug_ext.html | 347 +++++++++ files/debug_init.html | 198 ++++++ files/fstable.html | 246 +++++++ files/getopt.html | 397 +++++++++++ files/io_ext.html | 480 +++++++++++++ files/lcs.html | 250 +++++++ files/list.html | 1154 ++++++++++++++++++++++++++++++ files/math_ext.html | 286 ++++++++ files/mbox.html | 242 +++++++ files/modules.html | 198 ++++++ files/object.html | 234 ++++++ files/package_ext.html | 246 +++++++ files/parser.html | 284 ++++++++ files/set.html | 613 ++++++++++++++++ files/std.html | 198 ++++++ files/strbuf.html | 280 ++++++++ files/strict.html | 198 ++++++ files/string_ext.html | 707 ++++++++++++++++++ files/table_ext.html | 568 +++++++++++++++ files/tree.html | 395 +++++++++++ files/xml.html | 247 +++++++ index.html | 329 +++++++++ luadoc.css | 286 ++++++++ modules/base.html | 1531 +++++++++++++++++++++++++++++++++++++++ modules/bin.html | 328 +++++++++ modules/debug.html | 343 +++++++++ modules/fstable.html | 304 ++++++++ modules/getopt.html | 473 +++++++++++++ modules/io.html | 476 +++++++++++++ modules/lcs.html | 308 ++++++++ modules/list.html | 1212 +++++++++++++++++++++++++++++++ modules/math.html | 282 ++++++++ modules/mbox.html | 300 ++++++++ modules/object.html | 292 ++++++++ modules/package.html | 256 +++++++ modules/parser.html | 342 +++++++++ modules/set.html | 640 +++++++++++++++++ modules/std.html | 256 +++++++ modules/strbuf.html | 338 +++++++++ modules/string.html | 717 +++++++++++++++++++ modules/table.html | 578 +++++++++++++++ modules/tree.html | 415 +++++++++++ 44 files changed, 19579 insertions(+) create mode 100644 files/base.html create mode 100644 files/bin.html create mode 100644 files/debug_ext.html create mode 100644 files/debug_init.html create mode 100644 files/fstable.html create mode 100644 files/getopt.html create mode 100644 files/io_ext.html create mode 100644 files/lcs.html create mode 100644 files/list.html create mode 100644 files/math_ext.html create mode 100644 files/mbox.html create mode 100644 files/modules.html create mode 100644 files/object.html create mode 100644 files/package_ext.html create mode 100644 files/parser.html create mode 100644 files/set.html create mode 100644 files/std.html create mode 100644 files/strbuf.html create mode 100644 files/strict.html create mode 100644 files/string_ext.html create mode 100644 files/table_ext.html create mode 100644 files/tree.html create mode 100644 files/xml.html create mode 100644 index.html create mode 100644 luadoc.css create mode 100644 modules/base.html create mode 100644 modules/bin.html create mode 100644 modules/debug.html create mode 100644 modules/fstable.html create mode 100644 modules/getopt.html create mode 100644 modules/io.html create mode 100644 modules/lcs.html create mode 100644 modules/list.html create mode 100644 modules/math.html create mode 100644 modules/mbox.html create mode 100644 modules/object.html create mode 100644 modules/package.html create mode 100644 modules/parser.html create mode 100644 modules/set.html create mode 100644 modules/std.html create mode 100644 modules/strbuf.html create mode 100644 modules/string.html create mode 100644 modules/table.html create mode 100644 modules/tree.html diff --git a/files/base.html b/files/base.html new file mode 100644 index 0000000..8e08905 --- /dev/null +++ b/files/base.html @@ -0,0 +1,1535 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File base.lua

+ + +

Adds to the existing global functions

+ + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
_G.assert (v, f, ...)Extend to allow formatted arguments.
_G.bind (f, ...)Partially apply a function.
_G.collect (i, ...)Collect the results of an iterator.
_G.compose (..., f1...fn)Compose functions.
_G.curry (f, n)Curry a function.
_G.die (...)Die with error.
_G.eval (s)Evaluate a string.
_G.filter (p, i, ...)Filter an iterator with a predicate.
_G.fold (f, d, i, ...)Fold a binary function into an iterator.
_G.id (...)Identity function.
_G.ileaves (tr)Tree iterator which returns just numbered leaves, in order.
_G.inodes (tr)Tree iterator over numbered nodes, in order.
_G.leaves (tr)Tree iterator which returns just leaves.
_G.map (f, i, ...)Map a function over an iterator.
_G.memoize (fn)Memoize a function, by wrapping it in a functable.
_G.metamethod (x, n)Return given metamethod, if any, or nil.
_G.nodes (tr)Tree iterator.
_G.pack (...)Turn a tuple into a list.
_G.pickle (x)Convert a value to a string.
_G.prettytostring (t, indent, spacing)Pretty-print a table.
_G.render (x, open, close, elem, pair, sep, roots)Turn tables into strings with recursion detection.
_G.require_version (module, min, too_big, pattern)Require a module with a particular version
_G.ripairs (t)An iterator like ipairs, but in reverse.
_G.tostring (x)Extend tostring to work better on tables.
_G.totable (x)Turn an object into a table according to __totable metamethod.
_G.warn (...)Give warning with the name of program and file (if any).
render_CloseRenderer (t)
render_ElementRenderer (e)
render_OpenRenderer (t)
render_PairRenderer N.B. the function should not try to render i and v, or treat them recursively. (t, i, v, is, vs)
render_SeparatorRenderer (t, i, v, j, w)
tree_Iterator (it, tr, n)
+ + + + +

Tables

+ + + + + + + +
_G.opFunctional forms of infix operators.
+ + + +
+
+ + + + +

Functions

+
+ + + +
_G.assert (v, f, ...)
+
+Extend to allow formatted arguments. + + +

Parameters

+
    + +
  • + v: value to assert +
  • + +
  • + f: format +
  • + +
  • + ...: arguments to format +
  • + +
+ + + + + + +

Return value:

+value + + + +
+ + + + +
_G.bind (f, ...)
+
+Partially apply a function. + + +

Parameters

+
    + +
  • + f: function to apply partially +
  • + +
  • + ...: arguments to bind +
  • + +
+ + + + + + +

Return value:

+function with ai already bound + + + +
+ + + + +
_G.collect (i, ...)
+
+Collect the results of an iterator. + + +

Parameters

+
    + +
  • + i: iterator +
  • + +
  • + ...: +
  • + +
+ + + + + + +

Return value:

+results of running the iterator on its arguments + + + +
+ + + + +
_G.compose (..., f1...fn)
+
+Compose functions. + + +

Parameters

+
    + +
  • + ...: +
  • + +
  • + f1...fn: functions to compose +
  • + +
+ + + + + + +

Return value:

+composition of f1 ... fn + + + +
+ + + + +
_G.curry (f, n)
+
+Curry a function. + + +

Parameters

+
    + +
  • + f: function to curry +
  • + +
  • + n: number of arguments +
  • + +
+ + + + + + +

Return value:

+curried version of f + + + +
+ + + + +
_G.die (...)
+
+Die with error. + + +

Parameters

+
    + +
  • + ...: arguments for format +
  • + +
+ + + + + + + + +
+ + + + +
_G.eval (s)
+
+Evaluate a string. + + +

Parameters

+
    + +
  • + s: string +
  • + +
+ + + + + + +

Return value:

+value of string + + + +
+ + + + +
_G.filter (p, i, ...)
+
+Filter an iterator with a predicate. + + +

Parameters

+
    + +
  • + p: predicate +
  • + +
  • + i: iterator +
  • + +
  • + ...: +
  • + +
+ + + + + + +

Return value:

+result table containing elements e for which p (e) + + + +
+ + + + +
_G.fold (f, d, i, ...)
+
+Fold a binary function into an iterator. + + +

Parameters

+
    + +
  • + f: function +
  • + +
  • + d: initial first argument +
  • + +
  • + i: iterator +
  • + +
  • + ...: +
  • + +
+ + + + + + +

Return value:

+result + + + +
+ + + + +
_G.id (...)
+
+Identity function. + + +

Parameters

+
    + +
  • + ...: +
  • + +
+ + + + + + +

Return value:

+the arguments passed to the function + + + +
+ + + + +
_G.ileaves (tr)
+
+Tree iterator which returns just numbered leaves, in order. + + +

Parameters

+
    + +
  • + tr: tree to iterate over +
  • + +
+ + + + + + +

Return values:

+
    + +
  1. iterator function + +
  2. the tree, as above + +
+ + + +
+ + + + +
_G.inodes (tr)
+
+Tree iterator over numbered nodes, in order. + + +

Parameters

+
    + +
  • + tr: tree to iterate over +
  • + +
+ + + + + + +

Return values:

+
    + +
  1. iterator function + +
  2. the tree, as above + +
+ + + +

See also:

+ + +
+ + + + +
_G.leaves (tr)
+
+Tree iterator which returns just leaves. + + +

Parameters

+
    + +
  • + tr: tree to iterate over +
  • + +
+ + + + + + +

Return values:

+
    + +
  1. iterator function + +
  2. the tree, as above + +
+ + + +
+ + + + +
_G.map (f, i, ...)
+
+Map a function over an iterator. + + +

Parameters

+
    + +
  • + f: function +
  • + +
  • + i: iterator +
  • + +
  • + ...: +
  • + +
+ + + + + + +

Return value:

+result table + + + +
+ + + + +
_G.memoize (fn)
+
+Memoize a function, by wrapping it in a functable. + + +

Parameters

+
    + +
  • + fn: function that returns a single result +
  • + +
+ + + + + + +

Return value:

+memoized function + + + +
+ + + + +
_G.metamethod (x, n)
+
+Return given metamethod, if any, or nil. + + +

Parameters

+
    + +
  • + x: object to get metamethod of +
  • + +
  • + n: name of metamethod to get +
  • + +
+ + + + + + +

Return value:

+metamethod function or nil if no metamethod or not a function + + + +
+ + + + +
_G.nodes (tr)
+
+Tree iterator. + + +

Parameters

+
    + +
  • + tr: tree to iterate over +
  • + +
+ + + + + + +

Return values:

+
    + +
  1. iterator function + +
  2. the tree, as above + +
+ + + +

See also:

+ + +
+ + + + +
_G.pack (...)
+
+Turn a tuple into a list. + + +

Parameters

+
    + +
  • + ...: tuple +
  • + +
+ + + + + + +

Return value:

+list + + + +
+ + + + +
_G.pickle (x)
+
+Convert a value to a string. The string can be passed to dostring to retrieve the value.
TODO: Make it work for recursive tables. + + +

Parameters

+
    + +
  • + x: object to pickle +
  • + +
+ + + + + + +

Return value:

+string such that eval (s) is the same value as x + + + +
+ + + + +
_G.prettytostring (t, indent, spacing)
+
+Pretty-print a table. + + +

Parameters

+
    + +
  • + t: table to print +
  • + +
  • + indent: indent between levels ["\t"] +
  • + +
  • + spacing: space before every line +
  • + +
+ + + + + + +

Return value:

+pretty-printed string + + + +
+ + + + +
_G.render (x, open, close, elem, pair, sep, roots)
+
+Turn tables into strings with recursion detection. N.B. Functions calling render should not recurse, or recursion detection will not work. + + +

Parameters

+
    + +
  • + x: object to convert to string +
  • + +
  • + open: open table renderer +
  • + +
  • + close: close table renderer +
  • + +
  • + elem: element renderer +
  • + +
  • + pair: pair renderer +
  • + +
  • + sep: separator renderer +
  • + +
  • + roots: +
  • + +
+ + + + + + +

Return value:

+string representation + + + +

See also:

+ + +
+ + + + +
_G.require_version (module, min, too_big, pattern)
+
+Require a module with a particular version + + +

Parameters

+
    + +
  • + module: module to require +
  • + +
  • + min: lowest acceptable version (default: any) +
  • + +
  • + too_big: lowest version that is too big (default: none) +
  • + +
  • + pattern: +
  • + +
+ + + + + + + + +
+ + + + +
_G.ripairs (t)
+
+An iterator like ipairs, but in reverse. + + +

Parameters

+
    + +
  • + t: table to iterate over +
  • + +
+ + + + + + +

Return values:

+
    + +
  1. iterator function + +
  2. the table, as above + +
  3. #t + 1 + +
+ + + +
+ + + + +
_G.tostring (x)
+
+Extend tostring to work better on tables. The original tostring is available as _tostring. + + +

Parameters

+
    + +
  • + x: object to convert to string +
  • + +
+ + + + + + +

Return value:

+string representation + + + +
+ + + + +
_G.totable (x)
+
+Turn an object into a table according to __totable metamethod. + + +

Parameters

+
    + +
  • + x: object to turn into a table +
  • + +
+ + + + + + +

Return value:

+table or nil + + + +
+ + + + +
_G.warn (...)
+
+Give warning with the name of program and file (if any). + + +

Parameters

+
    + +
  • + ...: arguments for format +
  • + +
+ + + + + + + + +
+ + + + +
render_CloseRenderer (t)
+
+ + + +

Parameters

+
    + +
  • + t: table +
  • + +
+ + + + + + +

Return value:

+close table string + + + +
+ + + + +
render_ElementRenderer (e)
+
+ + + +

Parameters

+
    + +
  • + e: element +
  • + +
+ + + + + + +

Return value:

+element string + + + +
+ + + + +
render_OpenRenderer (t)
+
+ + + +

Parameters

+
    + +
  • + t: table +
  • + +
+ + + + + + +

Return value:

+open table string + + + +
+ + + + +
render_PairRenderer N.B. the function should not try to render i and v, or treat them recursively. (t, i, v, is, vs)
+
+ + + +

Parameters

+
    + +
  • + t: table +
  • + +
  • + i: index +
  • + +
  • + v: value +
  • + +
  • + is: index string +
  • + +
  • + vs: value string +
  • + +
+ + + + + + +

Return value:

+element string + + + +
+ + + + +
render_SeparatorRenderer (t, i, v, j, w)
+
+ + + +

Parameters

+
    + +
  • + t: table +
  • + +
  • + i: preceding index (nil on first call) +
  • + +
  • + v: preceding value (nil on first call) +
  • + +
  • + j: following index (nil on last call) +
  • + +
  • + w: following value (nil on last call) +
  • + +
+ + + + + + +

Return value:

+separator string + + + +
+ + + + +
tree_Iterator (it, tr, n)
+
+ + + +

Parameters

+
    + +
  • + it: +
  • + +
  • + tr: +
  • + +
  • + n: current node +
  • + +
+ + + + + + +

Return values:

+
    + +
  1. type ("leaf", "branch" (pre-order) or "join" (post-order)) + +
  2. path to node ({i1...ik}) + +
  3. node + +
+ + + +
+ + +
+ + + + +

Tables

+
+ +
_G.op
+
Functional forms of infix operators. Defined here so that other modules can write to it. + + + +
+ + +
+ + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/bin.html b/files/bin.html new file mode 100644 index 0000000..e42ef70 --- /dev/null +++ b/files/bin.html @@ -0,0 +1,270 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File bin.lua

+ + + + + + + +

Functions

+ + + + + + + + + + + + +
le_to_hex (s)Turn a little-endian word into a hex string
le_to_number (s)Turn a little-endian word into a number
+ + + + + + +
+
+ + + + +

Functions

+
+ + + +
le_to_hex (s)
+
+Turn a little-endian word into a hex string + + +

Parameters

+
    + +
  • + s: +
  • + +
+ + + + + + + + +
+ + + + +
le_to_number (s)
+
+Turn a little-endian word into a number + + +

Parameters

+
    + +
  • + s: +
  • + +
+ + + + + + + + +
+ + +
+ + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/debug_ext.html b/files/debug_ext.html new file mode 100644 index 0000000..a73f8c6 --- /dev/null +++ b/files/debug_ext.html @@ -0,0 +1,347 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File debug_ext.lua

+ + +

Additions to the debug module

+ + + + + + +

Functions

+ + + + + + + + + + + + + + + + + +
debug ()The global function debug is an abbreviation for debug.say (1, ...)
say (n, ...)Print a debugging message
trace (event)Trace function calls Use as debug.sethook (trace, "cr"), which is done automatically when _DEBUG.call is set.
+ + + + +

Tables

+ + + + + + + +
_DEBUGTo activate debugging set _DEBUG either to any true value (equivalent to {level = 1}), or as documented below.
+ + + +
+
+ + + + +

Functions

+
+ + + +
debug ()
+
+The global function debug is an abbreviation for debug.say (1, ...) + + + + + + + + + +

See also:

+ + +
+ + + + +
say (n, ...)
+
+Print a debugging message + + +

Parameters

+
    + +
  • + n: debugging level, defaults to 1 +
  • + +
  • + ...: objects to print (as for print) +
  • + +
+ + + + + + + + +
+ + + + +
trace (event)
+
+Trace function calls Use as debug.sethook (trace, "cr"), which is done automatically when _DEBUG.call is set. Based on test/trace-calls.lua from the Lua distribution. + + +

Parameters

+
    + +
  • + event: event causing the call +
  • + +
+ + + + + + + + +
+ + +
+ + + + +

Tables

+
+ +
_DEBUG
+
To activate debugging set _DEBUG either to any true value (equivalent to {level = 1}), or as documented below. + + +Fields +
    + +
  • + level: debugging level +
  • + +
  • + call: do call trace debugging +
  • + +
  • + std: do standard library debugging (run examples & test code) +
  • + +
+ + +
+ + +
+ + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/debug_init.html b/files/debug_init.html new file mode 100644 index 0000000..7ff4514 --- /dev/null +++ b/files/debug_init.html @@ -0,0 +1,198 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File debug_init.lua

+ + + + + + + + + + + + +
+
+ + + + + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/fstable.html b/files/fstable.html new file mode 100644 index 0000000..fd53984 --- /dev/null +++ b/files/fstable.html @@ -0,0 +1,246 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File fstable.lua

+ + + + + + + +

Functions

+ + + + + + + +
new (path, t)Bind a directory to a table
+ + + + + + +
+
+ + + + +

Functions

+
+ + + +
new (path, t)
+
+Bind a directory to a table + + +

Parameters

+
    + +
  • + path: directory path +
  • + +
  • + t: table to merge with directory +
  • + +
+ + + + + + +

Return value:

+table bound to directory + + + +
+ + +
+ + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/getopt.html b/files/getopt.html new file mode 100644 index 0000000..707082b --- /dev/null +++ b/files/getopt.html @@ -0,0 +1,397 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File getopt.lua

+ + + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
getOpt (argIn, options, stop_at_nonopt)Perform argument processing
makeOptions (t)Options table constructor: adds lookup tables for the option names
processArgs (prog, ...)Simple getOpt wrapper.
usage (prog)Emit a usage message.
usageInfo (header, optDesc, pageWidth)Produce usage info for the given options
+ + + + + + +
+
+ + + + +

Functions

+
+ + + +
getOpt (argIn, options, stop_at_nonopt)
+
+Perform argument processing + + +

Parameters

+
    + +
  • + argIn: list of command-line args +
  • + +
  • + options: options table +
  • + +
  • + stop_at_nonopt: if true, stop option processing at first non-option +
  • + +
+ + + + + + +

Return values:

+
    + +
  1. table of remaining non-options + +
  2. table of option key-value list pairs + +
  3. table of error messages + +
+ + + +
+ + + + +
makeOptions (t)
+
+Options table constructor: adds lookup tables for the option names + + +

Parameters

+
    + +
  • + t: +
  • + +
+ + + + + + + + +
+ + + + +
processArgs (prog, ...)
+
+Simple getOpt wrapper. If the caller didn't supply their own already, adds --version/-V and --help/-h options automatically; stops program if there was an error, or if --help or --version was used. + + +

Parameters

+
    + +
  • + prog: table of named parameters +
  • + +
  • + ...: extra arguments for getOpt +
  • + +
+ + + + + + + + +
+ + + + +
usage (prog)
+
+Emit a usage message. + + +

Parameters

+
    + +
  • + prog: table of named parameters +
  • + +
+ + + + + + + + +
+ + + + +
usageInfo (header, optDesc, pageWidth)
+
+Produce usage info for the given options + + +

Parameters

+
    + +
  • + header: header string +
  • + +
  • + optDesc: option descriptors +
  • + +
  • + pageWidth: width to format to [78] +
  • + +
+ + + + + + +

Return value:

+formatted string + + + +
+ + +
+ + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/io_ext.html b/files/io_ext.html new file mode 100644 index 0000000..f8de140 --- /dev/null +++ b/files/io_ext.html @@ -0,0 +1,480 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File io_ext.lua

+ + +

Additions to the io module

+ + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
catdir (...)Concatenate two or more directories into a path, removing the trailing slash.
catfile (...)Concatenate one or more directories and a filename into a path.
processFiles (f)Process files specified on the command-line.
readlines (h)Read a file or file handle into a list of lines.
shell (c)Perform a shell command and return its output.
slurp (h)Slurp a file handle.
splitdir (path)Split a directory path into components.
writelines (h, ...)Write values adding a newline after each.
+ + + + + + +
+
+ + + + +

Functions

+
+ + + +
catdir (...)
+
+Concatenate two or more directories into a path, removing the trailing slash. + + +

Parameters

+
    + +
  • + ...: path components +
  • + +
+ + + + + + +

Return value:

+path + + + +
+ + + + +
catfile (...)
+
+Concatenate one or more directories and a filename into a path. + + +

Parameters

+
    + +
  • + ...: path components +
  • + +
+ + + + + + +

Return value:

+path + + + +
+ + + + +
processFiles (f)
+
+Process files specified on the command-line. If no files given, process io.stdin; in list of files, - means io.stdin.
FIXME: Make the file list an argument to the function. + + +

Parameters

+
    + +
  • + f: function to process files with, which is passed (name, arg_no) +
  • + +
+ + + + + + + + +
+ + + + +
readlines (h)
+
+Read a file or file handle into a list of lines. + + +

Parameters

+
    + +
  • + h: file handle or name (default: io.input ()); if h is a handle, the file is closed after reading +
  • + +
+ + + + + + +

Return value:

+list of lines + + + +
+ + + + +
shell (c)
+
+Perform a shell command and return its output. + + +

Parameters

+
    + +
  • + c: command +
  • + +
+ + + + + + +

Return value:

+output, or nil if error + + + +
+ + + + +
slurp (h)
+
+Slurp a file handle. + + +

Parameters

+
    + +
  • + h: file handle or name (default: io.input ()) +
  • + +
+ + + + + + +

Return value:

+contents of file or handle, or nil if error + + + +
+ + + + +
splitdir (path)
+
+Split a directory path into components. Empty components are retained: the root directory becomes {"", ""}. + + +

Parameters

+
    + +
  • + path: path +
  • + +
+ + + + + + +

Return value:

+list of path components + + + +
+ + + + +
writelines (h, ...)
+
+Write values adding a newline after each. + + +

Parameters

+
    + +
  • + h: file handle (default: io.output () +
  • + +
  • + ...: values to write (as for write) +
  • + +
+ + + + + + + + +
+ + +
+ + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/lcs.html b/files/lcs.html new file mode 100644 index 0000000..48c4809 --- /dev/null +++ b/files/lcs.html @@ -0,0 +1,250 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File lcs.lua

+ + + + + + + +

Functions

+ + + + + + + +
longestCommonSubseq (a, b, s)Find the longest common subsequence of two sequences.
+ + + + + + +
+
+ + + + +

Functions

+
+ + + +
longestCommonSubseq (a, b, s)
+
+Find the longest common subsequence of two sequences. The sequence objects must have an __append metamethod. This is provided by string_ext for strings, and by list for lists. + + +

Parameters

+
    + +
  • + a: first sequence +
  • + +
  • + b: second sequence +
  • + +
  • + s: an empty sequence of the same type, to hold the result +
  • + +
+ + + + + + +

Return value:

+the LCS of a and b + + + +
+ + +
+ + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/list.html b/files/list.html new file mode 100644 index 0000000..f0071a5 --- /dev/null +++ b/files/list.html @@ -0,0 +1,1154 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File list.lua

+ + + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
append (l, x)Append an item to a list.
compare (l, m)Compare two lists element by element left-to-right
concat (...)Concatenate lists.
cons (l, x)Prepend an item to a list.
depair (ls)Turn a list of pairs into a table.
elems (l)An iterator over the elements of a list.
enpair (t)Turn a table into a list of pairs.
filter (p, l)Filter a list according to a predicate.
flatten (l)Flatten a list.
foldl (f, e, l)Fold a binary function through a list left associatively.
foldr (f, e, l)Fold a binary function through a list right associatively.
indexKey (f, l)Make an index of a list of tables on a given field
indexValue (f, l)Copy a list of tables, indexed on a given field
map (f, l)Map a function over a list.
mapWith (f, l, ls)Map a function over a list of lists.
new (l, t)List constructor.
project (f, l)Project a list of fields from a list of tables.
relems (l)An iterator over the elements of a list, in reverse.
rep (l, n)Repeat a list.
reverse (l)Reverse a list.
shape (s, l)Shape a list according to a list of dimensions.
sub (l, from, to)Return a sub-range of a list.
tail (l)Return a list with its first element removed.
transpose (ls)Transpose a list of lists.
zipWith (f, ls)Zip lists together with a function.
+ + + + + + +
+
+ + + + +

Functions

+
+ + + +
append (l, x)
+
+Append an item to a list. + + +

Parameters

+
    + +
  • + l: list +
  • + +
  • + x: item +
  • + +
+ + + + + + +

Return value:

+{l[1], ..., l[#l], x} + + + +
+ + + + +
compare (l, m)
+
+Compare two lists element by element left-to-right + + +

Parameters

+
    + +
  • + l: first list +
  • + +
  • + m: second list +
  • + +
+ + + + + + +

Return value:

+-1 if l is less than m, 0 if they are the same, and 1 if l is greater than m + + + +
+ + + + +
concat (...)
+
+Concatenate lists. + + +

Parameters

+
    + +
  • + ...: lists +
  • + +
+ + + + + + +

Return value:

+{l1[1], ..., l1[#l1], ..., ln[1], ..., ln[#ln]} + + + +
+ + + + +
cons (l, x)
+
+Prepend an item to a list. + + +

Parameters

+
    + +
  • + l: list +
  • + +
  • + x: item +
  • + +
+ + + + + + +

Return value:

+{x, unpack (l)} + + + +
+ + + + +
depair (ls)
+
+Turn a list of pairs into a table.
FIXME: Find a better name. + + +

Parameters

+
    + +
  • + ls: list {{i1, v1}, ..., {in, vn}} +
  • + +
+ + + + + + +

Return value:

+table {i1=v1, ..., in=vn} + + + +
+ + + + +
elems (l)
+
+An iterator over the elements of a list. + + +

Parameters

+
    + +
  • + l: list to iterate over +
  • + +
+ + + + + + +

Return values:

+
    + +
  1. iterator function which returns successive elements of the list + +
  2. the list l as above + +
  3. true + +
+ + + +
+ + + + +
enpair (t)
+
+Turn a table into a list of pairs.
FIXME: Find a better name. + + +

Parameters

+
    + +
  • + t: table {i1=v1, ..., in=vn} +
  • + +
+ + + + + + +

Return value:

+list {{i1, v1}, ..., {in, vn}} + + + +
+ + + + +
filter (p, l)
+
+Filter a list according to a predicate. + + +

Parameters

+
    + +
  • + p: predicate (function of one argument returning a boolean) +
  • + +
  • + l: list of lists +
  • + +
+ + + + + + +

Return value:

+result list containing elements e of l for which p (e) is true + + + +
+ + + + +
flatten (l)
+
+Flatten a list. + + +

Parameters

+
    + +
  • + l: list to flatten +
  • + +
+ + + + + + +

Return value:

+flattened list + + + +
+ + + + +
foldl (f, e, l)
+
+Fold a binary function through a list left associatively. + + +

Parameters

+
    + +
  • + f: function +
  • + +
  • + e: element to place in left-most position +
  • + +
  • + l: list +
  • + +
+ + + + + + +

Return value:

+result + + + +
+ + + + +
foldr (f, e, l)
+
+Fold a binary function through a list right associatively. + + +

Parameters

+
    + +
  • + f: function +
  • + +
  • + e: element to place in right-most position +
  • + +
  • + l: list +
  • + +
+ + + + + + +

Return value:

+result + + + +
+ + + + +
indexKey (f, l)
+
+Make an index of a list of tables on a given field + + +

Parameters

+
    + +
  • + f: field +
  • + +
  • + l: list of tables {t1, ..., tn} +
  • + +
+ + + + + + +

Return value:

+index {t1[f]=1, ..., tn[f]=n} + + + +
+ + + + +
indexValue (f, l)
+
+Copy a list of tables, indexed on a given field + + +

Parameters

+
    + +
  • + f: field whose value should be used as index +
  • + +
  • + l: list of tables {i1=t1, ..., in=tn} +
  • + +
+ + + + + + +

Return value:

+index {t1[f]=t1, ..., tn[f]=tn} + + + +
+ + + + +
map (f, l)
+
+Map a function over a list. + + +

Parameters

+
    + +
  • + f: function +
  • + +
  • + l: list +
  • + +
+ + + + + + +

Return value:

+result list {f (l[1]), ..., f (l[#l])} + + + +
+ + + + +
mapWith (f, l, ls)
+
+Map a function over a list of lists. + + +

Parameters

+
    + +
  • + f: function +
  • + +
  • + l: +
  • + +
  • + ls: list of lists +
  • + +
+ + + + + + +

Return value:

+result list {f (unpack (ls[1]))), ..., f (unpack (ls[#ls]))} + + + +
+ + + + +
new (l, t)
+
+List constructor. Needed in order to use metamethods. + + +

Parameters

+
    + +
  • + l: +
  • + +
  • + t: list (as a table), or nil for empty list +
  • + +
+ + + + + + +

Return value:

+list (with list metamethods) + + + +
+ + + + +
project (f, l)
+
+Project a list of fields from a list of tables. + + +

Parameters

+
    + +
  • + f: field to project +
  • + +
  • + l: list of tables +
  • + +
+ + + + + + +

Return value:

+list of f fields + + + +
+ + + + +
relems (l)
+
+An iterator over the elements of a list, in reverse. + + +

Parameters

+
    + +
  • + l: list to iterate over +
  • + +
+ + + + + + +

Return values:

+
    + +
  1. iterator function which returns precessive elements of the list + +
  2. the list l as above + +
  3. true + +
+ + + +
+ + + + +
rep (l, n)
+
+Repeat a list. + + +

Parameters

+
    + +
  • + l: list +
  • + +
  • + n: number of times to repeat +
  • + +
+ + + + + + +

Return value:

+n copies of l appended together + + + +
+ + + + +
reverse (l)
+
+Reverse a list. + + +

Parameters

+
    + +
  • + l: list +
  • + +
+ + + + + + +

Return value:

+list {l[#l], ..., l[1]} + + + +
+ + + + +
shape (s, l)
+
+Shape a list according to a list of dimensions. Dimensions are given outermost first and items from the original list are distributed breadth first; there may be one 0 indicating an indefinite number. Hence, {0} is a flat list, {1} is a singleton, {2, 0} is a list of two lists, and {0, 2} is a list of pairs.
Algorithm: turn shape into all positive numbers, calculating the zero if necessary and making sure there is at most one; recursively walk the shape, adding empty tables until the bottom level is reached at which point add table items instead, using a counter to walk the flattened original list.
+ + +

Parameters

+
    + +
  • + s: {d1, ..., dn} +
  • + +
  • + l: list to reshape +
  • + +
+ + + + + + +

Return value:

+reshaped list FIXME: Use ileaves instead of flatten (needs a while instead of a for in fill function) + + + +
+ + + + +
sub (l, from, to)
+
+Return a sub-range of a list. (The equivalent of string.sub on strings; negative list indices count from the end of the list.) + + +

Parameters

+
    + +
  • + l: list +
  • + +
  • + from: start of range (default: 1) +
  • + +
  • + to: end of range (default: #l) +
  • + +
+ + + + + + +

Return value:

+{l[from], ..., l[to]} + + + +
+ + + + +
tail (l)
+
+Return a list with its first element removed. + + +

Parameters

+
    + +
  • + l: list +
  • + +
+ + + + + + +

Return value:

+{l[2], ..., l[#l]} + + + +
+ + + + +
transpose (ls)
+
+Transpose a list of lists. This function in Lua is equivalent to zip and unzip in more strongly typed languages. + + +

Parameters

+
    + +
  • + ls: {{l1,1, ..., l1,c}, ..., {lr,1, ..., lr,c}} +
  • + +
+ + + + + + +

Return value:

+{{l1,1, ..., lr,1}, ..., {l1,c, ..., lr,c}} + + + +
+ + + + +
zipWith (f, ls)
+
+Zip lists together with a function. + + +

Parameters

+
    + +
  • + f: function +
  • + +
  • + ls: list of lists +
  • + +
+ + + + + + +

Return value:

+{f (ls[1][1], ..., ls[#ls][1]), ..., f (ls[1][N], ..., ls[#ls][N]) where N = max {map (function (l) return #l end, ls)} + + + +
+ + +
+ + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/math_ext.html b/files/math_ext.html new file mode 100644 index 0000000..2c4e978 --- /dev/null +++ b/files/math_ext.html @@ -0,0 +1,286 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File math_ext.lua

+ + +

Additions to the math module.

+ + + + + + +

Functions

+ + + + + + + + + + + + +
floor (n, p)Extend math.floor to take the number of decimal places.
round (n, p)Round a number to a given number of decimal places
+ + + + + + +
+
+ + + + +

Functions

+
+ + + +
floor (n, p)
+
+Extend math.floor to take the number of decimal places. + + +

Parameters

+
    + +
  • + n: number +
  • + +
  • + p: number of decimal places to truncate to (default: 0) +
  • + +
+ + + + + + +

Return value:

+n truncated to p decimal places + + + +
+ + + + +
round (n, p)
+
+Round a number to a given number of decimal places + + +

Parameters

+
    + +
  • + n: number +
  • + +
  • + p: number of decimal places to round to (default: 0) +
  • + +
+ + + + + + +

Return value:

+n rounded to p decimal places + + + +
+ + +
+ + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/mbox.html b/files/mbox.html new file mode 100644 index 0000000..4021740 --- /dev/null +++ b/files/mbox.html @@ -0,0 +1,242 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File mbox.lua

+ + + + + + + +

Functions

+ + + + + + + +
parse (s)Parse a mailbox into messages.
+ + + + + + +
+
+ + + + +

Functions

+
+ + + +
parse (s)
+
+Parse a mailbox into messages. + + +

Parameters

+
    + +
  • + s: mailbox as a string +
  • + +
+ + + + + + +

Return value:

+list of messages, each of form {header = {...}, body = "..."} + + + +
+ + +
+ + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/modules.html b/files/modules.html new file mode 100644 index 0000000..8bfa7b5 --- /dev/null +++ b/files/modules.html @@ -0,0 +1,198 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File modules.lua

+ + + + + + + + + + + + +
+
+ + + + + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/object.html b/files/object.html new file mode 100644 index 0000000..bd86c9d --- /dev/null +++ b/files/object.html @@ -0,0 +1,234 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File object.lua

+ + + + + + + + + + +

Tables

+ + + + + + + +
ObjectRoot object
+ + + +
+
+ + + + + + + +

Tables

+
+ +
Object
+
Root object + + +Fields +
    + +
  • + _init: constructor method or list of fields to be initialised by the constructor +
  • + +
  • + _clone: object constructor which provides the behaviour for _init documented above +
  • + +
+ + +
+ + +
+ + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/package_ext.html b/files/package_ext.html new file mode 100644 index 0000000..edca151 --- /dev/null +++ b/files/package_ext.html @@ -0,0 +1,246 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File package_ext.lua

+ + + + + + + + + + +

Tables

+ + + + + + + +
packageMake named constants for package.config (undocumented in 5.1; see luaconf.h for C equivalents).
+ + + +
+
+ + + + + + + +

Tables

+
+ +
package
+
Make named constants for package.config (undocumented in 5.1; see luaconf.h for C equivalents). + + +Fields +
    + +
  • + dirsep: directory separator +
  • + +
  • + pathsep: path separator +
  • + +
  • + path_mark: string that marks substitution points in a path template +
  • + +
  • + execdir: (Windows only) replaced by the executable's directory in a path +
  • + +
  • + igmark: Mark to ignore all before it when building luaopen_ function name. +
  • + +
+ + +
+ + +
+ + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/parser.html b/files/parser.html new file mode 100644 index 0000000..1da5a07 --- /dev/null +++ b/files/parser.html @@ -0,0 +1,284 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File parser.lua

+ + + + + + + +

Functions

+ + + + + + + + + + + + +
Parser:_init (grammar)Parser constructor
Parser:parse (start, token, from)Parse a token list.
+ + + + + + +
+
+ + + + +

Functions

+
+ + + +
Parser:_init (grammar)
+
+Parser constructor + + +

Parameters

+
    + +
  • + grammar: parser grammar +
  • + +
+ + + + + + +

Return value:

+parser + + + +
+ + + + +
Parser:parse (start, token, from)
+
+Parse a token list. + + +

Parameters

+
    + +
  • + start: the token at which to start +
  • + +
  • + token: the list of tokens +
  • + +
  • + from: the index of the token to start from (default: 1) +
  • + +
+ + + + + + +

Return value:

+parse tree + + + +
+ + +
+ + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/set.html b/files/set.html new file mode 100644 index 0000000..7f684e9 --- /dev/null +++ b/files/set.html @@ -0,0 +1,613 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File set.lua

+ + + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
delete (s, e)Delete an element from a set
difference (s, t)Find the difference of two sets
elems (s)Iterator for sets TODO: Make the iterator return only the key
equal (s, t)Find whether two sets are equal
insert (s, e)Insert an element into a set
intersection (s, t)Find the intersection of two sets
member (s, e)Say whether an element is in a set
propersubset (s, t)Find whether one set is a proper subset of another
subset (s, t)Find whether one set is a subset of another
symmetric_difference (s, t)Find the symmetric difference of two sets
union (s, t)Find the union of two sets
+ + + + + + +
+
+ + + + +

Functions

+
+ + + +
delete (s, e)
+
+Delete an element from a set + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + e: element +
  • + +
+ + + + + + + + +
+ + + + +
difference (s, t)
+
+Find the difference of two sets + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + t: set +
  • + +
+ + + + + + +

Return value:

+s with elements of t removed + + + +
+ + + + +
elems (s)
+
+Iterator for sets TODO: Make the iterator return only the key + + +

Parameters

+
    + +
  • + s: +
  • + +
+ + + + + + + + +
+ + + + +
equal (s, t)
+
+Find whether two sets are equal + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + t: set +
  • + +
+ + + + + + +

Return value:

+true if sets are equal, false otherwise + + + +
+ + + + +
insert (s, e)
+
+Insert an element into a set + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + e: element +
  • + +
+ + + + + + + + +
+ + + + +
intersection (s, t)
+
+Find the intersection of two sets + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + t: set +
  • + +
+ + + + + + +

Return value:

+set intersection of s and t + + + +
+ + + + +
member (s, e)
+
+Say whether an element is in a set + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + e: element +
  • + +
+ + + + + + +

Return value:

+true if e is in set, false otherwise + + + +
+ + + + +
propersubset (s, t)
+
+Find whether one set is a proper subset of another + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + t: set +
  • + +
+ + + + + + +

Return value:

+true if s is a proper subset of t, false otherwise + + + +
+ + + + +
subset (s, t)
+
+Find whether one set is a subset of another + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + t: set +
  • + +
+ + + + + + +

Return value:

+true if s is a subset of t, false otherwise + + + +
+ + + + +
symmetric_difference (s, t)
+
+Find the symmetric difference of two sets + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + t: set +
  • + +
+ + + + + + +

Return value:

+elements of s and t that are in s or t but not both + + + +
+ + + + +
union (s, t)
+
+Find the union of two sets + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + t: set +
  • + +
+ + + + + + +

Return value:

+set union of s and t + + + +
+ + +
+ + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/std.html b/files/std.html new file mode 100644 index 0000000..92fdc30 --- /dev/null +++ b/files/std.html @@ -0,0 +1,198 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File std.lua

+ + + + + + + + + + + + +
+
+ + + + + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/strbuf.html b/files/strbuf.html new file mode 100644 index 0000000..7075e99 --- /dev/null +++ b/files/strbuf.html @@ -0,0 +1,280 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File strbuf.lua

+ + + + + + + +

Functions

+ + + + + + + + + + + + +
concat (b, s)Add a string to a buffer
tostring (b)Convert a buffer to a string
+ + + + + + +
+
+ + + + +

Functions

+
+ + + +
concat (b, s)
+
+Add a string to a buffer + + +

Parameters

+
    + +
  • + b: buffer +
  • + +
  • + s: string to add +
  • + +
+ + + + + + +

Return value:

+buffer + + + +
+ + + + +
tostring (b)
+
+Convert a buffer to a string + + +

Parameters

+
    + +
  • + b: buffer +
  • + +
+ + + + + + +

Return value:

+string + + + +
+ + +
+ + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/strict.html b/files/strict.html new file mode 100644 index 0000000..208054b --- /dev/null +++ b/files/strict.html @@ -0,0 +1,198 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File strict.lua

+ + + + + + + + + + + + +
+
+ + + + + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/string_ext.html b/files/string_ext.html new file mode 100644 index 0000000..daa78d7 --- /dev/null +++ b/files/string_ext.html @@ -0,0 +1,707 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File string_ext.lua

+ + + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
caps (s)Capitalise each word in a string.
chomp (s)Remove any final newline from a string.
escape_pattern (s)Escape a string to be used as a pattern
finds (s, p, init, plain)Do multiple finds on a string.
ltrim (s, r)Remove leading matter from a string.
numbertosi (n)Write a number using SI suffixes.
ordinal_suffix (n)Return the English suffix for an ordinal.
pad (s, w, p)Justify a string.
rtrim (s, r)Remove trailing matter from a string.
split (s, sep)Split a string at a given separator.
tfind (s, p, init, plain)Do find, returning captures as a list.
trim (s, r)Remove leading and trailing matter from a string.
wrap (s, w, ind, ind1)Wrap a string into a paragraph.
+ + + + + + +
+
+ + + + +

Functions

+
+ + + +
caps (s)
+
+Capitalise each word in a string. + + +

Parameters

+
    + +
  • + s: string +
  • + +
+ + + + + + +

Return value:

+capitalised string + + + +
+ + + + +
chomp (s)
+
+Remove any final newline from a string. + + +

Parameters

+
    + +
  • + s: string to process +
  • + +
+ + + + + + +

Return value:

+processed string + + + +
+ + + + +
escape_pattern (s)
+
+Escape a string to be used as a pattern + + +

Parameters

+
    + +
  • + s: string to process @return +
  • + +
+ + + + + + + + +
+ + + + +
finds (s, p, init, plain)
+
+Do multiple finds on a string. + + +

Parameters

+
    + +
  • + s: target string +
  • + +
  • + p: pattern +
  • + +
  • + init: start position (default: 1) +
  • + +
  • + plain: inhibit magic characters (default: nil) +
  • + +
+ + + + + + +

Return value:

+list of {from, to; capt = {captures}} + + + +
+ + + + +
ltrim (s, r)
+
+Remove leading matter from a string. + + +

Parameters

+
    + +
  • + s: string +
  • + +
  • + r: leading pattern (default: "%s+") +
  • + +
+ + + + + + +

Return value:

+string without leading r + + + +
+ + + + +
numbertosi (n)
+
+Write a number using SI suffixes. The number is always written to 3 s.f. + + +

Parameters

+
    + +
  • + n: number +
  • + +
+ + + + + + +

Return value:

+string + + + +
+ + + + +
ordinal_suffix (n)
+
+Return the English suffix for an ordinal. + + +

Parameters

+
    + +
  • + n: number of the day +
  • + +
+ + + + + + +

Return value:

+suffix + + + +
+ + + + +
pad (s, w, p)
+
+Justify a string. When the string is longer than w, it is truncated (left or right according to the sign of w). + + +

Parameters

+
    + +
  • + s: string to justify +
  • + +
  • + w: width to justify to (-ve means right-justify; +ve means left-justify) +
  • + +
  • + p: string to pad with (default: " ") +
  • + +
+ + + + + + +

Return value:

+justified string + + + +
+ + + + +
rtrim (s, r)
+
+Remove trailing matter from a string. + + +

Parameters

+
    + +
  • + s: string +
  • + +
  • + r: trailing pattern (default: "%s+") +
  • + +
+ + + + + + +

Return value:

+string without trailing r + + + +
+ + + + +
split (s, sep)
+
+Split a string at a given separator. FIXME: Consider Perl and Python versions. + + +

Parameters

+
    + +
  • + s: string to split +
  • + +
  • + sep: separator pattern +
  • + +
+ + + + + + +

Return value:

+list of strings + + + +
+ + + + +
tfind (s, p, init, plain)
+
+Do find, returning captures as a list. + + +

Parameters

+
    + +
  • + s: target string +
  • + +
  • + p: pattern +
  • + +
  • + init: start position (default: 1) +
  • + +
  • + plain: inhibit magic characters (default: nil) +
  • + +
+ + + + + + +

Return value:

+start of match, end of match, table of captures + + + +
+ + + + +
trim (s, r)
+
+Remove leading and trailing matter from a string. + + +

Parameters

+
    + +
  • + s: string +
  • + +
  • + r: leading/trailing pattern (default: "%s+") +
  • + +
+ + + + + + +

Return value:

+string without leading/trailing r + + + +
+ + + + +
wrap (s, w, ind, ind1)
+
+Wrap a string into a paragraph. + + +

Parameters

+
    + +
  • + s: string to wrap +
  • + +
  • + w: width to wrap to (default: 78) +
  • + +
  • + ind: indent (default: 0) +
  • + +
  • + ind1: indent of first line (default: ind) +
  • + +
+ + + + + + +

Return value:

+wrapped paragraph + + + +
+ + +
+ + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/table_ext.html b/files/table_ext.html new file mode 100644 index 0000000..df59014 --- /dev/null +++ b/files/table_ext.html @@ -0,0 +1,568 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File table_ext.lua

+ + + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
clone (t, nometa)Make a shallow copy of a table, including any metatable (for a deep copy, use tree.clone).
clone_rename (map, t)Clone a table, renaming some keys.
empty (t)Return whether table is empty.
invert (t)Invert a table.
keys (t)Make the list of keys of a table.
merge (t, u)Merge one table into another.
new (x, t)Make a table with a default value for unset keys.
size (t)Find the number of elements in a table.
sort (t, c)Make table.sort return its result.
values (t)Make the list of values of a table.
+ + + + + + +
+
+ + + + +

Functions

+
+ + + +
clone (t, nometa)
+
+Make a shallow copy of a table, including any metatable (for a deep copy, use tree.clone). + + +

Parameters

+
    + +
  • + t: table +
  • + +
  • + nometa: if non-nil don't copy metatable +
  • + +
+ + + + + + +

Return value:

+copy of table + + + +
+ + + + +
clone_rename (map, t)
+
+Clone a table, renaming some keys. + + +

Parameters

+
    + +
  • + map: table {old_key=new_key, ...} +
  • + +
  • + t: table to copy +
  • + +
+ + + + + + +

Return value:

+copy of table + + + +
+ + + + +
empty (t)
+
+Return whether table is empty. + + +

Parameters

+
    + +
  • + t: table +
  • + +
+ + + + + + +

Return value:

+true if empty or false otherwise + + + +
+ + + + +
invert (t)
+
+Invert a table. + + +

Parameters

+
    + +
  • + t: table {i=v, ...} +
  • + +
+ + + + + + +

Return value:

+inverted table {v=i, ...} + + + +
+ + + + +
keys (t)
+
+Make the list of keys of a table. + + +

Parameters

+
    + +
  • + t: table +
  • + +
+ + + + + + +

Return value:

+list of keys + + + +
+ + + + +
merge (t, u)
+
+Merge one table into another. u is merged into t. + + +

Parameters

+
    + +
  • + t: first table +
  • + +
  • + u: second table +
  • + +
+ + + + + + +

Return value:

+first table + + + +
+ + + + +
new (x, t)
+
+Make a table with a default value for unset keys. + + +

Parameters

+
    + +
  • + x: default entry value (default: nil) +
  • + +
  • + t: initial table (default: {}) +
  • + +
+ + + + + + +

Return value:

+table whose unset elements are x + + + +
+ + + + +
size (t)
+
+Find the number of elements in a table. + + +

Parameters

+
    + +
  • + t: table +
  • + +
+ + + + + + +

Return value:

+number of elements in t + + + +
+ + + + +
sort (t, c)
+
+Make table.sort return its result. + + +

Parameters

+
    + +
  • + t: table +
  • + +
  • + c: comparator function +
  • + +
+ + + + + + +

Return value:

+sorted table + + + +
+ + + + +
values (t)
+
+Make the list of values of a table. + + +

Parameters

+
    + +
  • + t: table +
  • + +
+ + + + + + +

Return value:

+list of values + + + +
+ + +
+ + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/tree.html b/files/tree.html new file mode 100644 index 0000000..6f71ec7 --- /dev/null +++ b/files/tree.html @@ -0,0 +1,395 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File tree.lua

+ + + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
clone (t, nometa)Make a deep copy of a tree, including any metatables
merge (t, u)Deep-merge one tree into another.
metatable.__index (tr, i)Tree __index metamethod.
metatable.__newindex (tr, i, v)Tree __newindex metamethod.
new (t)Make a table into a tree
+ + + + + + +
+
+ + + + +

Functions

+
+ + + +
clone (t, nometa)
+
+Make a deep copy of a tree, including any metatables + + +

Parameters

+
    + +
  • + t: table +
  • + +
  • + nometa: if non-nil don't copy metatables +
  • + +
+ + + + + + +

Return value:

+copy of table + + + +
+ + + + +
merge (t, u)
+
+Deep-merge one tree into another. u is merged into t. + + +

Parameters

+
    + +
  • + t: first tree +
  • + +
  • + u: second tree +
  • + +
+ + + + + + +

Return value:

+first tree + + + +
+ + + + +
metatable.__index (tr, i)
+
+Tree __index metamethod. + + +

Parameters

+
    + +
  • + tr: tree +
  • + +
  • + i: non-table, or list of keys {i1 ... in} +
  • + +
+ + + + + + +

Return value:

+tr[i]...[in] if i is a table, or tr[i] otherwise + + + +
+ + + + +
metatable.__newindex (tr, i, v)
+
+Tree __newindex metamethod. Sets tr[i1]...[in] = v if i is a table, or tr[i] = v otherwise + + +

Parameters

+
    + +
  • + tr: tree +
  • + +
  • + i: non-table, or list of keys {i1 ... in} +
  • + +
  • + v: value +
  • + +
+ + + + + + + + +
+ + + + +
new (t)
+
+Make a table into a tree + + +

Parameters

+
    + +
  • + t: table +
  • + +
+ + + + + + +

Return value:

+tree + + + +
+ + +
+ + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/files/xml.html b/files/xml.html new file mode 100644 index 0000000..9bbda48 --- /dev/null +++ b/files/xml.html @@ -0,0 +1,247 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

File xml.lua

+ + + + + + + +

Functions

+ + + + + + + +
string.writeXML (t, indent, spacing)Write a table as XML.
+ + + + + + +
+
+ + + + +

Functions

+
+ + + +
string.writeXML (t, indent, spacing)
+
+Write a table as XML. The input format is assumed to be that output by luaexpat. + + +

Parameters

+
    + +
  • + t: table to print. In each element, tag is its name, attr is the table of attributes, and the sub-elements are held in the integer keys +
  • + +
  • + indent: indent between levels (default: "\t") +
  • + +
  • + spacing: space before every line +
  • + +
+ + + + + + + + +
+ + +
+ + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/index.html b/index.html new file mode 100644 index 0000000..c92cf55 --- /dev/null +++ b/index.html @@ -0,0 +1,329 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ + + +

Modules

+ + + + + + + + + + + + + + + + + + + + + + + +
baseAdds to the existing global functions
debugAdditions to the debug module
ioAdditions to the io module
mathAdditions to the math module.
+ + + + + +

Files

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
base.lua
bin.lua
debug_ext.lua
debug_init.lua
fstable.lua
getopt.lua
io_ext.lua
lcs.lua
list.lua
math_ext.lua
mbox.lua
modules.lua
object.lua
package_ext.lua
parser.lua
set.lua
std.lua
strbuf.lua
strict.lua
string_ext.lua
table_ext.lua
tree.lua
xml.lua
+ + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/luadoc.css b/luadoc.css new file mode 100644 index 0000000..bc0f98a --- /dev/null +++ b/luadoc.css @@ -0,0 +1,286 @@ +body { + margin-left: 1em; + margin-right: 1em; + font-family: arial, helvetica, geneva, sans-serif; + background-color:#ffffff; margin:0px; +} + +code { + font-family: "Andale Mono", monospace; +} + +tt { + font-family: "Andale Mono", monospace; +} + +body, td, th { font-size: 11pt; } + +h1, h2, h3, h4 { margin-left: 0em; } + +textarea, pre, tt { font-size:10pt; } +body, td, th { color:#000000; } +small { font-size:0.85em; } +h1 { font-size:1.5em; } +h2 { font-size:1.25em; } +h3 { font-size:1.15em; } +h4 { font-size:1.06em; } + +a:link { font-weight:bold; color: #004080; text-decoration: none; } +a:visited { font-weight:bold; color: #006699; text-decoration: none; } +a:link:hover { text-decoration:underline; } +hr { color:#cccccc } +img { border-width: 0px; } + + +h3 { padding-top: 1em; } + +p { margin-left: 1em; } + +p.name { + font-family: "Andale Mono", monospace; + padding-top: 1em; + margin-left: 0em; +} + +blockquote { margin-left: 3em; } + +pre.example { + background-color: rgb(245, 245, 245); + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-style: solid; + border-right-style: solid; + border-bottom-style: solid; + border-left-style: solid; + border-top-color: silver; + border-right-color: silver; + border-bottom-color: silver; + border-left-color: silver; + padding: 1em; + margin-left: 1em; + margin-right: 1em; + font-family: "Andale Mono", monospace; + font-size: smaller; +} + + +hr { + margin-left: 0em; + background: #00007f; + border: 0px; + height: 1px; +} + +ul { list-style-type: disc; } + +table.index { border: 1px #00007f; } +table.index td { text-align: left; vertical-align: top; } +table.index ul { padding-top: 0em; margin-top: 0em; } + +table { + border: 1px solid black; + border-collapse: collapse; + margin-left: auto; + margin-right: auto; +} +th { + border: 1px solid black; + padding: 0.5em; +} +td { + border: 1px solid black; + padding: 0.5em; +} +div.header, div.footer { margin-left: 0em; } + +#container +{ + margin-left: 1em; + margin-right: 1em; + background-color: #f0f0f0; +} + +#product +{ + text-align: center; + border-bottom: 1px solid #cccccc; + background-color: #ffffff; +} + +#product big { + font-size: 2em; +} + +#product_logo +{ +} + +#product_name +{ +} + +#product_description +{ +} + +#main +{ + background-color: #f0f0f0; + border-left: 2px solid #cccccc; +} + +#navigation +{ + float: left; + width: 18em; + margin: 0; + vertical-align: top; + background-color: #f0f0f0; + overflow:visible; +} + +#navigation h1 { + background-color:#e7e7e7; + font-size:1.1em; + color:#000000; + text-align:left; + margin:0px; + padding:0.2em; + border-top:1px solid #dddddd; + border-bottom:1px solid #dddddd; +} + +#navigation ul +{ + font-size:1em; + list-style-type: none; + padding: 0; + margin: 1px; +} + +#navigation li +{ + text-indent: -1em; + margin: 0em 0em 0em 0.5em; + display: block; + padding: 3px 0px 0px 12px; +} + +#navigation li li a +{ + padding: 0px 3px 0px -1em; +} + +#content +{ + margin-left: 18em; + padding: 1em; + border-left: 2px solid #cccccc; + border-right: 2px solid #cccccc; + background-color: #ffffff; +} + +#about +{ + clear: both; + margin: 0; + padding: 5px; + border-top: 2px solid #cccccc; + background-color: #ffffff; +} + +@media print { + body { + font: 12pt "Times New Roman", "TimeNR", Times, serif; + } + a { font-weight:bold; color: #004080; text-decoration: underline; } + + #main { background-color: #ffffff; border-left: 0px; } + #container { margin-left: 2%; margin-right: 2%; background-color: #ffffff; } + + #content { margin-left: 0px; padding: 1em; border-left: 0px; border-right: 0px; background-color: #ffffff; } + + #navigation { display: none; + } + pre.example { + font-family: "Andale Mono", monospace; + font-size: 10pt; + page-break-inside: avoid; + } +} + +table.module_list td +{ + border-width: 1px; + padding: 3px; + border-style: solid; + border-color: #cccccc; +} +table.module_list td.name { background-color: #f0f0f0; } +table.module_list td.summary { width: 100%; } + +table.file_list +{ + border-width: 1px; + border-style: solid; + border-color: #cccccc; + border-collapse: collapse; +} +table.file_list td +{ + border-width: 1px; + padding: 3px; + border-style: solid; + border-color: #cccccc; +} +table.file_list td.name { background-color: #f0f0f0; } +table.file_list td.summary { width: 100%; } + + +table.function_list +{ + border-width: 1px; + border-style: solid; + border-color: #cccccc; + border-collapse: collapse; +} +table.function_list td +{ + border-width: 1px; + padding: 3px; + border-style: solid; + border-color: #cccccc; +} +table.function_list td.name { background-color: #f0f0f0; } +table.function_list td.summary { width: 100%; } + + +table.table_list +{ + border-width: 1px; + border-style: solid; + border-color: #cccccc; + border-collapse: collapse; +} +table.table_list td +{ + border-width: 1px; + padding: 3px; + border-style: solid; + border-color: #cccccc; +} +table.table_list td.name { background-color: #f0f0f0; } +table.table_list td.summary { width: 100%; } + +dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;} +dl.function dd {padding-bottom: 1em;} +dl.function h3 {padding: 0; margin: 0; font-size: medium;} + +dl.table dt {border-top: 1px solid #ccc; padding-top: 1em;} +dl.table dd {padding-bottom: 1em;} +dl.table h3 {padding: 0; margin: 0; font-size: medium;} + +#TODO: make module_list, file_list, function_list, table_list inherit from a list + diff --git a/modules/base.html b/modules/base.html new file mode 100644 index 0000000..8f85c51 --- /dev/null +++ b/modules/base.html @@ -0,0 +1,1531 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Module base

+ +

Adds to the existing global functions

+ + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
_G.assert (v, f, ...)Extend to allow formatted arguments.
_G.bind (f, ...)Partially apply a function.
_G.collect (i, ...)Collect the results of an iterator.
_G.compose (..., f1...fn)Compose functions.
_G.curry (f, n)Curry a function.
_G.die (...)Die with error.
_G.eval (s)Evaluate a string.
_G.filter (p, i, ...)Filter an iterator with a predicate.
_G.fold (f, d, i, ...)Fold a binary function into an iterator.
_G.id (...)Identity function.
_G.ileaves (tr)Tree iterator which returns just numbered leaves, in order.
_G.inodes (tr)Tree iterator over numbered nodes, in order.
_G.leaves (tr)Tree iterator which returns just leaves.
_G.map (f, i, ...)Map a function over an iterator.
_G.memoize (fn)Memoize a function, by wrapping it in a functable.
_G.metamethod (x, n)Return given metamethod, if any, or nil.
_G.nodes (tr)Tree iterator.
_G.pack (...)Turn a tuple into a list.
_G.pickle (x)Convert a value to a string.
_G.prettytostring (t, indent, spacing)Pretty-print a table.
_G.render (x, open, close, elem, pair, sep, roots)Turn tables into strings with recursion detection.
_G.require_version (module, min, too_big, pattern)Require a module with a particular version
_G.ripairs (t)An iterator like ipairs, but in reverse.
_G.tostring (x)Extend tostring to work better on tables.
_G.totable (x)Turn an object into a table according to __totable metamethod.
_G.warn (...)Give warning with the name of program and file (if any).
render_CloseRenderer (t)
render_ElementRenderer (e)
render_OpenRenderer (t)
render_PairRenderer N.B. the function should not try to render i and v, or treat them recursively. (t, i, v, is, vs)
render_SeparatorRenderer (t, i, v, j, w)
tree_Iterator (it, tr, n)
+ + + + +

Tables

+ + + + + + + +
_G.opFunctional forms of infix operators.
+ + + +
+
+ + + +

Functions

+
+ + + +
_G.assert (v, f, ...)
+
+Extend to allow formatted arguments. + + +

Parameters

+
    + +
  • + v: value to assert +
  • + +
  • + f: format +
  • + +
  • + ...: arguments to format +
  • + +
+ + + + + + +

Return value:

+value + + + +
+ + + + +
_G.bind (f, ...)
+
+Partially apply a function. + + +

Parameters

+
    + +
  • + f: function to apply partially +
  • + +
  • + ...: arguments to bind +
  • + +
+ + + + + + +

Return value:

+function with ai already bound + + + +
+ + + + +
_G.collect (i, ...)
+
+Collect the results of an iterator. + + +

Parameters

+
    + +
  • + i: iterator +
  • + +
  • + ...: +
  • + +
+ + + + + + +

Return value:

+results of running the iterator on its arguments + + + +
+ + + + +
_G.compose (..., f1...fn)
+
+Compose functions. + + +

Parameters

+
    + +
  • + ...: +
  • + +
  • + f1...fn: functions to compose +
  • + +
+ + + + + + +

Return value:

+composition of f1 ... fn + + + +
+ + + + +
_G.curry (f, n)
+
+Curry a function. + + +

Parameters

+
    + +
  • + f: function to curry +
  • + +
  • + n: number of arguments +
  • + +
+ + + + + + +

Return value:

+curried version of f + + + +
+ + + + +
_G.die (...)
+
+Die with error. + + +

Parameters

+
    + +
  • + ...: arguments for format +
  • + +
+ + + + + + + + +
+ + + + +
_G.eval (s)
+
+Evaluate a string. + + +

Parameters

+
    + +
  • + s: string +
  • + +
+ + + + + + +

Return value:

+value of string + + + +
+ + + + +
_G.filter (p, i, ...)
+
+Filter an iterator with a predicate. + + +

Parameters

+
    + +
  • + p: predicate +
  • + +
  • + i: iterator +
  • + +
  • + ...: +
  • + +
+ + + + + + +

Return value:

+result table containing elements e for which p (e) + + + +
+ + + + +
_G.fold (f, d, i, ...)
+
+Fold a binary function into an iterator. + + +

Parameters

+
    + +
  • + f: function +
  • + +
  • + d: initial first argument +
  • + +
  • + i: iterator +
  • + +
  • + ...: +
  • + +
+ + + + + + +

Return value:

+result + + + +
+ + + + +
_G.id (...)
+
+Identity function. + + +

Parameters

+
    + +
  • + ...: +
  • + +
+ + + + + + +

Return value:

+the arguments passed to the function + + + +
+ + + + +
_G.ileaves (tr)
+
+Tree iterator which returns just numbered leaves, in order. + + +

Parameters

+
    + +
  • + tr: tree to iterate over +
  • + +
+ + + + + + +

Return values:

+
    + +
  1. iterator function + +
  2. the tree, as above + +
+ + + +
+ + + + +
_G.inodes (tr)
+
+Tree iterator over numbered nodes, in order. + + +

Parameters

+
    + +
  • + tr: tree to iterate over +
  • + +
+ + + + + + +

Return values:

+
    + +
  1. iterator function + +
  2. the tree, as above + +
+ + + +

See also:

+ + +
+ + + + +
_G.leaves (tr)
+
+Tree iterator which returns just leaves. + + +

Parameters

+
    + +
  • + tr: tree to iterate over +
  • + +
+ + + + + + +

Return values:

+
    + +
  1. iterator function + +
  2. the tree, as above + +
+ + + +
+ + + + +
_G.map (f, i, ...)
+
+Map a function over an iterator. + + +

Parameters

+
    + +
  • + f: function +
  • + +
  • + i: iterator +
  • + +
  • + ...: +
  • + +
+ + + + + + +

Return value:

+result table + + + +
+ + + + +
_G.memoize (fn)
+
+Memoize a function, by wrapping it in a functable. + + +

Parameters

+
    + +
  • + fn: function that returns a single result +
  • + +
+ + + + + + +

Return value:

+memoized function + + + +
+ + + + +
_G.metamethod (x, n)
+
+Return given metamethod, if any, or nil. + + +

Parameters

+
    + +
  • + x: object to get metamethod of +
  • + +
  • + n: name of metamethod to get +
  • + +
+ + + + + + +

Return value:

+metamethod function or nil if no metamethod or not a function + + + +
+ + + + +
_G.nodes (tr)
+
+Tree iterator. + + +

Parameters

+
    + +
  • + tr: tree to iterate over +
  • + +
+ + + + + + +

Return values:

+
    + +
  1. iterator function + +
  2. the tree, as above + +
+ + + +

See also:

+ + +
+ + + + +
_G.pack (...)
+
+Turn a tuple into a list. + + +

Parameters

+
    + +
  • + ...: tuple +
  • + +
+ + + + + + +

Return value:

+list + + + +
+ + + + +
_G.pickle (x)
+
+Convert a value to a string. The string can be passed to dostring to retrieve the value.
TODO: Make it work for recursive tables. + + +

Parameters

+
    + +
  • + x: object to pickle +
  • + +
+ + + + + + +

Return value:

+string such that eval (s) is the same value as x + + + +
+ + + + +
_G.prettytostring (t, indent, spacing)
+
+Pretty-print a table. + + +

Parameters

+
    + +
  • + t: table to print +
  • + +
  • + indent: indent between levels ["\t"] +
  • + +
  • + spacing: space before every line +
  • + +
+ + + + + + +

Return value:

+pretty-printed string + + + +
+ + + + +
_G.render (x, open, close, elem, pair, sep, roots)
+
+Turn tables into strings with recursion detection. N.B. Functions calling render should not recurse, or recursion detection will not work. + + +

Parameters

+
    + +
  • + x: object to convert to string +
  • + +
  • + open: open table renderer +
  • + +
  • + close: close table renderer +
  • + +
  • + elem: element renderer +
  • + +
  • + pair: pair renderer +
  • + +
  • + sep: separator renderer +
  • + +
  • + roots: +
  • + +
+ + + + + + +

Return value:

+string representation + + + +

See also:

+ + +
+ + + + +
_G.require_version (module, min, too_big, pattern)
+
+Require a module with a particular version + + +

Parameters

+
    + +
  • + module: module to require +
  • + +
  • + min: lowest acceptable version (default: any) +
  • + +
  • + too_big: lowest version that is too big (default: none) +
  • + +
  • + pattern: +
  • + +
+ + + + + + + + +
+ + + + +
_G.ripairs (t)
+
+An iterator like ipairs, but in reverse. + + +

Parameters

+
    + +
  • + t: table to iterate over +
  • + +
+ + + + + + +

Return values:

+
    + +
  1. iterator function + +
  2. the table, as above + +
  3. #t + 1 + +
+ + + +
+ + + + +
_G.tostring (x)
+
+Extend tostring to work better on tables. The original tostring is available as _tostring. + + +

Parameters

+
    + +
  • + x: object to convert to string +
  • + +
+ + + + + + +

Return value:

+string representation + + + +
+ + + + +
_G.totable (x)
+
+Turn an object into a table according to __totable metamethod. + + +

Parameters

+
    + +
  • + x: object to turn into a table +
  • + +
+ + + + + + +

Return value:

+table or nil + + + +
+ + + + +
_G.warn (...)
+
+Give warning with the name of program and file (if any). + + +

Parameters

+
    + +
  • + ...: arguments for format +
  • + +
+ + + + + + + + +
+ + + + +
render_CloseRenderer (t)
+
+ + + +

Parameters

+
    + +
  • + t: table +
  • + +
+ + + + + + +

Return value:

+close table string + + + +
+ + + + +
render_ElementRenderer (e)
+
+ + + +

Parameters

+
    + +
  • + e: element +
  • + +
+ + + + + + +

Return value:

+element string + + + +
+ + + + +
render_OpenRenderer (t)
+
+ + + +

Parameters

+
    + +
  • + t: table +
  • + +
+ + + + + + +

Return value:

+open table string + + + +
+ + + + +
render_PairRenderer N.B. the function should not try to render i and v, or treat them recursively. (t, i, v, is, vs)
+
+ + + +

Parameters

+
    + +
  • + t: table +
  • + +
  • + i: index +
  • + +
  • + v: value +
  • + +
  • + is: index string +
  • + +
  • + vs: value string +
  • + +
+ + + + + + +

Return value:

+element string + + + +
+ + + + +
render_SeparatorRenderer (t, i, v, j, w)
+
+ + + +

Parameters

+
    + +
  • + t: table +
  • + +
  • + i: preceding index (nil on first call) +
  • + +
  • + v: preceding value (nil on first call) +
  • + +
  • + j: following index (nil on last call) +
  • + +
  • + w: following value (nil on last call) +
  • + +
+ + + + + + +

Return value:

+separator string + + + +
+ + + + +
tree_Iterator (it, tr, n)
+
+ + + +

Parameters

+
    + +
  • + it: +
  • + +
  • + tr: +
  • + +
  • + n: current node +
  • + +
+ + + + + + +

Return values:

+
    + +
  1. type ("leaf", "branch" (pre-order) or "join" (post-order)) + +
  2. path to node ({i1...ik}) + +
  3. node + +
+ + + +
+ + +
+ + + + +

Tables

+
+ +
_G.op
+
Functional forms of infix operators. Defined here so that other modules can write to it. + + + +
+ + +
+ + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/modules/bin.html b/modules/bin.html new file mode 100644 index 0000000..3491814 --- /dev/null +++ b/modules/bin.html @@ -0,0 +1,328 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Module bin

+ +

Binary data utilities

+ + + + + +

Functions

+ + + + + + + + + + + + +
le_to_hex (s)Turn a little-endian word into a hex string
le_to_number (s)Turn a little-endian word into a number
+ + + + + + +
+
+ + + +

Functions

+
+ + + +
le_to_hex (s)
+
+Turn a little-endian word into a hex string + + +

Parameters

+
    + +
  • + s: +
  • + +
+ + + + + + + + +
+ + + + +
le_to_number (s)
+
+Turn a little-endian word into a number + + +

Parameters

+
    + +
  • + s: +
  • + +
+ + + + + + + + +
+ + +
+ + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/modules/debug.html b/modules/debug.html new file mode 100644 index 0000000..502ef24 --- /dev/null +++ b/modules/debug.html @@ -0,0 +1,343 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Module debug

+ +

Additions to the debug module

+ + + + + +

Functions

+ + + + + + + + + + + + + + + + + +
debug ()The global function debug is an abbreviation for debug.say (1, ...)
say (n, ...)Print a debugging message
trace (event)Trace function calls Use as debug.sethook (trace, "cr"), which is done automatically when _DEBUG.call is set.
+ + + + +

Tables

+ + + + + + + +
_DEBUGTo activate debugging set _DEBUG either to any true value (equivalent to {level = 1}), or as documented below.
+ + + +
+
+ + + +

Functions

+
+ + + +
debug ()
+
+The global function debug is an abbreviation for debug.say (1, ...) + + + + + + + + + +

See also:

+ + +
+ + + + +
say (n, ...)
+
+Print a debugging message + + +

Parameters

+
    + +
  • + n: debugging level, defaults to 1 +
  • + +
  • + ...: objects to print (as for print) +
  • + +
+ + + + + + + + +
+ + + + +
trace (event)
+
+Trace function calls Use as debug.sethook (trace, "cr"), which is done automatically when _DEBUG.call is set. Based on test/trace-calls.lua from the Lua distribution. + + +

Parameters

+
    + +
  • + event: event causing the call +
  • + +
+ + + + + + + + +
+ + +
+ + + + +

Tables

+
+ +
_DEBUG
+
To activate debugging set _DEBUG either to any true value (equivalent to {level = 1}), or as documented below. + + +Fields +
    + +
  • + level: debugging level +
  • + +
  • + call: do call trace debugging +
  • + +
  • + std: do standard library debugging (run examples & test code) +
  • + +
+ + +
+ + +
+ + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/modules/fstable.html b/modules/fstable.html new file mode 100644 index 0000000..f998230 --- /dev/null +++ b/modules/fstable.html @@ -0,0 +1,304 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Module fstable

+ +

Tables mapped to the filing system Only string keys are permitted; package.dirsep characters are converted to underscores. Values are stored as strings (converted by tostring). As with disk operations, a table's elements must be set to nil (deleted) before the table itself can be set to nil.

+ + + + + +

Functions

+ + + + + + + +
new (path, t)Bind a directory to a table
+ + + + + + +
+
+ + + +

Functions

+
+ + + +
new (path, t)
+
+Bind a directory to a table + + +

Parameters

+
    + +
  • + path: directory path +
  • + +
  • + t: table to merge with directory +
  • + +
+ + + + + + +

Return value:

+table bound to directory + + + +
+ + +
+ + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/modules/getopt.html b/modules/getopt.html new file mode 100644 index 0000000..0a6f18f --- /dev/null +++ b/modules/getopt.html @@ -0,0 +1,473 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Module getopt

+ +

Simplified getopt, based on Svenne Panne's Haskell GetOpt.
Usage:

  • options = {Option {...}, ...}
    getopt.processArgs ()
  • Assumes prog = {name[, banner] [, purpose] [, notes] [, usage]}
  • Options take a single dash, but may have a double dash.
  • Arguments may be given as -opt=arg or -opt arg.
  • If an option taking an argument is given multiple times, only the last value is returned; missing arguments are returned as 1.
getOpt, usageInfo and usage can be called directly (see below, and the example at the end). Set _DEBUG.std to a non-nil value to run the example.
  • TODO: Sort out the packaging. getopt.Option is tedious to type, but surely Option shouldn't be in the root namespace?
  • TODO: Wrap all messages; do all wrapping in processArgs, not usageInfo; use sdoc-like library (see string.format todos).
  • TODO: Don't require name to be repeated in banner.
  • TODO: Store version separately (construct banner?).

+ + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
getOpt (argIn, options)Perform argument processing
makeOptions (t)Options table constructor: adds lookup tables for the option names
processArgs ()Simple getOpt wrapper.
usage ()Emit a usage message.
usageInfo (header, optDesc, pageWidth)Produce usage info for the given options
+ + + + +

Tables

+ + + + + + + +
_G.OptionOptions table type.
+ + + +
+
+ + + +

Functions

+
+ + + +
getOpt (argIn, options)
+
+Perform argument processing + + +

Parameters

+
    + +
  • + argIn: list of command-line args +
  • + +
  • + options: options table +
  • + +
+ + + + + + +

Return values:

+
    + +
  1. table of remaining non-options + +
  2. table of option key-value list pairs + +
  3. table of error messages + +
+ + + +
+ + + + +
makeOptions (t)
+
+Options table constructor: adds lookup tables for the option names + + +

Parameters

+
    + +
  • + t: +
  • + +
+ + + + + + + + +
+ + + + +
processArgs ()
+
+Simple getOpt wrapper. Adds -version/-V and -help/-h automatically; stops program if there was an error, or if -help or -version was used. + + + + + + + + + +
+ + + + +
usage ()
+
+Emit a usage message. + + + + + + + + + +
+ + + + +
usageInfo (header, optDesc, pageWidth)
+
+Produce usage info for the given options + + +

Parameters

+
    + +
  • + header: header string +
  • + +
  • + optDesc: option descriptors +
  • + +
  • + pageWidth: width to format to [78] +
  • + +
+ + + + + + +

Return value:

+formatted string + + + +
+ + +
+ + + + +

Tables

+
+ +
_G.Option
+
Options table type. + + +Fields +
    + +
  • + name: list of names +
  • + +
  • + desc: description of this option +
  • + +
  • + type: type of argument (if any): Req(uired), Opt(ional) +
  • + +
  • + var: descriptive name for the argument +
  • + +
+ + +
+ + +
+ + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/modules/io.html b/modules/io.html new file mode 100644 index 0000000..8f7f7b4 --- /dev/null +++ b/modules/io.html @@ -0,0 +1,476 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Module io

+ +

Additions to the io module

+ + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
catdir (...)Concatenate two or more directories into a path, removing the trailing slash.
catfile (...)Concatenate one or more directories and a filename into a path.
processFiles (f)Process files specified on the command-line.
readlines (h)Read a file or file handle into a list of lines.
shell (c)Perform a shell command and return its output.
slurp (h)Slurp a file handle.
splitdir (path)Split a directory path into components.
writelines (h, ...)Write values adding a newline after each.
+ + + + + + +
+
+ + + +

Functions

+
+ + + +
catdir (...)
+
+Concatenate two or more directories into a path, removing the trailing slash. + + +

Parameters

+
    + +
  • + ...: path components +
  • + +
+ + + + + + +

Return value:

+path + + + +
+ + + + +
catfile (...)
+
+Concatenate one or more directories and a filename into a path. + + +

Parameters

+
    + +
  • + ...: path components +
  • + +
+ + + + + + +

Return value:

+path + + + +
+ + + + +
processFiles (f)
+
+Process files specified on the command-line. If no files given, process io.stdin; in list of files, - means io.stdin.
FIXME: Make the file list an argument to the function. + + +

Parameters

+
    + +
  • + f: function to process files with, which is passed (name, arg_no) +
  • + +
+ + + + + + + + +
+ + + + +
readlines (h)
+
+Read a file or file handle into a list of lines. + + +

Parameters

+
    + +
  • + h: file handle or name (default: io.input ()); if h is a handle, the file is closed after reading +
  • + +
+ + + + + + +

Return value:

+list of lines + + + +
+ + + + +
shell (c)
+
+Perform a shell command and return its output. + + +

Parameters

+
    + +
  • + c: command +
  • + +
+ + + + + + +

Return value:

+output, or nil if error + + + +
+ + + + +
slurp (h)
+
+Slurp a file handle. + + +

Parameters

+
    + +
  • + h: file handle or name (default: io.input ()) +
  • + +
+ + + + + + +

Return value:

+contents of file or handle, or nil if error + + + +
+ + + + +
splitdir (path)
+
+Split a directory path into components. Empty components are retained: the root directory becomes {"", ""}. + + +

Parameters

+
    + +
  • + path: path +
  • + +
+ + + + + + +

Return value:

+list of path components + + + +
+ + + + +
writelines (h, ...)
+
+Write values adding a newline after each. + + +

Parameters

+
    + +
  • + h: file handle (default: io.output () +
  • + +
  • + ...: values to write (as for write) +
  • + +
+ + + + + + + + +
+ + +
+ + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/modules/lcs.html b/modules/lcs.html new file mode 100644 index 0000000..7dc03d2 --- /dev/null +++ b/modules/lcs.html @@ -0,0 +1,308 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Module lcs

+ +

Longest Common Subsequence algorithm. After pseudo-code in lecture notes by David Eppstein.

+ + + + + +

Functions

+ + + + + + + +
longestCommonSubseq (a, b, s)Find the longest common subsequence of two sequences.
+ + + + + + +
+
+ + + +

Functions

+
+ + + +
longestCommonSubseq (a, b, s)
+
+Find the longest common subsequence of two sequences. The sequence objects must have an __append metamethod. This is provided by string_ext for strings, and by list for lists. + + +

Parameters

+
    + +
  • + a: first sequence +
  • + +
  • + b: second sequence +
  • + +
  • + s: an empty sequence of the same type, to hold the result +
  • + +
+ + + + + + +

Return value:

+the LCS of a and b + + + +
+ + +
+ + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/modules/list.html b/modules/list.html new file mode 100644 index 0000000..002336a --- /dev/null +++ b/modules/list.html @@ -0,0 +1,1212 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Module list

+ +

Tables as lists.

+ + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
append (l, x)Append an item to a list.
compare (l, m)Compare two lists element by element left-to-right
concat (...)Concatenate lists.
cons (l, x)Prepend an item to a list.
depair (ls)Turn a list of pairs into a table.
elems (l)An iterator over the elements of a list.
enpair (t)Turn a table into a list of pairs.
filter (p, l)Filter a list according to a predicate.
flatten (l)Flatten a list.
foldl (f, e, l)Fold a binary function through a list left associatively.
foldr (f, e, l)Fold a binary function through a list right associatively.
indexKey (f, l)Make an index of a list of tables on a given field
indexValue (f, l)Copy a list of tables, indexed on a given field
map (f, l)Map a function over a list.
mapWith (f, l, ls)Map a function over a list of lists.
new (l, t)List constructor.
project (f, l)Project a list of fields from a list of tables.
relems (l)An iterator over the elements of a list, in reverse.
rep (l, n)Repeat a list.
reverse (l)Reverse a list.
shape (s, l)Shape a list according to a list of dimensions.
slice (l, from, to)Return a slice of a list.
tail (l)Return a list with its first element removed.
transpose (ls)Transpose a list of lists.
zipWith (f, ls)Zip lists together with a function.
+ + + + + + +
+
+ + + +

Functions

+
+ + + +
append (l, x)
+
+Append an item to a list. + + +

Parameters

+
    + +
  • + l: list +
  • + +
  • + x: item +
  • + +
+ + + + + + +

Return value:

+{l[1], ..., l[#l], x} + + + +
+ + + + +
compare (l, m)
+
+Compare two lists element by element left-to-right + + +

Parameters

+
    + +
  • + l: first list +
  • + +
  • + m: second list +
  • + +
+ + + + + + +

Return value:

+-1 if l is less than m, 0 if they are the same, and 1 if l is greater than m + + + +
+ + + + +
concat (...)
+
+Concatenate lists. + + +

Parameters

+
    + +
  • + ...: lists +
  • + +
+ + + + + + +

Return value:

+{l1[1], ..., l1[#l1], ..., ln[1], ..., ln[#ln]} + + + +
+ + + + +
cons (l, x)
+
+Prepend an item to a list. + + +

Parameters

+
    + +
  • + l: list +
  • + +
  • + x: item +
  • + +
+ + + + + + +

Return value:

+{x, unpack (l)} + + + +
+ + + + +
depair (ls)
+
+Turn a list of pairs into a table.
FIXME: Find a better name. + + +

Parameters

+
    + +
  • + ls: list {{i1, v1}, ..., {in, vn}} +
  • + +
+ + + + + + +

Return value:

+table {i1=v1, ..., in=vn} + + + +
+ + + + +
elems (l)
+
+An iterator over the elements of a list. + + +

Parameters

+
    + +
  • + l: list to iterate over +
  • + +
+ + + + + + +

Return values:

+
    + +
  1. iterator function which returns successive elements of the list + +
  2. the list l as above + +
  3. true + +
+ + + +
+ + + + +
enpair (t)
+
+Turn a table into a list of pairs.
FIXME: Find a better name. + + +

Parameters

+
    + +
  • + t: table {i1=v1, ..., in=vn} +
  • + +
+ + + + + + +

Return value:

+list {{i1, v1}, ..., {in, vn}} + + + +
+ + + + +
filter (p, l)
+
+Filter a list according to a predicate. + + +

Parameters

+
    + +
  • + p: predicate (function of one argument returning a boolean) +
  • + +
  • + l: list of lists +
  • + +
+ + + + + + +

Return value:

+result list containing elements e of l for which p (e) is true + + + +
+ + + + +
flatten (l)
+
+Flatten a list. + + +

Parameters

+
    + +
  • + l: list to flatten +
  • + +
+ + + + + + +

Return value:

+flattened list + + + +
+ + + + +
foldl (f, e, l)
+
+Fold a binary function through a list left associatively. + + +

Parameters

+
    + +
  • + f: function +
  • + +
  • + e: element to place in left-most position +
  • + +
  • + l: list +
  • + +
+ + + + + + +

Return value:

+result + + + +
+ + + + +
foldr (f, e, l)
+
+Fold a binary function through a list right associatively. + + +

Parameters

+
    + +
  • + f: function +
  • + +
  • + e: element to place in right-most position +
  • + +
  • + l: list +
  • + +
+ + + + + + +

Return value:

+result + + + +
+ + + + +
indexKey (f, l)
+
+Make an index of a list of tables on a given field + + +

Parameters

+
    + +
  • + f: field +
  • + +
  • + l: list of tables {t1, ..., tn} +
  • + +
+ + + + + + +

Return value:

+index {t1[f]=1, ..., tn[f]=n} + + + +
+ + + + +
indexValue (f, l)
+
+Copy a list of tables, indexed on a given field + + +

Parameters

+
    + +
  • + f: field whose value should be used as index +
  • + +
  • + l: list of tables {i1=t1, ..., in=tn} +
  • + +
+ + + + + + +

Return value:

+index {t1[f]=t1, ..., tn[f]=tn} + + + +
+ + + + +
map (f, l)
+
+Map a function over a list. + + +

Parameters

+
    + +
  • + f: function +
  • + +
  • + l: list +
  • + +
+ + + + + + +

Return value:

+result list {f (l[1]), ..., f (l[#l])} + + + +
+ + + + +
mapWith (f, l, ls)
+
+Map a function over a list of lists. + + +

Parameters

+
    + +
  • + f: function +
  • + +
  • + l: +
  • + +
  • + ls: list of lists +
  • + +
+ + + + + + +

Return value:

+result list {f (unpack (ls[1]))), ..., f (unpack (ls[#ls]))} + + + +
+ + + + +
new (l, t)
+
+List constructor. Needed in order to use metamethods. + + +

Parameters

+
    + +
  • + l: +
  • + +
  • + t: list (as a table) +
  • + +
+ + + + + + +

Return value:

+list (with list metamethods) + + + +
+ + + + +
project (f, l)
+
+Project a list of fields from a list of tables. + + +

Parameters

+
    + +
  • + f: field to project +
  • + +
  • + l: list of tables +
  • + +
+ + + + + + +

Return value:

+list of f fields + + + +
+ + + + +
relems (l)
+
+An iterator over the elements of a list, in reverse. + + +

Parameters

+
    + +
  • + l: list to iterate over +
  • + +
+ + + + + + +

Return values:

+
    + +
  1. iterator function which returns precessive elements of the list + +
  2. the list l as above + +
  3. true + +
+ + + +
+ + + + +
rep (l, n)
+
+Repeat a list. + + +

Parameters

+
    + +
  • + l: list +
  • + +
  • + n: number of times to repeat +
  • + +
+ + + + + + +

Return value:

+n copies of l appended together + + + +
+ + + + +
reverse (l)
+
+Reverse a list. + + +

Parameters

+
    + +
  • + l: list +
  • + +
+ + + + + + +

Return value:

+list {l[#l], ..., l[1]} + + + +
+ + + + +
shape (s, l)
+
+Shape a list according to a list of dimensions. Dimensions are given outermost first and items from the original list are distributed breadth first; there may be one 0 indicating an indefinite number. Hence, {0} is a flat list, {1} is a singleton, {2, 0} is a list of two lists, and {0, 2} is a list of pairs.
Algorithm: turn shape into all positive numbers, calculating the zero if necessary and making sure there is at most one; recursively walk the shape, adding empty tables until the bottom level is reached at which point add table items instead, using a counter to walk the flattened original list.
+ + +

Parameters

+
    + +
  • + s: {d1, ..., dn} +
  • + +
  • + l: list to reshape +
  • + +
+ + + + + + +

Return value:

+reshaped list FIXME: Use ileaves instead of flatten (needs a while instead of a for in fill function) + + + +
+ + + + +
slice (l, from, to)
+
+Return a slice of a list. (Negative list indices count from the end of the list.) + + +

Parameters

+
    + +
  • + l: list +
  • + +
  • + from: start of slice (default: 1) +
  • + +
  • + to: end of slice (default: #l) +
  • + +
+ + + + + + +

Return value:

+{l[from], ..., l[to]} + + + +
+ + + + +
tail (l)
+
+Return a list with its first element removed. + + +

Parameters

+
    + +
  • + l: list +
  • + +
+ + + + + + +

Return value:

+{l[2], ..., l[#l]} + + + +
+ + + + +
transpose (ls)
+
+Transpose a list of lists. This function in Lua is equivalent to zip and unzip in more strongly typed languages. + + +

Parameters

+
    + +
  • + ls: {{l1,1, ..., l1,c}, ..., {lr,1, ..., lr,c}} +
  • + +
+ + + + + + +

Return value:

+{{l1,1, ..., lr,1}, ..., {l1,c, ..., lr,c}} + + + +
+ + + + +
zipWith (f, ls)
+
+Zip lists together with a function. + + +

Parameters

+
    + +
  • + f: function +
  • + +
  • + ls: list of lists +
  • + +
+ + + + + + +

Return value:

+{f (ls[1][1], ..., ls[#ls][1]), ..., f (ls[1][N], ..., ls[#ls][N]) where N = max {map (function (l) return #l end, ls)} + + + +
+ + +
+ + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/modules/math.html b/modules/math.html new file mode 100644 index 0000000..019911f --- /dev/null +++ b/modules/math.html @@ -0,0 +1,282 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Module math

+ +

Additions to the math module.

+ + + + + +

Functions

+ + + + + + + + + + + + +
floor (n, p)Extend math.floor to take the number of decimal places.
round (n, p)Round a number to a given number of decimal places
+ + + + + + +
+
+ + + +

Functions

+
+ + + +
floor (n, p)
+
+Extend math.floor to take the number of decimal places. + + +

Parameters

+
    + +
  • + n: number +
  • + +
  • + p: number of decimal places to truncate to (default: 0) +
  • + +
+ + + + + + +

Return value:

+n truncated to p decimal places + + + +
+ + + + +
round (n, p)
+
+Round a number to a given number of decimal places + + +

Parameters

+
    + +
  • + n: number +
  • + +
  • + p: number of decimal places to round to (default: 0) +
  • + +
+ + + + + + +

Return value:

+n rounded to p decimal places + + + +
+ + +
+ + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/modules/mbox.html b/modules/mbox.html new file mode 100644 index 0000000..4e5d5ed --- /dev/null +++ b/modules/mbox.html @@ -0,0 +1,300 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Module mbox

+ +

mbox parser. Based on code by Diego Nahab.

+ + + + + +

Functions

+ + + + + + + +
parse (s)Parse a mailbox into messages.
+ + + + + + +
+
+ + + +

Functions

+
+ + + +
parse (s)
+
+Parse a mailbox into messages. + + +

Parameters

+
    + +
  • + s: mailbox as a string +
  • + +
+ + + + + + +

Return value:

+list of messages, each of form {header = {...}, body = "..."} + + + +
+ + +
+ + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/modules/object.html b/modules/object.html new file mode 100644 index 0000000..6522980 --- /dev/null +++ b/modules/object.html @@ -0,0 +1,292 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Module object

+ +

Prototype-based objects

  • Create an object/class:
    • Either, if the _init field is a list:
      • object/Class = prototype {value, ...; field = value, ...}
      • Named values are assigned to the corresponding fields, and unnamed values to the fields given by _init.
    • Or, if the _init field is a function:
      • object/Class = prototype (value, ...)
      • The given values are passed as arguments to the _init function.
    • An object's metatable is itself.
    • Private fields and methods start with "_".
  • Access an object field: object.field
  • Call an object method: object:method (...)
  • Call a class method: Class.method (object, ...)
  • Add a field: object.field = x
  • Add a method: function object:method (...) ... end
  • + + + + + + + + +

    Tables

    + + + + + + + +
    ObjectRoot object
    + + + +
    +
    + + + + + + +

    Tables

    +
    + +
    Object
    +
    Root object + + +Fields +
      + +
    • + _init: constructor method or list of fields to be initialised by the constructor +
    • + +
    • + _clone: object constructor which provides the behaviour for _init documented above +
    • + +
    + + +
    + + +
    + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/modules/package.html b/modules/package.html new file mode 100644 index 0000000..ce97e71 --- /dev/null +++ b/modules/package.html @@ -0,0 +1,256 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Module package

+ +

+ + + + + + + + +

Tables

+ + + + + + + +
packageMake named constants for package.config (undocumented in 5.1; see luaconf.h for C equivalents).
+ + + +
+
+ + + + + + +

Tables

+
+ +
package
+
Make named constants for package.config (undocumented in 5.1; see luaconf.h for C equivalents). + + +Fields +
    + +
  • + dirsep: directory separator +
  • + +
  • + pathsep: path separator +
  • + +
  • + path_mark: string that marks substitution points in a path template +
  • + +
  • + execdir: (Windows only) replaced by the executable's directory in a path +
  • + +
  • + igmark: Mark to ignore all before it when building luaopen_ function name. +
  • + +
+ + +
+ + +
+ + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/modules/parser.html b/modules/parser.html new file mode 100644 index 0000000..9c6c08e --- /dev/null +++ b/modules/parser.html @@ -0,0 +1,342 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Module parser

+ +

Parser generator.

A parser is created by

p = Parser {grammar}

and called with

result = p:parse (start_token, token_list[, from])

where start_token is the non-terminal at which to start parsing in the grammar, token_list is a list of tokens of the form

{ty = "token_type", tok = "token_text"}

and from is the token in the list from which to start (the default value is 1).

The output of the parser is a tree, each of whose nodes is of the form:

{ty = symbol, node1 = tree1, node2 = tree2, ... [, list]}

where each nodei is a symbolic name, and list is the list of trees returned if the corresponding token was a list token.

A grammar is a table of rules of the form

non-terminal = {production1, production2, ...}

plus a special item

lexemes = Set {"class1", "class2", ...}

Each production gives a form that a non-terminal may take. A production has the form

production = {"token1", "token2", ..., [action][,abstract]}

A production

  • must not start with the non-terminal being defined (it must not be left-recursive)
  • must not be a prefix of a later production in the same non-terminal

Each token may be

  • a non-terminal, i.e. a token defined by the grammar
    • an optional symbol is indicated by the suffix _opt
    • a list is indicated by the suffix _list, and may be followed by _≤separator-symbol> (default is no separator)
  • a lexeme class
  • a string to match literally

The parse tree for a literal string or lexeme class is the string that was matched. The parse tree for a non-terminal is a table of the form

{ty = "non_terminal_name", tree1, tree2, ...}

where the treei are the parse trees for the corresponding terminals and non-terminals.

An action is of the form

action = function (tree, token, pos) ... return tree_ end

It is passed the parse tree for the current node, the token list, and the current position in the token list, and returns a new parse tree.

An abstract syntax rule is of the form

name = {i1, i2, ...}

where i1, i2, ... are numbers. This results in a parse tree of the form

{ty = "name"; treei1, treei2, ...}

If a production has no abstract syntax rule, the result is the parse node for the current node.

FIXME: Give lexemes as an extra argument to Parser?
FIXME: Rename second argument to parse method to "tokens"?
FIXME: Make start_token an optional argument to parse? (swap with token list) and have it default to the first non-terminal?

+ + + + + +

Functions

+ + + + + + + + + + + + +
Parser:_init (grammar)Parser constructor
Parser:parse (start, token, from)Parse a token list.
+ + + + + + +
+
+ + + +

Functions

+
+ + + +
Parser:_init (grammar)
+
+Parser constructor + + +

Parameters

+
    + +
  • + grammar: parser grammar +
  • + +
+ + + + + + +

Return value:

+parser + + + +
+ + + + +
Parser:parse (start, token, from)
+
+Parse a token list. + + +

Parameters

+
    + +
  • + start: the token at which to start +
  • + +
  • + token: the list of tokens +
  • + +
  • + from: the index of the token to start from (default: 1) +
  • + +
+ + + + + + +

Return value:

+parse tree + + + +
+ + +
+ + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/modules/set.html b/modules/set.html new file mode 100644 index 0000000..90cd4e8 --- /dev/null +++ b/modules/set.html @@ -0,0 +1,640 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Module set

+ +

+ + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
delete (s, e)Delete an element from a set
difference (s, t)Find the difference of two sets
equal (s, t)Find whether two sets are equal
insert (s, e)Insert an element into a set
intersection (s, t)Find the intersection of two sets
member (s, e)Say whether an element is in a set
propersubset (s, t)Find whether one set is a proper subset of another
subset (s, t)Find whether one set is a subset of another
symmetric_difference (s, t)Find the symmetric difference of two sets
union (s, t)Find the union of two sets
+ + + + + + +
+
+ + + +

Functions

+
+ + + +
delete (s, e)
+
+Delete an element from a set + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + e: element +
  • + +
+ + + + + + + + +
+ + + + +
difference (s, t)
+
+Find the difference of two sets + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + t: set +
  • + +
+ + + + + + +

Return value:

+s with elements of t removed + + + +
+ + + + +
equal (s, t)
+
+Find whether two sets are equal + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + t: set +
  • + +
+ + + + + + +

Return value:

+true if sets are equal, false otherwise + + + +
+ + + + +
insert (s, e)
+
+Insert an element into a set + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + e: element +
  • + +
+ + + + + + + + +
+ + + + +
intersection (s, t)
+
+Find the intersection of two sets + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + t: set +
  • + +
+ + + + + + +

Return value:

+set intersection of s and t + + + +
+ + + + +
member (s, e)
+
+Say whether an element is in a set + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + e: element +
  • + +
+ + + + + + +

Return value:

+true if e is in set, false otherwise + + + +
+ + + + +
propersubset (s, t)
+
+Find whether one set is a proper subset of another + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + t: set +
  • + +
+ + + + + + +

Return value:

+true if s is a proper subset of t, false otherwise + + + +
+ + + + +
subset (s, t)
+
+Find whether one set is a subset of another + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + t: set +
  • + +
+ + + + + + +

Return value:

+true if s is a subset of t, false otherwise + + + +
+ + + + +
symmetric_difference (s, t)
+
+Find the symmetric difference of two sets + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + t: set +
  • + +
+ + + + + + +

Return value:

+elements of s and t that are in s or t but not both + + + +
+ + + + +
union (s, t)
+
+Find the union of two sets + + +

Parameters

+
    + +
  • + s: set +
  • + +
  • + t: set +
  • + +
+ + + + + + +

Return value:

+set union of s and t + + + +
+ + +
+ + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/modules/std.html b/modules/std.html new file mode 100644 index 0000000..907beef --- /dev/null +++ b/modules/std.html @@ -0,0 +1,256 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Module std

+ +

Lua standard library

  • TODO: Write a style guide (indenting/wrapping, capitalisation, function and variable names); library functions should call error, not die; OO vs non-OO (a thorny problem).
  • TODO: Add tests for each function immediately after the function; this also helps to check module dependencies.
  • TODO: pre-compile.

+ + + + + + + + + + +
+
+ + + + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/modules/strbuf.html b/modules/strbuf.html new file mode 100644 index 0000000..e6b6aca --- /dev/null +++ b/modules/strbuf.html @@ -0,0 +1,338 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Module strbuf

+ +

String buffers

+ + + + + +

Functions

+ + + + + + + + + + + + +
concat (b, s)Add a string to a buffer
tostring (b)Convert a buffer to a string
+ + + + + + +
+
+ + + +

Functions

+
+ + + +
concat (b, s)
+
+Add a string to a buffer + + +

Parameters

+
    + +
  • + b: buffer +
  • + +
  • + s: string to add +
  • + +
+ + + + + + +

Return value:

+buffer + + + +
+ + + + +
tostring (b)
+
+Convert a buffer to a string + + +

Parameters

+
    + +
  • + b: buffer +
  • + +
+ + + + + + +

Return value:

+string + + + +
+ + +
+ + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/modules/string.html b/modules/string.html new file mode 100644 index 0000000..12ebe16 --- /dev/null +++ b/modules/string.html @@ -0,0 +1,717 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Module string

+ +

Additions to the string module TODO: Pretty printing (use in getopt); see source for details.

+ + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
caps (s)Capitalise each word in a string.
chomp (s)Remove any final newline from a string.
escapePattern (s)Escape a string to be used as a pattern
finds (s, p, init, plain)Do multiple finds on a string.
ltrim (s, r)Remove leading matter from a string.
numbertosi (n)Write a number using SI suffixes.
ordinalSuffix (n)Return the English suffix for an ordinal.
pad (s, w, p)Justify a string.
rtrim (s, r)Remove trailing matter from a string.
split (s, sep)Split a string at a given separator.
tfind (s, p, init, plain)Do find, returning captures as a list.
trim (s, r)Remove leading and trailing matter from a string.
wrap (s, w, ind, ind1)Wrap a string into a paragraph.
+ + + + + + +
+
+ + + +

Functions

+
+ + + +
caps (s)
+
+Capitalise each word in a string. + + +

Parameters

+
    + +
  • + s: string +
  • + +
+ + + + + + +

Return value:

+capitalised string + + + +
+ + + + +
chomp (s)
+
+Remove any final newline from a string. + + +

Parameters

+
    + +
  • + s: string to process +
  • + +
+ + + + + + +

Return value:

+processed string + + + +
+ + + + +
escapePattern (s)
+
+Escape a string to be used as a pattern + + +

Parameters

+
    + +
  • + s: string to process @return +
  • + +
+ + + + + + + + +
+ + + + +
finds (s, p, init, plain)
+
+Do multiple finds on a string. + + +

Parameters

+
    + +
  • + s: target string +
  • + +
  • + p: pattern +
  • + +
  • + init: start position (default: 1) +
  • + +
  • + plain: inhibit magic characters (default: nil) +
  • + +
+ + + + + + +

Return value:

+list of {from, to; capt = {captures}} + + + +
+ + + + +
ltrim (s, r)
+
+Remove leading matter from a string. + + +

Parameters

+
    + +
  • + s: string +
  • + +
  • + r: leading regex (default: "%s+") +
  • + +
+ + + + + + +

Return value:

+string without leading r + + + +
+ + + + +
numbertosi (n)
+
+Write a number using SI suffixes. The number is always written to 3 s.f. + + +

Parameters

+
    + +
  • + n: number +
  • + +
+ + + + + + +

Return value:

+string + + + +
+ + + + +
ordinalSuffix (n)
+
+Return the English suffix for an ordinal. + + +

Parameters

+
    + +
  • + n: number of the day +
  • + +
+ + + + + + +

Return value:

+suffix + + + +
+ + + + +
pad (s, w, p)
+
+Justify a string. When the string is longer than w, it is truncated (left or right according to the sign of w). + + +

Parameters

+
    + +
  • + s: string to justify +
  • + +
  • + w: width to justify to (-ve means right-justify; +ve means left-justify) +
  • + +
  • + p: string to pad with (default: " ") +
  • + +
+ + + + + + +

Return value:

+justified string + + + +
+ + + + +
rtrim (s, r)
+
+Remove trailing matter from a string. + + +

Parameters

+
    + +
  • + s: string +
  • + +
  • + r: trailing regex (default: "%s+") +
  • + +
+ + + + + + +

Return value:

+string without trailing r + + + +
+ + + + +
split (s, sep)
+
+Split a string at a given separator. FIXME: Consider Perl and Python versions. + + +

Parameters

+
    + +
  • + s: string to split +
  • + +
  • + sep: separator regex +
  • + +
+ + + + + + +

Return value:

+list of strings + + + +
+ + + + +
tfind (s, p, init, plain)
+
+Do find, returning captures as a list. + + +

Parameters

+
    + +
  • + s: target string +
  • + +
  • + p: pattern +
  • + +
  • + init: start position (default: 1) +
  • + +
  • + plain: inhibit magic characters (default: nil) +
  • + +
+ + + + + + +

Return value:

+start of match, end of match, table of captures + + + +
+ + + + +
trim (s, r)
+
+Remove leading and trailing matter from a string. + + +

Parameters

+
    + +
  • + s: string +
  • + +
  • + r: leading/trailing regex (default: "%s+") +
  • + +
+ + + + + + +

Return value:

+string without leading/trailing r + + + +
+ + + + +
wrap (s, w, ind, ind1)
+
+Wrap a string into a paragraph. + + +

Parameters

+
    + +
  • + s: string to wrap +
  • + +
  • + w: width to wrap to (default: 78) +
  • + +
  • + ind: indent (default: 0) +
  • + +
  • + ind1: indent of first line (default: ind) +
  • + +
+ + + + + + +

Return value:

+wrapped paragraph + + + +
+ + +
+ + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/modules/table.html b/modules/table.html new file mode 100644 index 0000000..f83fba0 --- /dev/null +++ b/modules/table.html @@ -0,0 +1,578 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Module table

+ +

+ + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
clone (t, nometa)Make a shallow copy of a table, including any metatable (for a deep copy, use tree.clone).
clone_rename (map, t)Clone a table, renaming some keys.
empty (t)Return whether table is empty.
invert (t)Invert a table.
keys (t)Make the list of keys of a table.
merge (t, u)Merge one table into another.
new (x, t)Make a table with a default value for unset keys.
size (t)Find the number of elements in a table.
sort (t, c)Make table.sort return its result.
values (t)Make the list of values of a table.
+ + + + + + +
+
+ + + +

Functions

+
+ + + +
clone (t, nometa)
+
+Make a shallow copy of a table, including any metatable (for a deep copy, use tree.clone). + + +

Parameters

+
    + +
  • + t: table +
  • + +
  • + nometa: if non-nil don't copy metatable +
  • + +
+ + + + + + +

Return value:

+copy of table + + + +
+ + + + +
clone_rename (map, t)
+
+Clone a table, renaming some keys. + + +

Parameters

+
    + +
  • + map: table {old_key=new_key, ...} +
  • + +
  • + t: table to copy +
  • + +
+ + + + + + +

Return value:

+copy of table + + + +
+ + + + +
empty (t)
+
+Return whether table is empty. + + +

Parameters

+
    + +
  • + t: table +
  • + +
+ + + + + + +

Return value:

+true if empty or false otherwise + + + +
+ + + + +
invert (t)
+
+Invert a table. + + +

Parameters

+
    + +
  • + t: table {i=v, ...} +
  • + +
+ + + + + + +

Return value:

+inverted table {v=i, ...} + + + +
+ + + + +
keys (t)
+
+Make the list of keys of a table. + + +

Parameters

+
    + +
  • + t: table +
  • + +
+ + + + + + +

Return value:

+list of keys + + + +
+ + + + +
merge (t, u)
+
+Merge one table into another. u is merged into t. + + +

Parameters

+
    + +
  • + t: first table +
  • + +
  • + u: second table +
  • + +
+ + + + + + +

Return value:

+first table + + + +
+ + + + +
new (x, t)
+
+Make a table with a default value for unset keys. + + +

Parameters

+
    + +
  • + x: default entry value (default: nil) +
  • + +
  • + t: initial table (default: {}) +
  • + +
+ + + + + + +

Return value:

+table whose unset elements are x + + + +
+ + + + +
size (t)
+
+Find the number of elements in a table. + + +

Parameters

+
    + +
  • + t: table +
  • + +
+ + + + + + +

Return value:

+number of elements in t + + + +
+ + + + +
sort (t, c)
+
+Make table.sort return its result. + + +

Parameters

+
    + +
  • + t: table +
  • + +
  • + c: comparator function +
  • + +
+ + + + + + +

Return value:

+sorted table + + + +
+ + + + +
values (t)
+
+Make the list of values of a table. + + +

Parameters

+
    + +
  • + t: table +
  • + +
+ + + + + + +

Return value:

+list of values + + + +
+ + +
+ + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + diff --git a/modules/tree.html b/modules/tree.html new file mode 100644 index 0000000..543f3b6 --- /dev/null +++ b/modules/tree.html @@ -0,0 +1,415 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Module tree

+ +

Tables as trees.

+ + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + +
clone (t, nometa)Make a deep copy of a tree, including any metatables
metatable.__index (tr, i)Tree __index metamethod.
metatable.__newindex (tr, i, v)Tree __newindex metamethod.
new (t)Make a table into a tree
+ + + + + + +
+
+ + + +

Functions

+
+ + + +
clone (t, nometa)
+
+Make a deep copy of a tree, including any metatables + + +

Parameters

+
    + +
  • + t: table +
  • + +
  • + nometa: if non-nil don't copy metatables +
  • + +
+ + + + + + +

Return value:

+copy of table + + + +
+ + + + +
metatable.__index (tr, i)
+
+Tree __index metamethod. + + +

Parameters

+
    + +
  • + tr: tree +
  • + +
  • + i: non-table, or list of keys {i1 ... in} +
  • + +
+ + + + + + +

Return value:

+tr[i]...[in] if i is a table, or tr[i] otherwise + + + +
+ + + + +
metatable.__newindex (tr, i, v)
+
+Tree __newindex metamethod. Sets tr[i1]...[in] = v if i is a table, or tr[i] = v otherwise + + +

Parameters

+
    + +
  • + tr: tree +
  • + +
  • + i: non-table, or list of keys {i1 ... in} +
  • + +
  • + v: value +
  • + +
+ + + + + + + + +
+ + + + +
new (t)
+
+Make a table into a tree + + +

Parameters

+
    + +
  • + t: table +
  • + +
+ + + + + + +

Return value:

+tree + + + +
+ + +
+ + + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ + From cdfbf74ca704ae9244c7248d89daa4b95d9cd95e Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Mon, 18 Nov 2013 01:16:26 -0800 Subject: [PATCH 02/15] docs: regenerate latest docs with LDoc 1.4. Signed-off-by: Gary V. Vaughan --- classes/std.list.html | 1043 ++++++++++++++++++++++++ classes/std.object.html | 348 ++++++++ classes/std.set.html | 601 ++++++++++++++ classes/std.strbuf.html | 203 +++++ files/base.html | 1535 ----------------------------------- files/bin.html | 270 ------ files/debug_ext.html | 347 -------- files/debug_init.html | 198 ----- files/fstable.html | 246 ------ files/getopt.html | 397 --------- files/io_ext.html | 480 ----------- files/lcs.html | 250 ------ files/list.html | 1154 -------------------------- files/math_ext.html | 286 ------- files/mbox.html | 242 ------ files/modules.html | 198 ----- files/object.html | 234 ------ files/package_ext.html | 246 ------ files/parser.html | 284 ------- files/set.html | 613 -------------- files/std.html | 198 ----- files/strbuf.html | 280 ------- files/strict.html | 198 ----- files/string_ext.html | 707 ---------------- files/table_ext.html | 568 ------------- files/tree.html | 395 --------- files/xml.html | 247 ------ index.html | 323 ++------ ldoc.css | 302 +++++++ luadoc.css | 286 ------- modules/base.html | 1531 ---------------------------------- modules/bin.html | 328 -------- modules/debug.html | 343 -------- modules/fstable.html | 304 ------- modules/getopt.html | 473 ----------- modules/io.html | 476 ----------- modules/lcs.html | 308 ------- modules/list.html | 1212 --------------------------- modules/math.html | 282 ------- modules/mbox.html | 300 ------- modules/object.html | 292 ------- modules/package.html | 256 ------ modules/parser.html | 342 -------- modules/set.html | 640 --------------- modules/std.debug.html | 204 +++++ modules/std.functional.html | 489 +++++++++++ modules/std.getopt.html | 244 ++++++ modules/std.html | 741 +++++++++++++---- modules/std.io.html | 361 ++++++++ modules/std.math.html | 155 ++++ modules/std.package.html | 130 +++ modules/std.strict.html | 128 +++ modules/std.string.html | 935 +++++++++++++++++++++ modules/std.table.html | 505 ++++++++++++ modules/std.tree.html | 390 +++++++++ modules/strbuf.html | 338 -------- modules/string.html | 717 ---------------- modules/table.html | 578 ------------- modules/tree.html | 415 ---------- 59 files changed, 6693 insertions(+), 19403 deletions(-) create mode 100644 classes/std.list.html create mode 100644 classes/std.object.html create mode 100644 classes/std.set.html create mode 100644 classes/std.strbuf.html delete mode 100644 files/base.html delete mode 100644 files/bin.html delete mode 100644 files/debug_ext.html delete mode 100644 files/debug_init.html delete mode 100644 files/fstable.html delete mode 100644 files/getopt.html delete mode 100644 files/io_ext.html delete mode 100644 files/lcs.html delete mode 100644 files/list.html delete mode 100644 files/math_ext.html delete mode 100644 files/mbox.html delete mode 100644 files/modules.html delete mode 100644 files/object.html delete mode 100644 files/package_ext.html delete mode 100644 files/parser.html delete mode 100644 files/set.html delete mode 100644 files/std.html delete mode 100644 files/strbuf.html delete mode 100644 files/strict.html delete mode 100644 files/string_ext.html delete mode 100644 files/table_ext.html delete mode 100644 files/tree.html delete mode 100644 files/xml.html create mode 100644 ldoc.css delete mode 100644 luadoc.css delete mode 100644 modules/base.html delete mode 100644 modules/bin.html delete mode 100644 modules/debug.html delete mode 100644 modules/fstable.html delete mode 100644 modules/getopt.html delete mode 100644 modules/io.html delete mode 100644 modules/lcs.html delete mode 100644 modules/list.html delete mode 100644 modules/math.html delete mode 100644 modules/mbox.html delete mode 100644 modules/object.html delete mode 100644 modules/package.html delete mode 100644 modules/parser.html delete mode 100644 modules/set.html create mode 100644 modules/std.debug.html create mode 100644 modules/std.functional.html create mode 100644 modules/std.getopt.html create mode 100644 modules/std.io.html create mode 100644 modules/std.math.html create mode 100644 modules/std.package.html create mode 100644 modules/std.strict.html create mode 100644 modules/std.string.html create mode 100644 modules/std.table.html create mode 100644 modules/std.tree.html delete mode 100644 modules/strbuf.html delete mode 100644 modules/string.html delete mode 100644 modules/table.html delete mode 100644 modules/tree.html diff --git a/classes/std.list.html b/classes/std.list.html new file mode 100644 index 0000000..e1bfdd1 --- /dev/null +++ b/classes/std.list.html @@ -0,0 +1,1043 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Class std.list

+ +

Tables as lists.

+

Every list is also an object, and thus inherits all of the std.object + methods, particularly use of object cloning for making new list objects.

+ + +

Methods

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
std.list.__addAppend to list.
std.list.__concatConcatenate lists.
std.list.__leList equality or order operator.
std.list.__ltList order operator.
std.list:append (l, x)Append an item to a list.
std.list:compare (l, m)Compare two lists element-by-element, from left-to-right.
std.list:concat (...)Concatenate arguments into a list.
std.list:cons (l, x)Prepend an item to a list.
std.list:depair (ls)Turn a list of pairs into a table.
std.list:elems (l)An iterator over the elements of a list.
std.list:enpair (t)Turn a table into a list of pairs.
std.list:filter (l, p)Filter a list according to a predicate.
std.list:flatten (l)Flatten a list.
std.list:foldl (l, f, e)Fold a binary function through a list left associatively.
std.list:foldr (l, f, e)Fold a binary function through a list right associatively.
std.list:index_key (l, f)Make an index of a list of tables on a given field
std.list:index_value (l, f)Copy a list of tables, indexed on a given field
std.list:map (l, f)Map a function over a list.
std.list:map_with (ls, f)Map a function over a list of lists.
std.list:project (l, f)Project a list of fields from a list of tables.
std.list:relems (l)An iterator over the elements of a list, in reverse.
std.list:rep (l, n)Repeat a list.
std.list:reverse (l)Reverse a list.
std.list:shape (l, s)Shape a list according to a list of dimensions.
std.list:sub (l, from, to)Return a sub-range of a list.
std.list:tail (l)Return a list with its first element removed.
std.list:transpose (ls)Transpose a list of lists.
std.list:zip_with (ls, f)Zip a list of lists together with a function.
+ +
+
+ + +

Methods

+ +
+
+ + std.list.__add +
+
+ +

Append to list.

+
 list = list + element
+
+ + + + + +

See also:

+ + + +
+
+ + std.list.__concat +
+
+ +

Concatenate lists.

+
 new = list .. table
+
+ + + + + +

See also:

+ + + +
+
+ + std.list.__le +
+
+ +

List equality or order operator.

+
 min = list1 <= list2 and list1 or list2
+
+ + +

params:

+ + + + +

See also:

+ + + +
+
+ + std.list.__lt +
+
+ +

List order operator.

+
 max = list1 > list2 and list1 or list2
+
+ + +

params:

+ + + + +

See also:

+ + + +
+
+ + std.list:append (l, x) +
+
+ Append an item to a list. + +

Parameters:

+
    +
  • l + table + a list +
  • +
  • x + item +
  • +
+ +

Returns:

+
    + + std.list + new list containing {l[1], ..., l[#l], x} +
+ + + + +
+
+ + std.list:compare (l, m) +
+
+ Compare two lists element-by-element, from left-to-right. + +

Parameters:

+
    +
  • l + table + a list +
  • +
  • m + table + another list +
  • +
+ +

Returns:

+
    + + -1 if l is less than m, 0 if they are the same, and 1 + if l is greater than m +
+ + + + +
+
+ + std.list:concat (...) +
+
+ Concatenate arguments into a list. + +

Parameters:

+
    +
  • ... + tuple of lists +
  • +
+ +

Returns:

+
    + + std.list + +

    new list containing

    +
                       <code>{l\_1[1], ..., l\_1[#l\_1], ..., l\_n[1], ..., l\_n[#l\_n]}</code>
    +
    + +
+ + + + +
+
+ + std.list:cons (l, x) +
+
+ Prepend an item to a list. + +

Parameters:

+
    +
  • l + table + a list +
  • +
  • x + item +
  • +
+ +

Returns:

+
    + + std.list + new list containing {x, unpack (l)} +
+ + + + +
+
+ + std.list:depair (ls) +
+
+ Turn a list of pairs into a table. + +

Parameters:

+
    +
  • ls + table + list of lists {{i1, v1}, ..., {in, vn}} +
  • +
+ +

Returns:

+
    + + table + a new list containing table {i1=v1, ..., in=vn} +
+ + +

See also:

+ + + +
+
+ + std.list:elems (l) +
+
+ An iterator over the elements of a list. + +

Parameters:

+
    +
  • l + table + a list +
  • +
+ +

Returns:

+
    +
  1. + function + iterator function which returns successive elements of self
  2. +
  3. + table + l
  4. +
  5. + true
  6. +
+ + + + +
+
+ + std.list:enpair (t) +
+
+ Turn a table into a list of pairs. + +

Parameters:

+
    +
  • t + table + a table {i1=v1, ..., in=vn} +
  • +
+ +

Returns:

+
    + + std.list + a new list containing {{i1, v1}, ..., {in, vn}} +
+ + +

See also:

+ + + +
+
+ + std.list:filter (l, p) +
+
+ Filter a list according to a predicate. + +

Parameters:

+
    +
  • l + table + a list +
  • +
  • p + function + predicate function, of one argument returning a boolean +
  • +
+ +

Returns:

+
    + + std.list + new list containing elements e of l for which p (e) is true +
+ + + + +
+
+ + std.list:flatten (l) +
+
+ Flatten a list. + +

Parameters:

+
    +
  • l + table + a list +
  • +
+ +

Returns:

+
    + + std.list + flattened list +
+ + + + +
+
+ + std.list:foldl (l, f, e) +
+
+ Fold a binary function through a list left associatively. + +

Parameters:

+
    +
  • l + table + a list +
  • +
  • f + function + binary function +
  • +
  • e + element to place in left-most position +
  • +
+ +

Returns:

+
    + + result +
+ + + + +
+
+ + std.list:foldr (l, f, e) +
+
+ Fold a binary function through a list right associatively. + +

Parameters:

+
    +
  • l + table + a list +
  • +
  • f + function + binary function +
  • +
  • e + element to place in right-most position +
  • +
+ +

Returns:

+
    + + result +
+ + + + +
+
+ + std.list:index_key (l, f) +
+
+ Make an index of a list of tables on a given field + +

Parameters:

+
    +
  • l + table + list of tables {t1, ..., tn} +
  • +
  • f + field +
  • +
+ +

Returns:

+
    + + std.list + index {t1[f]=1, ..., tn[f]=n} +
+ + + + +
+
+ + std.list:index_value (l, f) +
+
+ Copy a list of tables, indexed on a given field + +

Parameters:

+
    +
  • l + table + list of tables {i1=t1, ..., in=tn} +
  • +
  • f + field whose value should be used as index +
  • +
+ +

Returns:

+
    + + std.list + index {t1[f]=t1, ..., tn[f]=tn} +
+ + + + +
+
+ + std.list:map (l, f) +
+
+ Map a function over a list. + +

Parameters:

+
    +
  • l + table + a list +
  • +
  • f + function + map function +
  • +
+ +

Returns:

+
    + + std.list + new list containing {f (list[1]), ..., f (list[#list])} +
+ + + + +
+
+ + std.list:map_with (ls, f) +
+
+ Map a function over a list of lists. + +

Parameters:

+
    +
  • ls + table + a list of lists +
  • +
  • f + function + map function +
  • +
+ +

Returns:

+
    + + std.list + new list {f (unpack (ls[1]))), ..., f (unpack (ls[#ls]))} +
+ + + + +
+
+ + std.list:project (l, f) +
+
+ Project a list of fields from a list of tables. + +

Parameters:

+
    +
  • l + table + a list +
  • +
  • f + field to project +
  • +
+ +

Returns:

+
    + + std.list + list of f fields +
+ + + + +
+
+ + std.list:relems (l) +
+
+ An iterator over the elements of a list, in reverse. + +

Parameters:

+
    +
  • l + table + a list +
  • +
+ +

Returns:

+
    +
  1. + function + iterator function which returns precessive elements of the list
  2. +
  3. + std.list + l
  4. +
  5. + true
  6. +
+ + + + +
+
+ + std.list:rep (l, n) +
+
+ Repeat a list. + +

Parameters:

+
    +
  • l + table + a list +
  • +
  • n + number + number of times to repeat +
  • +
+ +

Returns:

+
    + + std.list + n copies of l appended together +
+ + + + +
+
+ + std.list:reverse (l) +
+
+ Reverse a list. + +

Parameters:

+
    +
  • l + table + a list +
  • +
+ +

Returns:

+
    + + std.list + new list containing {l[#l], ..., l[1]} +
+ + + + +
+
+ + std.list:shape (l, s) +
+
+ Shape a list according to a list of dimensions.

+ +

Dimensions are given outermost first and items from the original + list are distributed breadth first; there may be one 0 indicating + an indefinite number. Hence, {0} is a flat list, + {1} is a singleton, {2, 0} is a list of + two lists, and {0, 2} is a list of pairs.

+ +

Algorithm: turn shape into all positive numbers, calculating + the zero if necessary and making sure there is at most one; + recursively walk the shape, adding empty tables until the bottom + level is reached at which point add table items instead, using a + counter to walk the flattened original list. + +

Parameters:

+
    +
  • l + table + a list +
  • +
  • s + table + {d1, ..., dn} +
  • +
+ +

Returns:

+
    + + reshaped list +
+ + + + +
+
+ + std.list:sub (l, from, to) +
+
+ Return a sub-range of a list. + (The equivalent of string.sub -- on strings; negative list indices + count from the end of the list.) + +

Parameters:

+
    +
  • l + table + +
    a list
    +
    + +
  • +
  • from + number + start of range (default: 1) +
  • +
  • to + number + end of range (default: #list) +
  • +
+ +

Returns:

+
    + + std.list + new list containing {l[from], ..., l[to]} +
+ + + + +
+
+ + std.list:tail (l) +
+
+ Return a list with its first element removed. + +

Parameters:

+
    +
  • l + table + a list +
  • +
+ +

Returns:

+
    + + std.list + new list containing {l[2], ..., l[#l]} +
+ + + + +
+
+ + std.list:transpose (ls) +
+
+ Transpose a list of lists. + This function in Lua is equivalent to zip and unzip in more strongly + typed languages. + +

Parameters:

+
    +
  • ls + table + {{ls<1,1>, ..., ls<1,c>}, ..., {ls<r,1>, ..., ls<r,c>}} +
  • +
+ +

Returns:

+
    + + std.list + new list containing + {{ls<1,1>, ..., ls<r,1>}, ..., {ls<1,c>, ..., ls<r,c>}} +
+ + + + +
+
+ + std.list:zip_with (ls, f) +
+
+ Zip a list of lists together with a function. + +

Parameters:

+
    +
  • ls + table + list of lists +
  • +
  • f + function + function +
  • +
+ +

Returns:

+
    + + std.list + +
    a new list containing
    +
    +

    {f (ls[1][1], ..., ls[#ls][1]), ..., f (ls[1][N], ..., ls[#ls][N]) + where N = max {map (function (l) return #l end, ls)}

    + +
+ + + + +
+
+ + +
+
+
+generated by LDoc 1.4.0 +
+
+ + diff --git a/classes/std.object.html b/classes/std.object.html new file mode 100644 index 0000000..ae90678 --- /dev/null +++ b/classes/std.object.html @@ -0,0 +1,348 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Class std.object

+ +

Prototype-based objects.

+

+ + +

This module creates the root prototype object from which every other + object is descended. There are no classes as such, rather new objects + are created by cloning an existing prototype object, and then changing + or adding to it. Further objects can then be made by cloning the changed + object, and so on.

+ +

Objects are cloned by simply calling an existing object which then + serves as a prototype, from which the new object is copied.

+ +

All valid objects contain a field _init, which determines the syntax + required to execute the cloning process:

+ +
    +
  1. _init can be a list of keys; then the unnamed init_1 through + init_n values from the argument table are assigned to the + corresponding keys in new_object;

    + +
     new_object = prototype {
    +   init_1, ..., init_m;
    +   field_1 = value_1,
    +   ...
    +   field_n = value_n,
    + }
    +
  2. +
  3. Or it can be a function, in which the arguments passed to the + prototype during cloning are simply handed to the _init function:

    + +
    new_object = prototype (value, ...)
    +
  4. +
+ +

Field names beginning with "_" are private, and moved into the object + metatable during cloning. Unless new_object changes the metatable this + way, then it will share a metatable with prototype for efficiency.

+ +

Objects, then, are essentially tables of field_n = value_n pairs:

+ +
    +
  • Access an object field: object.field
  • +
  • Call an object method: object:method (...)
  • +
  • Call a "class" method: Class.method (object, ...)
  • +
  • Add a field: object.field = x
  • +
  • Add a method: function object:method (...) ... end
  • +
+ +

+ + +

Methods

+ + + + + + + + + + + + + + + + + + + + + + + + + +
std.object.__tostringReturn a string representation of object.
std.object.__totableReturn a shallow copy of non-private object fields.
std.object:clone (prototype, ...)Clone an object.
std.object:tostring (o)Return a stringified version of the contents of object.
std.object:totable (o)Return a new table with a shallow copy of all non-private fields + in object.
std.object:type (o)Return the extended object type, if any, else primitive type.
+ +
+
+ + +

Methods

+ +
+
+ + std.object.__tostring +
+
+ Return a string representation of object. + + + + +

See also:

+ + + +
+
+ + std.object.__totable +
+
+ Return a shallow copy of non-private object fields.

+ +

This pseudo-metamethod is used during object cloning to make the + intial new object table, and can be overridden in other objects + for greater control of which fields are considered non-private. + + + + +

See also:

+ + + +
+
+ + std.object:clone (prototype, ...) +
+
+ Clone an object.

+ +

Prototypes are cloned by calling directly as described above, so this + clone method is rarely used explicitly. + +

Parameters:

+
    +
  • prototype + std.object + source object +
  • +
  • ... + +
       arguments
    +
    + +
  • +
+ +

Returns:

+
    + + std.object + a clone of prototype, adjusted + according to the rules above, and sharing a metatable where possible. +
+ + + + +
+
+ + std.object:tostring (o) +
+
+ Return a stringified version of the contents of object.

+ +

First the object type, and then between { and } a list of the array + part of the object table (without numeric keys) followed by the + remaining key-value pairs.

+ +

This function doesn't recurse explicity, but relies upon suitable + __tostring metamethods in contained objects. + +

Parameters:

+ + +

Returns:

+
    + + string + stringified object representation +
+ + + + +
+
+ + std.object:totable (o) +
+
+ Return a new table with a shallow copy of all non-private fields + in object.

+ +

Where private fields have keys prefixed with "_". + +

Parameters:

+ + +

Returns:

+
    + + table + raw (non-object) table of object fields +
+ + + + +
+
+ + std.object:type (o) +
+
+ +

Return the extended object type, if any, else primitive type.

+ +

It's conventional to organise similar objects according to a string + valued _type field, which can then be queried using this function.

+ +
 Stack = Object {
+   _type = "Stack",
+
+   __tostring = function (self) ... end,
+
+   __index = {
+     push = function (self) ... end,
+     pop  = function (self) ... end,
+   },
+ }
+ stack = Stack {}
+
+ stack:type () --> "Stack"
+
+ + + +

Parameters:

+ + +

Returns:

+
    + + string + type of the object +
+ + + + +
+
+ + +
+
+
+generated by LDoc 1.4.0 +
+
+ + diff --git a/classes/std.set.html b/classes/std.set.html new file mode 100644 index 0000000..2e39d8c --- /dev/null +++ b/classes/std.set.html @@ -0,0 +1,601 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Class std.set

+ +

Set object.

+

+ +

+ + +

Methods

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
std.set.__addUnion operator.
std.set.__divSymmetric difference operator.
std.set.__leSubset operator.
std.set.__ltProper subset operator.
std.set.__mulIntersection operator.
std.set.__subDifference operator.
std.set.__totableObject to table conversion.
std.set:delete (s, e)Delete an element from a set.
std.set:difference (s, t)Find the difference of two sets.
std.set:elems (s)Iterator for sets.
std.set:equal (s, t)Find whether two sets are equal.
std.set:insert (s, e)Insert an element into a set.
std.set:intersection (s, t)Find the intersection of two sets.
std.set:member (s, e)Say whether an element is in a set.
std.set:propersubset (s, t)Find whether one set is a proper subset of another.
std.set:subset (s, t)Find whether one set is a subset of another.
std.set:symmetric_difference (s, t)Find the symmetric difference of two sets.
std.set:union (s, t)Find the union of two sets.
+ +
+
+ + +

Methods

+ +
+
+ + std.set.__add +
+
+ +

Union operator.

+
 set + table = union
+
+ + + + + +

See also:

+ + + +
+
+ + std.set.__div +
+
+ +

Symmetric difference operator.

+
 set / table = symmetric difference
+
+ + + + + +

See also:

+ + + +
+
+ + std.set.__le +
+
+ +

Subset operator.

+
 set <= table = subset
+
+ + + + + +

See also:

+ + + +
+
+ + std.set.__lt +
+
+ +

Proper subset operator.

+
 set < table = proper subset
+
+ + + + + +

See also:

+ + + +
+
+ + std.set.__mul +
+
+ +

Intersection operator.

+
 set * table = intersection
+
+ + + + + +

See also:

+ + + +
+
+ + std.set.__sub +
+
+ +

Difference operator.

+
 set - table = set difference
+
+ + + + + +

See also:

+ + + +
+
+ + std.set.__totable +
+
+ +

Object to table conversion.

+
 table = set:totable ()
+
+ + + + + + + +
+
+ + std.set:delete (s, e) +
+
+ Delete an element from a set. + +

Parameters:

+
    +
  • s + set +
  • +
  • e + element +
  • +
+ +

Returns:

+
    + + the modified set +
+ + + + +
+
+ + std.set:difference (s, t) +
+
+ Find the difference of two sets. + +

Parameters:

+
    +
  • s + set +
  • +
  • t + set +
  • +
+ +

Returns:

+
    + + s with elements of t removed +
+ + + + +
+
+ + std.set:elems (s) +
+
+ Iterator for sets. + +

Parameters:

+
    +
  • s + + + +
  • +
+ + + + + +
+
+ + std.set:equal (s, t) +
+
+ Find whether two sets are equal. + +

Parameters:

+
    +
  • s + set +
  • +
  • t + set +
  • +
+ +

Returns:

+
    + + true if sets are equal, false otherwise +
+ + + + +
+
+ + std.set:insert (s, e) +
+
+ Insert an element into a set. + +

Parameters:

+
    +
  • s + set +
  • +
  • e + element +
  • +
+ +

Returns:

+
    + + the modified set +
+ + + + +
+
+ + std.set:intersection (s, t) +
+
+ Find the intersection of two sets. + +

Parameters:

+
    +
  • s + set +
  • +
  • t + set +
  • +
+ +

Returns:

+
    + + set intersection of s and t +
+ + + + +
+
+ + std.set:member (s, e) +
+
+ Say whether an element is in a set. + +

Parameters:

+
    +
  • s + set +
  • +
  • e + element +
  • +
+ +

Returns:

+
    + + true if e is in set, false + otherwise +
+ + + + +
+
+ + std.set:propersubset (s, t) +
+
+ Find whether one set is a proper subset of another. + +

Parameters:

+
    +
  • s + set +
  • +
  • t + set +
  • +
+ +

Returns:

+
    + + true if s is a proper subset of t, false otherwise +
+ + + + +
+
+ + std.set:subset (s, t) +
+
+ Find whether one set is a subset of another. + +

Parameters:

+
    +
  • s + set +
  • +
  • t + set +
  • +
+ +

Returns:

+
    + + true if s is a subset of t, false otherwise +
+ + + + +
+
+ + std.set:symmetric_difference (s, t) +
+
+ Find the symmetric difference of two sets. + +

Parameters:

+
    +
  • s + set +
  • +
  • t + set +
  • +
+ +

Returns:

+
    + + elements of s and t that are in s or t but not both +
+ + + + +
+
+ + std.set:union (s, t) +
+
+ Find the union of two sets. + +

Parameters:

+
    +
  • s + set +
  • +
  • t + set or set-like table +
  • +
+ +

Returns:

+
    + + set union of s and t +
+ + + + +
+
+ + +
+
+
+generated by LDoc 1.4.0 +
+
+ + diff --git a/classes/std.strbuf.html b/classes/std.strbuf.html new file mode 100644 index 0000000..7e7243b --- /dev/null +++ b/classes/std.strbuf.html @@ -0,0 +1,203 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Class std.strbuf

+ +

String buffers.

+

+ +

+ + +

Methods

+ + + + + + + + + + + + + + + + + +
std.strbuf.__concatSupport concatenation of StrBuf objects.
std.strbuf.__tostringSupport fast conversion to Lua string.
std.strbuf:concat (b, s)Add a string to a buffer.
std.strbuf:tostring (b)Convert a buffer to a string.
+ +
+
+ + +

Methods

+ +
+
+ + std.strbuf.__concat +
+
+ +

Support concatenation of StrBuf objects.

+
 buffer = buffer .. str
+
+ + + + + +

See also:

+ + + +
+
+ + std.strbuf.__tostring +
+
+ +

Support fast conversion to Lua string.

+
 str = tostring (buffer)
+
+ + + + + +

See also:

+ + + +
+
+ + std.strbuf:concat (b, s) +
+
+ Add a string to a buffer. + +

Parameters:

+
    +
  • b + buffer +
  • +
  • s + string to add +
  • +
+ +

Returns:

+
    + + buffer +
+ + + + +
+
+ + std.strbuf:tostring (b) +
+
+ Convert a buffer to a string. + +

Parameters:

+
    +
  • b + buffer +
  • +
+ +

Returns:

+
    + + string +
+ + + + +
+
+ + +
+
+
+generated by LDoc 1.4.0 +
+
+ + diff --git a/files/base.html b/files/base.html deleted file mode 100644 index 8e08905..0000000 --- a/files/base.html +++ /dev/null @@ -1,1535 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File base.lua

- - -

Adds to the existing global functions

- - - - - - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
_G.assert (v, f, ...)Extend to allow formatted arguments.
_G.bind (f, ...)Partially apply a function.
_G.collect (i, ...)Collect the results of an iterator.
_G.compose (..., f1...fn)Compose functions.
_G.curry (f, n)Curry a function.
_G.die (...)Die with error.
_G.eval (s)Evaluate a string.
_G.filter (p, i, ...)Filter an iterator with a predicate.
_G.fold (f, d, i, ...)Fold a binary function into an iterator.
_G.id (...)Identity function.
_G.ileaves (tr)Tree iterator which returns just numbered leaves, in order.
_G.inodes (tr)Tree iterator over numbered nodes, in order.
_G.leaves (tr)Tree iterator which returns just leaves.
_G.map (f, i, ...)Map a function over an iterator.
_G.memoize (fn)Memoize a function, by wrapping it in a functable.
_G.metamethod (x, n)Return given metamethod, if any, or nil.
_G.nodes (tr)Tree iterator.
_G.pack (...)Turn a tuple into a list.
_G.pickle (x)Convert a value to a string.
_G.prettytostring (t, indent, spacing)Pretty-print a table.
_G.render (x, open, close, elem, pair, sep, roots)Turn tables into strings with recursion detection.
_G.require_version (module, min, too_big, pattern)Require a module with a particular version
_G.ripairs (t)An iterator like ipairs, but in reverse.
_G.tostring (x)Extend tostring to work better on tables.
_G.totable (x)Turn an object into a table according to __totable metamethod.
_G.warn (...)Give warning with the name of program and file (if any).
render_CloseRenderer (t)
render_ElementRenderer (e)
render_OpenRenderer (t)
render_PairRenderer N.B. the function should not try to render i and v, or treat them recursively. (t, i, v, is, vs)
render_SeparatorRenderer (t, i, v, j, w)
tree_Iterator (it, tr, n)
- - - - -

Tables

- - - - - - - -
_G.opFunctional forms of infix operators.
- - - -
-
- - - - -

Functions

-
- - - -
_G.assert (v, f, ...)
-
-Extend to allow formatted arguments. - - -

Parameters

-
    - -
  • - v: value to assert -
  • - -
  • - f: format -
  • - -
  • - ...: arguments to format -
  • - -
- - - - - - -

Return value:

-value - - - -
- - - - -
_G.bind (f, ...)
-
-Partially apply a function. - - -

Parameters

-
    - -
  • - f: function to apply partially -
  • - -
  • - ...: arguments to bind -
  • - -
- - - - - - -

Return value:

-function with ai already bound - - - -
- - - - -
_G.collect (i, ...)
-
-Collect the results of an iterator. - - -

Parameters

-
    - -
  • - i: iterator -
  • - -
  • - ...: -
  • - -
- - - - - - -

Return value:

-results of running the iterator on its arguments - - - -
- - - - -
_G.compose (..., f1...fn)
-
-Compose functions. - - -

Parameters

-
    - -
  • - ...: -
  • - -
  • - f1...fn: functions to compose -
  • - -
- - - - - - -

Return value:

-composition of f1 ... fn - - - -
- - - - -
_G.curry (f, n)
-
-Curry a function. - - -

Parameters

-
    - -
  • - f: function to curry -
  • - -
  • - n: number of arguments -
  • - -
- - - - - - -

Return value:

-curried version of f - - - -
- - - - -
_G.die (...)
-
-Die with error. - - -

Parameters

-
    - -
  • - ...: arguments for format -
  • - -
- - - - - - - - -
- - - - -
_G.eval (s)
-
-Evaluate a string. - - -

Parameters

-
    - -
  • - s: string -
  • - -
- - - - - - -

Return value:

-value of string - - - -
- - - - -
_G.filter (p, i, ...)
-
-Filter an iterator with a predicate. - - -

Parameters

-
    - -
  • - p: predicate -
  • - -
  • - i: iterator -
  • - -
  • - ...: -
  • - -
- - - - - - -

Return value:

-result table containing elements e for which p (e) - - - -
- - - - -
_G.fold (f, d, i, ...)
-
-Fold a binary function into an iterator. - - -

Parameters

-
    - -
  • - f: function -
  • - -
  • - d: initial first argument -
  • - -
  • - i: iterator -
  • - -
  • - ...: -
  • - -
- - - - - - -

Return value:

-result - - - -
- - - - -
_G.id (...)
-
-Identity function. - - -

Parameters

-
    - -
  • - ...: -
  • - -
- - - - - - -

Return value:

-the arguments passed to the function - - - -
- - - - -
_G.ileaves (tr)
-
-Tree iterator which returns just numbered leaves, in order. - - -

Parameters

-
    - -
  • - tr: tree to iterate over -
  • - -
- - - - - - -

Return values:

-
    - -
  1. iterator function - -
  2. the tree, as above - -
- - - -
- - - - -
_G.inodes (tr)
-
-Tree iterator over numbered nodes, in order. - - -

Parameters

-
    - -
  • - tr: tree to iterate over -
  • - -
- - - - - - -

Return values:

-
    - -
  1. iterator function - -
  2. the tree, as above - -
- - - -

See also:

- - -
- - - - -
_G.leaves (tr)
-
-Tree iterator which returns just leaves. - - -

Parameters

-
    - -
  • - tr: tree to iterate over -
  • - -
- - - - - - -

Return values:

-
    - -
  1. iterator function - -
  2. the tree, as above - -
- - - -
- - - - -
_G.map (f, i, ...)
-
-Map a function over an iterator. - - -

Parameters

-
    - -
  • - f: function -
  • - -
  • - i: iterator -
  • - -
  • - ...: -
  • - -
- - - - - - -

Return value:

-result table - - - -
- - - - -
_G.memoize (fn)
-
-Memoize a function, by wrapping it in a functable. - - -

Parameters

-
    - -
  • - fn: function that returns a single result -
  • - -
- - - - - - -

Return value:

-memoized function - - - -
- - - - -
_G.metamethod (x, n)
-
-Return given metamethod, if any, or nil. - - -

Parameters

-
    - -
  • - x: object to get metamethod of -
  • - -
  • - n: name of metamethod to get -
  • - -
- - - - - - -

Return value:

-metamethod function or nil if no metamethod or not a function - - - -
- - - - -
_G.nodes (tr)
-
-Tree iterator. - - -

Parameters

-
    - -
  • - tr: tree to iterate over -
  • - -
- - - - - - -

Return values:

-
    - -
  1. iterator function - -
  2. the tree, as above - -
- - - -

See also:

- - -
- - - - -
_G.pack (...)
-
-Turn a tuple into a list. - - -

Parameters

-
    - -
  • - ...: tuple -
  • - -
- - - - - - -

Return value:

-list - - - -
- - - - -
_G.pickle (x)
-
-Convert a value to a string. The string can be passed to dostring to retrieve the value.
TODO: Make it work for recursive tables. - - -

Parameters

-
    - -
  • - x: object to pickle -
  • - -
- - - - - - -

Return value:

-string such that eval (s) is the same value as x - - - -
- - - - -
_G.prettytostring (t, indent, spacing)
-
-Pretty-print a table. - - -

Parameters

-
    - -
  • - t: table to print -
  • - -
  • - indent: indent between levels ["\t"] -
  • - -
  • - spacing: space before every line -
  • - -
- - - - - - -

Return value:

-pretty-printed string - - - -
- - - - -
_G.render (x, open, close, elem, pair, sep, roots)
-
-Turn tables into strings with recursion detection. N.B. Functions calling render should not recurse, or recursion detection will not work. - - -

Parameters

-
    - -
  • - x: object to convert to string -
  • - -
  • - open: open table renderer -
  • - -
  • - close: close table renderer -
  • - -
  • - elem: element renderer -
  • - -
  • - pair: pair renderer -
  • - -
  • - sep: separator renderer -
  • - -
  • - roots: -
  • - -
- - - - - - -

Return value:

-string representation - - - -

See also:

- - -
- - - - -
_G.require_version (module, min, too_big, pattern)
-
-Require a module with a particular version - - -

Parameters

-
    - -
  • - module: module to require -
  • - -
  • - min: lowest acceptable version (default: any) -
  • - -
  • - too_big: lowest version that is too big (default: none) -
  • - -
  • - pattern: -
  • - -
- - - - - - - - -
- - - - -
_G.ripairs (t)
-
-An iterator like ipairs, but in reverse. - - -

Parameters

-
    - -
  • - t: table to iterate over -
  • - -
- - - - - - -

Return values:

-
    - -
  1. iterator function - -
  2. the table, as above - -
  3. #t + 1 - -
- - - -
- - - - -
_G.tostring (x)
-
-Extend tostring to work better on tables. The original tostring is available as _tostring. - - -

Parameters

-
    - -
  • - x: object to convert to string -
  • - -
- - - - - - -

Return value:

-string representation - - - -
- - - - -
_G.totable (x)
-
-Turn an object into a table according to __totable metamethod. - - -

Parameters

-
    - -
  • - x: object to turn into a table -
  • - -
- - - - - - -

Return value:

-table or nil - - - -
- - - - -
_G.warn (...)
-
-Give warning with the name of program and file (if any). - - -

Parameters

-
    - -
  • - ...: arguments for format -
  • - -
- - - - - - - - -
- - - - -
render_CloseRenderer (t)
-
- - - -

Parameters

-
    - -
  • - t: table -
  • - -
- - - - - - -

Return value:

-close table string - - - -
- - - - -
render_ElementRenderer (e)
-
- - - -

Parameters

-
    - -
  • - e: element -
  • - -
- - - - - - -

Return value:

-element string - - - -
- - - - -
render_OpenRenderer (t)
-
- - - -

Parameters

-
    - -
  • - t: table -
  • - -
- - - - - - -

Return value:

-open table string - - - -
- - - - -
render_PairRenderer N.B. the function should not try to render i and v, or treat them recursively. (t, i, v, is, vs)
-
- - - -

Parameters

-
    - -
  • - t: table -
  • - -
  • - i: index -
  • - -
  • - v: value -
  • - -
  • - is: index string -
  • - -
  • - vs: value string -
  • - -
- - - - - - -

Return value:

-element string - - - -
- - - - -
render_SeparatorRenderer (t, i, v, j, w)
-
- - - -

Parameters

-
    - -
  • - t: table -
  • - -
  • - i: preceding index (nil on first call) -
  • - -
  • - v: preceding value (nil on first call) -
  • - -
  • - j: following index (nil on last call) -
  • - -
  • - w: following value (nil on last call) -
  • - -
- - - - - - -

Return value:

-separator string - - - -
- - - - -
tree_Iterator (it, tr, n)
-
- - - -

Parameters

-
    - -
  • - it: -
  • - -
  • - tr: -
  • - -
  • - n: current node -
  • - -
- - - - - - -

Return values:

-
    - -
  1. type ("leaf", "branch" (pre-order) or "join" (post-order)) - -
  2. path to node ({i1...ik}) - -
  3. node - -
- - - -
- - -
- - - - -

Tables

-
- -
_G.op
-
Functional forms of infix operators. Defined here so that other modules can write to it. - - - -
- - -
- - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/bin.html b/files/bin.html deleted file mode 100644 index e42ef70..0000000 --- a/files/bin.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File bin.lua

- - - - - - - -

Functions

- - - - - - - - - - - - -
le_to_hex (s)Turn a little-endian word into a hex string
le_to_number (s)Turn a little-endian word into a number
- - - - - - -
-
- - - - -

Functions

-
- - - -
le_to_hex (s)
-
-Turn a little-endian word into a hex string - - -

Parameters

-
    - -
  • - s: -
  • - -
- - - - - - - - -
- - - - -
le_to_number (s)
-
-Turn a little-endian word into a number - - -

Parameters

-
    - -
  • - s: -
  • - -
- - - - - - - - -
- - -
- - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/debug_ext.html b/files/debug_ext.html deleted file mode 100644 index a73f8c6..0000000 --- a/files/debug_ext.html +++ /dev/null @@ -1,347 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File debug_ext.lua

- - -

Additions to the debug module

- - - - - - -

Functions

- - - - - - - - - - - - - - - - - -
debug ()The global function debug is an abbreviation for debug.say (1, ...)
say (n, ...)Print a debugging message
trace (event)Trace function calls Use as debug.sethook (trace, "cr"), which is done automatically when _DEBUG.call is set.
- - - - -

Tables

- - - - - - - -
_DEBUGTo activate debugging set _DEBUG either to any true value (equivalent to {level = 1}), or as documented below.
- - - -
-
- - - - -

Functions

-
- - - -
debug ()
-
-The global function debug is an abbreviation for debug.say (1, ...) - - - - - - - - - -

See also:

- - -
- - - - -
say (n, ...)
-
-Print a debugging message - - -

Parameters

-
    - -
  • - n: debugging level, defaults to 1 -
  • - -
  • - ...: objects to print (as for print) -
  • - -
- - - - - - - - -
- - - - -
trace (event)
-
-Trace function calls Use as debug.sethook (trace, "cr"), which is done automatically when _DEBUG.call is set. Based on test/trace-calls.lua from the Lua distribution. - - -

Parameters

-
    - -
  • - event: event causing the call -
  • - -
- - - - - - - - -
- - -
- - - - -

Tables

-
- -
_DEBUG
-
To activate debugging set _DEBUG either to any true value (equivalent to {level = 1}), or as documented below. - - -Fields -
    - -
  • - level: debugging level -
  • - -
  • - call: do call trace debugging -
  • - -
  • - std: do standard library debugging (run examples & test code) -
  • - -
- - -
- - -
- - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/debug_init.html b/files/debug_init.html deleted file mode 100644 index 7ff4514..0000000 --- a/files/debug_init.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File debug_init.lua

- - - - - - - - - - - - -
-
- - - - - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/fstable.html b/files/fstable.html deleted file mode 100644 index fd53984..0000000 --- a/files/fstable.html +++ /dev/null @@ -1,246 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File fstable.lua

- - - - - - - -

Functions

- - - - - - - -
new (path, t)Bind a directory to a table
- - - - - - -
-
- - - - -

Functions

-
- - - -
new (path, t)
-
-Bind a directory to a table - - -

Parameters

-
    - -
  • - path: directory path -
  • - -
  • - t: table to merge with directory -
  • - -
- - - - - - -

Return value:

-table bound to directory - - - -
- - -
- - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/getopt.html b/files/getopt.html deleted file mode 100644 index 707082b..0000000 --- a/files/getopt.html +++ /dev/null @@ -1,397 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File getopt.lua

- - - - - - - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
getOpt (argIn, options, stop_at_nonopt)Perform argument processing
makeOptions (t)Options table constructor: adds lookup tables for the option names
processArgs (prog, ...)Simple getOpt wrapper.
usage (prog)Emit a usage message.
usageInfo (header, optDesc, pageWidth)Produce usage info for the given options
- - - - - - -
-
- - - - -

Functions

-
- - - -
getOpt (argIn, options, stop_at_nonopt)
-
-Perform argument processing - - -

Parameters

-
    - -
  • - argIn: list of command-line args -
  • - -
  • - options: options table -
  • - -
  • - stop_at_nonopt: if true, stop option processing at first non-option -
  • - -
- - - - - - -

Return values:

-
    - -
  1. table of remaining non-options - -
  2. table of option key-value list pairs - -
  3. table of error messages - -
- - - -
- - - - -
makeOptions (t)
-
-Options table constructor: adds lookup tables for the option names - - -

Parameters

-
    - -
  • - t: -
  • - -
- - - - - - - - -
- - - - -
processArgs (prog, ...)
-
-Simple getOpt wrapper. If the caller didn't supply their own already, adds --version/-V and --help/-h options automatically; stops program if there was an error, or if --help or --version was used. - - -

Parameters

-
    - -
  • - prog: table of named parameters -
  • - -
  • - ...: extra arguments for getOpt -
  • - -
- - - - - - - - -
- - - - -
usage (prog)
-
-Emit a usage message. - - -

Parameters

-
    - -
  • - prog: table of named parameters -
  • - -
- - - - - - - - -
- - - - -
usageInfo (header, optDesc, pageWidth)
-
-Produce usage info for the given options - - -

Parameters

-
    - -
  • - header: header string -
  • - -
  • - optDesc: option descriptors -
  • - -
  • - pageWidth: width to format to [78] -
  • - -
- - - - - - -

Return value:

-formatted string - - - -
- - -
- - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/io_ext.html b/files/io_ext.html deleted file mode 100644 index f8de140..0000000 --- a/files/io_ext.html +++ /dev/null @@ -1,480 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File io_ext.lua

- - -

Additions to the io module

- - - - - - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
catdir (...)Concatenate two or more directories into a path, removing the trailing slash.
catfile (...)Concatenate one or more directories and a filename into a path.
processFiles (f)Process files specified on the command-line.
readlines (h)Read a file or file handle into a list of lines.
shell (c)Perform a shell command and return its output.
slurp (h)Slurp a file handle.
splitdir (path)Split a directory path into components.
writelines (h, ...)Write values adding a newline after each.
- - - - - - -
-
- - - - -

Functions

-
- - - -
catdir (...)
-
-Concatenate two or more directories into a path, removing the trailing slash. - - -

Parameters

-
    - -
  • - ...: path components -
  • - -
- - - - - - -

Return value:

-path - - - -
- - - - -
catfile (...)
-
-Concatenate one or more directories and a filename into a path. - - -

Parameters

-
    - -
  • - ...: path components -
  • - -
- - - - - - -

Return value:

-path - - - -
- - - - -
processFiles (f)
-
-Process files specified on the command-line. If no files given, process io.stdin; in list of files, - means io.stdin.
FIXME: Make the file list an argument to the function. - - -

Parameters

-
    - -
  • - f: function to process files with, which is passed (name, arg_no) -
  • - -
- - - - - - - - -
- - - - -
readlines (h)
-
-Read a file or file handle into a list of lines. - - -

Parameters

-
    - -
  • - h: file handle or name (default: io.input ()); if h is a handle, the file is closed after reading -
  • - -
- - - - - - -

Return value:

-list of lines - - - -
- - - - -
shell (c)
-
-Perform a shell command and return its output. - - -

Parameters

-
    - -
  • - c: command -
  • - -
- - - - - - -

Return value:

-output, or nil if error - - - -
- - - - -
slurp (h)
-
-Slurp a file handle. - - -

Parameters

-
    - -
  • - h: file handle or name (default: io.input ()) -
  • - -
- - - - - - -

Return value:

-contents of file or handle, or nil if error - - - -
- - - - -
splitdir (path)
-
-Split a directory path into components. Empty components are retained: the root directory becomes {"", ""}. - - -

Parameters

-
    - -
  • - path: path -
  • - -
- - - - - - -

Return value:

-list of path components - - - -
- - - - -
writelines (h, ...)
-
-Write values adding a newline after each. - - -

Parameters

-
    - -
  • - h: file handle (default: io.output () -
  • - -
  • - ...: values to write (as for write) -
  • - -
- - - - - - - - -
- - -
- - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/lcs.html b/files/lcs.html deleted file mode 100644 index 48c4809..0000000 --- a/files/lcs.html +++ /dev/null @@ -1,250 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File lcs.lua

- - - - - - - -

Functions

- - - - - - - -
longestCommonSubseq (a, b, s)Find the longest common subsequence of two sequences.
- - - - - - -
-
- - - - -

Functions

-
- - - -
longestCommonSubseq (a, b, s)
-
-Find the longest common subsequence of two sequences. The sequence objects must have an __append metamethod. This is provided by string_ext for strings, and by list for lists. - - -

Parameters

-
    - -
  • - a: first sequence -
  • - -
  • - b: second sequence -
  • - -
  • - s: an empty sequence of the same type, to hold the result -
  • - -
- - - - - - -

Return value:

-the LCS of a and b - - - -
- - -
- - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/list.html b/files/list.html deleted file mode 100644 index f0071a5..0000000 --- a/files/list.html +++ /dev/null @@ -1,1154 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File list.lua

- - - - - - - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
append (l, x)Append an item to a list.
compare (l, m)Compare two lists element by element left-to-right
concat (...)Concatenate lists.
cons (l, x)Prepend an item to a list.
depair (ls)Turn a list of pairs into a table.
elems (l)An iterator over the elements of a list.
enpair (t)Turn a table into a list of pairs.
filter (p, l)Filter a list according to a predicate.
flatten (l)Flatten a list.
foldl (f, e, l)Fold a binary function through a list left associatively.
foldr (f, e, l)Fold a binary function through a list right associatively.
indexKey (f, l)Make an index of a list of tables on a given field
indexValue (f, l)Copy a list of tables, indexed on a given field
map (f, l)Map a function over a list.
mapWith (f, l, ls)Map a function over a list of lists.
new (l, t)List constructor.
project (f, l)Project a list of fields from a list of tables.
relems (l)An iterator over the elements of a list, in reverse.
rep (l, n)Repeat a list.
reverse (l)Reverse a list.
shape (s, l)Shape a list according to a list of dimensions.
sub (l, from, to)Return a sub-range of a list.
tail (l)Return a list with its first element removed.
transpose (ls)Transpose a list of lists.
zipWith (f, ls)Zip lists together with a function.
- - - - - - -
-
- - - - -

Functions

-
- - - -
append (l, x)
-
-Append an item to a list. - - -

Parameters

-
    - -
  • - l: list -
  • - -
  • - x: item -
  • - -
- - - - - - -

Return value:

-{l[1], ..., l[#l], x} - - - -
- - - - -
compare (l, m)
-
-Compare two lists element by element left-to-right - - -

Parameters

-
    - -
  • - l: first list -
  • - -
  • - m: second list -
  • - -
- - - - - - -

Return value:

--1 if l is less than m, 0 if they are the same, and 1 if l is greater than m - - - -
- - - - -
concat (...)
-
-Concatenate lists. - - -

Parameters

-
    - -
  • - ...: lists -
  • - -
- - - - - - -

Return value:

-{l1[1], ..., l1[#l1], ..., ln[1], ..., ln[#ln]} - - - -
- - - - -
cons (l, x)
-
-Prepend an item to a list. - - -

Parameters

-
    - -
  • - l: list -
  • - -
  • - x: item -
  • - -
- - - - - - -

Return value:

-{x, unpack (l)} - - - -
- - - - -
depair (ls)
-
-Turn a list of pairs into a table.
FIXME: Find a better name. - - -

Parameters

-
    - -
  • - ls: list {{i1, v1}, ..., {in, vn}} -
  • - -
- - - - - - -

Return value:

-table {i1=v1, ..., in=vn} - - - -
- - - - -
elems (l)
-
-An iterator over the elements of a list. - - -

Parameters

-
    - -
  • - l: list to iterate over -
  • - -
- - - - - - -

Return values:

-
    - -
  1. iterator function which returns successive elements of the list - -
  2. the list l as above - -
  3. true - -
- - - -
- - - - -
enpair (t)
-
-Turn a table into a list of pairs.
FIXME: Find a better name. - - -

Parameters

-
    - -
  • - t: table {i1=v1, ..., in=vn} -
  • - -
- - - - - - -

Return value:

-list {{i1, v1}, ..., {in, vn}} - - - -
- - - - -
filter (p, l)
-
-Filter a list according to a predicate. - - -

Parameters

-
    - -
  • - p: predicate (function of one argument returning a boolean) -
  • - -
  • - l: list of lists -
  • - -
- - - - - - -

Return value:

-result list containing elements e of l for which p (e) is true - - - -
- - - - -
flatten (l)
-
-Flatten a list. - - -

Parameters

-
    - -
  • - l: list to flatten -
  • - -
- - - - - - -

Return value:

-flattened list - - - -
- - - - -
foldl (f, e, l)
-
-Fold a binary function through a list left associatively. - - -

Parameters

-
    - -
  • - f: function -
  • - -
  • - e: element to place in left-most position -
  • - -
  • - l: list -
  • - -
- - - - - - -

Return value:

-result - - - -
- - - - -
foldr (f, e, l)
-
-Fold a binary function through a list right associatively. - - -

Parameters

-
    - -
  • - f: function -
  • - -
  • - e: element to place in right-most position -
  • - -
  • - l: list -
  • - -
- - - - - - -

Return value:

-result - - - -
- - - - -
indexKey (f, l)
-
-Make an index of a list of tables on a given field - - -

Parameters

-
    - -
  • - f: field -
  • - -
  • - l: list of tables {t1, ..., tn} -
  • - -
- - - - - - -

Return value:

-index {t1[f]=1, ..., tn[f]=n} - - - -
- - - - -
indexValue (f, l)
-
-Copy a list of tables, indexed on a given field - - -

Parameters

-
    - -
  • - f: field whose value should be used as index -
  • - -
  • - l: list of tables {i1=t1, ..., in=tn} -
  • - -
- - - - - - -

Return value:

-index {t1[f]=t1, ..., tn[f]=tn} - - - -
- - - - -
map (f, l)
-
-Map a function over a list. - - -

Parameters

-
    - -
  • - f: function -
  • - -
  • - l: list -
  • - -
- - - - - - -

Return value:

-result list {f (l[1]), ..., f (l[#l])} - - - -
- - - - -
mapWith (f, l, ls)
-
-Map a function over a list of lists. - - -

Parameters

-
    - -
  • - f: function -
  • - -
  • - l: -
  • - -
  • - ls: list of lists -
  • - -
- - - - - - -

Return value:

-result list {f (unpack (ls[1]))), ..., f (unpack (ls[#ls]))} - - - -
- - - - -
new (l, t)
-
-List constructor. Needed in order to use metamethods. - - -

Parameters

-
    - -
  • - l: -
  • - -
  • - t: list (as a table), or nil for empty list -
  • - -
- - - - - - -

Return value:

-list (with list metamethods) - - - -
- - - - -
project (f, l)
-
-Project a list of fields from a list of tables. - - -

Parameters

-
    - -
  • - f: field to project -
  • - -
  • - l: list of tables -
  • - -
- - - - - - -

Return value:

-list of f fields - - - -
- - - - -
relems (l)
-
-An iterator over the elements of a list, in reverse. - - -

Parameters

-
    - -
  • - l: list to iterate over -
  • - -
- - - - - - -

Return values:

-
    - -
  1. iterator function which returns precessive elements of the list - -
  2. the list l as above - -
  3. true - -
- - - -
- - - - -
rep (l, n)
-
-Repeat a list. - - -

Parameters

-
    - -
  • - l: list -
  • - -
  • - n: number of times to repeat -
  • - -
- - - - - - -

Return value:

-n copies of l appended together - - - -
- - - - -
reverse (l)
-
-Reverse a list. - - -

Parameters

-
    - -
  • - l: list -
  • - -
- - - - - - -

Return value:

-list {l[#l], ..., l[1]} - - - -
- - - - -
shape (s, l)
-
-Shape a list according to a list of dimensions. Dimensions are given outermost first and items from the original list are distributed breadth first; there may be one 0 indicating an indefinite number. Hence, {0} is a flat list, {1} is a singleton, {2, 0} is a list of two lists, and {0, 2} is a list of pairs.
Algorithm: turn shape into all positive numbers, calculating the zero if necessary and making sure there is at most one; recursively walk the shape, adding empty tables until the bottom level is reached at which point add table items instead, using a counter to walk the flattened original list.
- - -

Parameters

-
    - -
  • - s: {d1, ..., dn} -
  • - -
  • - l: list to reshape -
  • - -
- - - - - - -

Return value:

-reshaped list FIXME: Use ileaves instead of flatten (needs a while instead of a for in fill function) - - - -
- - - - -
sub (l, from, to)
-
-Return a sub-range of a list. (The equivalent of string.sub on strings; negative list indices count from the end of the list.) - - -

Parameters

-
    - -
  • - l: list -
  • - -
  • - from: start of range (default: 1) -
  • - -
  • - to: end of range (default: #l) -
  • - -
- - - - - - -

Return value:

-{l[from], ..., l[to]} - - - -
- - - - -
tail (l)
-
-Return a list with its first element removed. - - -

Parameters

-
    - -
  • - l: list -
  • - -
- - - - - - -

Return value:

-{l[2], ..., l[#l]} - - - -
- - - - -
transpose (ls)
-
-Transpose a list of lists. This function in Lua is equivalent to zip and unzip in more strongly typed languages. - - -

Parameters

-
    - -
  • - ls: {{l1,1, ..., l1,c}, ..., {lr,1, ..., lr,c}} -
  • - -
- - - - - - -

Return value:

-{{l1,1, ..., lr,1}, ..., {l1,c, ..., lr,c}} - - - -
- - - - -
zipWith (f, ls)
-
-Zip lists together with a function. - - -

Parameters

-
    - -
  • - f: function -
  • - -
  • - ls: list of lists -
  • - -
- - - - - - -

Return value:

-{f (ls[1][1], ..., ls[#ls][1]), ..., f (ls[1][N], ..., ls[#ls][N]) where N = max {map (function (l) return #l end, ls)} - - - -
- - -
- - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/math_ext.html b/files/math_ext.html deleted file mode 100644 index 2c4e978..0000000 --- a/files/math_ext.html +++ /dev/null @@ -1,286 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File math_ext.lua

- - -

Additions to the math module.

- - - - - - -

Functions

- - - - - - - - - - - - -
floor (n, p)Extend math.floor to take the number of decimal places.
round (n, p)Round a number to a given number of decimal places
- - - - - - -
-
- - - - -

Functions

-
- - - -
floor (n, p)
-
-Extend math.floor to take the number of decimal places. - - -

Parameters

-
    - -
  • - n: number -
  • - -
  • - p: number of decimal places to truncate to (default: 0) -
  • - -
- - - - - - -

Return value:

-n truncated to p decimal places - - - -
- - - - -
round (n, p)
-
-Round a number to a given number of decimal places - - -

Parameters

-
    - -
  • - n: number -
  • - -
  • - p: number of decimal places to round to (default: 0) -
  • - -
- - - - - - -

Return value:

-n rounded to p decimal places - - - -
- - -
- - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/mbox.html b/files/mbox.html deleted file mode 100644 index 4021740..0000000 --- a/files/mbox.html +++ /dev/null @@ -1,242 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File mbox.lua

- - - - - - - -

Functions

- - - - - - - -
parse (s)Parse a mailbox into messages.
- - - - - - -
-
- - - - -

Functions

-
- - - -
parse (s)
-
-Parse a mailbox into messages. - - -

Parameters

-
    - -
  • - s: mailbox as a string -
  • - -
- - - - - - -

Return value:

-list of messages, each of form {header = {...}, body = "..."} - - - -
- - -
- - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/modules.html b/files/modules.html deleted file mode 100644 index 8bfa7b5..0000000 --- a/files/modules.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File modules.lua

- - - - - - - - - - - - -
-
- - - - - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/object.html b/files/object.html deleted file mode 100644 index bd86c9d..0000000 --- a/files/object.html +++ /dev/null @@ -1,234 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File object.lua

- - - - - - - - - - -

Tables

- - - - - - - -
ObjectRoot object
- - - -
-
- - - - - - - -

Tables

-
- -
Object
-
Root object - - -Fields -
    - -
  • - _init: constructor method or list of fields to be initialised by the constructor -
  • - -
  • - _clone: object constructor which provides the behaviour for _init documented above -
  • - -
- - -
- - -
- - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/package_ext.html b/files/package_ext.html deleted file mode 100644 index edca151..0000000 --- a/files/package_ext.html +++ /dev/null @@ -1,246 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File package_ext.lua

- - - - - - - - - - -

Tables

- - - - - - - -
packageMake named constants for package.config (undocumented in 5.1; see luaconf.h for C equivalents).
- - - -
-
- - - - - - - -

Tables

-
- -
package
-
Make named constants for package.config (undocumented in 5.1; see luaconf.h for C equivalents). - - -Fields -
    - -
  • - dirsep: directory separator -
  • - -
  • - pathsep: path separator -
  • - -
  • - path_mark: string that marks substitution points in a path template -
  • - -
  • - execdir: (Windows only) replaced by the executable's directory in a path -
  • - -
  • - igmark: Mark to ignore all before it when building luaopen_ function name. -
  • - -
- - -
- - -
- - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/parser.html b/files/parser.html deleted file mode 100644 index 1da5a07..0000000 --- a/files/parser.html +++ /dev/null @@ -1,284 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File parser.lua

- - - - - - - -

Functions

- - - - - - - - - - - - -
Parser:_init (grammar)Parser constructor
Parser:parse (start, token, from)Parse a token list.
- - - - - - -
-
- - - - -

Functions

-
- - - -
Parser:_init (grammar)
-
-Parser constructor - - -

Parameters

-
    - -
  • - grammar: parser grammar -
  • - -
- - - - - - -

Return value:

-parser - - - -
- - - - -
Parser:parse (start, token, from)
-
-Parse a token list. - - -

Parameters

-
    - -
  • - start: the token at which to start -
  • - -
  • - token: the list of tokens -
  • - -
  • - from: the index of the token to start from (default: 1) -
  • - -
- - - - - - -

Return value:

-parse tree - - - -
- - -
- - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/set.html b/files/set.html deleted file mode 100644 index 7f684e9..0000000 --- a/files/set.html +++ /dev/null @@ -1,613 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File set.lua

- - - - - - - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
delete (s, e)Delete an element from a set
difference (s, t)Find the difference of two sets
elems (s)Iterator for sets TODO: Make the iterator return only the key
equal (s, t)Find whether two sets are equal
insert (s, e)Insert an element into a set
intersection (s, t)Find the intersection of two sets
member (s, e)Say whether an element is in a set
propersubset (s, t)Find whether one set is a proper subset of another
subset (s, t)Find whether one set is a subset of another
symmetric_difference (s, t)Find the symmetric difference of two sets
union (s, t)Find the union of two sets
- - - - - - -
-
- - - - -

Functions

-
- - - -
delete (s, e)
-
-Delete an element from a set - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - e: element -
  • - -
- - - - - - - - -
- - - - -
difference (s, t)
-
-Find the difference of two sets - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - t: set -
  • - -
- - - - - - -

Return value:

-s with elements of t removed - - - -
- - - - -
elems (s)
-
-Iterator for sets TODO: Make the iterator return only the key - - -

Parameters

-
    - -
  • - s: -
  • - -
- - - - - - - - -
- - - - -
equal (s, t)
-
-Find whether two sets are equal - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - t: set -
  • - -
- - - - - - -

Return value:

-true if sets are equal, false otherwise - - - -
- - - - -
insert (s, e)
-
-Insert an element into a set - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - e: element -
  • - -
- - - - - - - - -
- - - - -
intersection (s, t)
-
-Find the intersection of two sets - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - t: set -
  • - -
- - - - - - -

Return value:

-set intersection of s and t - - - -
- - - - -
member (s, e)
-
-Say whether an element is in a set - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - e: element -
  • - -
- - - - - - -

Return value:

-true if e is in set, false otherwise - - - -
- - - - -
propersubset (s, t)
-
-Find whether one set is a proper subset of another - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - t: set -
  • - -
- - - - - - -

Return value:

-true if s is a proper subset of t, false otherwise - - - -
- - - - -
subset (s, t)
-
-Find whether one set is a subset of another - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - t: set -
  • - -
- - - - - - -

Return value:

-true if s is a subset of t, false otherwise - - - -
- - - - -
symmetric_difference (s, t)
-
-Find the symmetric difference of two sets - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - t: set -
  • - -
- - - - - - -

Return value:

-elements of s and t that are in s or t but not both - - - -
- - - - -
union (s, t)
-
-Find the union of two sets - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - t: set -
  • - -
- - - - - - -

Return value:

-set union of s and t - - - -
- - -
- - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/std.html b/files/std.html deleted file mode 100644 index 92fdc30..0000000 --- a/files/std.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File std.lua

- - - - - - - - - - - - -
-
- - - - - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/strbuf.html b/files/strbuf.html deleted file mode 100644 index 7075e99..0000000 --- a/files/strbuf.html +++ /dev/null @@ -1,280 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File strbuf.lua

- - - - - - - -

Functions

- - - - - - - - - - - - -
concat (b, s)Add a string to a buffer
tostring (b)Convert a buffer to a string
- - - - - - -
-
- - - - -

Functions

-
- - - -
concat (b, s)
-
-Add a string to a buffer - - -

Parameters

-
    - -
  • - b: buffer -
  • - -
  • - s: string to add -
  • - -
- - - - - - -

Return value:

-buffer - - - -
- - - - -
tostring (b)
-
-Convert a buffer to a string - - -

Parameters

-
    - -
  • - b: buffer -
  • - -
- - - - - - -

Return value:

-string - - - -
- - -
- - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/strict.html b/files/strict.html deleted file mode 100644 index 208054b..0000000 --- a/files/strict.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File strict.lua

- - - - - - - - - - - - -
-
- - - - - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/string_ext.html b/files/string_ext.html deleted file mode 100644 index daa78d7..0000000 --- a/files/string_ext.html +++ /dev/null @@ -1,707 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File string_ext.lua

- - - - - - - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
caps (s)Capitalise each word in a string.
chomp (s)Remove any final newline from a string.
escape_pattern (s)Escape a string to be used as a pattern
finds (s, p, init, plain)Do multiple finds on a string.
ltrim (s, r)Remove leading matter from a string.
numbertosi (n)Write a number using SI suffixes.
ordinal_suffix (n)Return the English suffix for an ordinal.
pad (s, w, p)Justify a string.
rtrim (s, r)Remove trailing matter from a string.
split (s, sep)Split a string at a given separator.
tfind (s, p, init, plain)Do find, returning captures as a list.
trim (s, r)Remove leading and trailing matter from a string.
wrap (s, w, ind, ind1)Wrap a string into a paragraph.
- - - - - - -
-
- - - - -

Functions

-
- - - -
caps (s)
-
-Capitalise each word in a string. - - -

Parameters

-
    - -
  • - s: string -
  • - -
- - - - - - -

Return value:

-capitalised string - - - -
- - - - -
chomp (s)
-
-Remove any final newline from a string. - - -

Parameters

-
    - -
  • - s: string to process -
  • - -
- - - - - - -

Return value:

-processed string - - - -
- - - - -
escape_pattern (s)
-
-Escape a string to be used as a pattern - - -

Parameters

-
    - -
  • - s: string to process @return -
  • - -
- - - - - - - - -
- - - - -
finds (s, p, init, plain)
-
-Do multiple finds on a string. - - -

Parameters

-
    - -
  • - s: target string -
  • - -
  • - p: pattern -
  • - -
  • - init: start position (default: 1) -
  • - -
  • - plain: inhibit magic characters (default: nil) -
  • - -
- - - - - - -

Return value:

-list of {from, to; capt = {captures}} - - - -
- - - - -
ltrim (s, r)
-
-Remove leading matter from a string. - - -

Parameters

-
    - -
  • - s: string -
  • - -
  • - r: leading pattern (default: "%s+") -
  • - -
- - - - - - -

Return value:

-string without leading r - - - -
- - - - -
numbertosi (n)
-
-Write a number using SI suffixes. The number is always written to 3 s.f. - - -

Parameters

-
    - -
  • - n: number -
  • - -
- - - - - - -

Return value:

-string - - - -
- - - - -
ordinal_suffix (n)
-
-Return the English suffix for an ordinal. - - -

Parameters

-
    - -
  • - n: number of the day -
  • - -
- - - - - - -

Return value:

-suffix - - - -
- - - - -
pad (s, w, p)
-
-Justify a string. When the string is longer than w, it is truncated (left or right according to the sign of w). - - -

Parameters

-
    - -
  • - s: string to justify -
  • - -
  • - w: width to justify to (-ve means right-justify; +ve means left-justify) -
  • - -
  • - p: string to pad with (default: " ") -
  • - -
- - - - - - -

Return value:

-justified string - - - -
- - - - -
rtrim (s, r)
-
-Remove trailing matter from a string. - - -

Parameters

-
    - -
  • - s: string -
  • - -
  • - r: trailing pattern (default: "%s+") -
  • - -
- - - - - - -

Return value:

-string without trailing r - - - -
- - - - -
split (s, sep)
-
-Split a string at a given separator. FIXME: Consider Perl and Python versions. - - -

Parameters

-
    - -
  • - s: string to split -
  • - -
  • - sep: separator pattern -
  • - -
- - - - - - -

Return value:

-list of strings - - - -
- - - - -
tfind (s, p, init, plain)
-
-Do find, returning captures as a list. - - -

Parameters

-
    - -
  • - s: target string -
  • - -
  • - p: pattern -
  • - -
  • - init: start position (default: 1) -
  • - -
  • - plain: inhibit magic characters (default: nil) -
  • - -
- - - - - - -

Return value:

-start of match, end of match, table of captures - - - -
- - - - -
trim (s, r)
-
-Remove leading and trailing matter from a string. - - -

Parameters

-
    - -
  • - s: string -
  • - -
  • - r: leading/trailing pattern (default: "%s+") -
  • - -
- - - - - - -

Return value:

-string without leading/trailing r - - - -
- - - - -
wrap (s, w, ind, ind1)
-
-Wrap a string into a paragraph. - - -

Parameters

-
    - -
  • - s: string to wrap -
  • - -
  • - w: width to wrap to (default: 78) -
  • - -
  • - ind: indent (default: 0) -
  • - -
  • - ind1: indent of first line (default: ind) -
  • - -
- - - - - - -

Return value:

-wrapped paragraph - - - -
- - -
- - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/table_ext.html b/files/table_ext.html deleted file mode 100644 index df59014..0000000 --- a/files/table_ext.html +++ /dev/null @@ -1,568 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File table_ext.lua

- - - - - - - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
clone (t, nometa)Make a shallow copy of a table, including any metatable (for a deep copy, use tree.clone).
clone_rename (map, t)Clone a table, renaming some keys.
empty (t)Return whether table is empty.
invert (t)Invert a table.
keys (t)Make the list of keys of a table.
merge (t, u)Merge one table into another.
new (x, t)Make a table with a default value for unset keys.
size (t)Find the number of elements in a table.
sort (t, c)Make table.sort return its result.
values (t)Make the list of values of a table.
- - - - - - -
-
- - - - -

Functions

-
- - - -
clone (t, nometa)
-
-Make a shallow copy of a table, including any metatable (for a deep copy, use tree.clone). - - -

Parameters

-
    - -
  • - t: table -
  • - -
  • - nometa: if non-nil don't copy metatable -
  • - -
- - - - - - -

Return value:

-copy of table - - - -
- - - - -
clone_rename (map, t)
-
-Clone a table, renaming some keys. - - -

Parameters

-
    - -
  • - map: table {old_key=new_key, ...} -
  • - -
  • - t: table to copy -
  • - -
- - - - - - -

Return value:

-copy of table - - - -
- - - - -
empty (t)
-
-Return whether table is empty. - - -

Parameters

-
    - -
  • - t: table -
  • - -
- - - - - - -

Return value:

-true if empty or false otherwise - - - -
- - - - -
invert (t)
-
-Invert a table. - - -

Parameters

-
    - -
  • - t: table {i=v, ...} -
  • - -
- - - - - - -

Return value:

-inverted table {v=i, ...} - - - -
- - - - -
keys (t)
-
-Make the list of keys of a table. - - -

Parameters

-
    - -
  • - t: table -
  • - -
- - - - - - -

Return value:

-list of keys - - - -
- - - - -
merge (t, u)
-
-Merge one table into another. u is merged into t. - - -

Parameters

-
    - -
  • - t: first table -
  • - -
  • - u: second table -
  • - -
- - - - - - -

Return value:

-first table - - - -
- - - - -
new (x, t)
-
-Make a table with a default value for unset keys. - - -

Parameters

-
    - -
  • - x: default entry value (default: nil) -
  • - -
  • - t: initial table (default: {}) -
  • - -
- - - - - - -

Return value:

-table whose unset elements are x - - - -
- - - - -
size (t)
-
-Find the number of elements in a table. - - -

Parameters

-
    - -
  • - t: table -
  • - -
- - - - - - -

Return value:

-number of elements in t - - - -
- - - - -
sort (t, c)
-
-Make table.sort return its result. - - -

Parameters

-
    - -
  • - t: table -
  • - -
  • - c: comparator function -
  • - -
- - - - - - -

Return value:

-sorted table - - - -
- - - - -
values (t)
-
-Make the list of values of a table. - - -

Parameters

-
    - -
  • - t: table -
  • - -
- - - - - - -

Return value:

-list of values - - - -
- - -
- - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/tree.html b/files/tree.html deleted file mode 100644 index 6f71ec7..0000000 --- a/files/tree.html +++ /dev/null @@ -1,395 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File tree.lua

- - - - - - - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
clone (t, nometa)Make a deep copy of a tree, including any metatables
merge (t, u)Deep-merge one tree into another.
metatable.__index (tr, i)Tree __index metamethod.
metatable.__newindex (tr, i, v)Tree __newindex metamethod.
new (t)Make a table into a tree
- - - - - - -
-
- - - - -

Functions

-
- - - -
clone (t, nometa)
-
-Make a deep copy of a tree, including any metatables - - -

Parameters

-
    - -
  • - t: table -
  • - -
  • - nometa: if non-nil don't copy metatables -
  • - -
- - - - - - -

Return value:

-copy of table - - - -
- - - - -
merge (t, u)
-
-Deep-merge one tree into another. u is merged into t. - - -

Parameters

-
    - -
  • - t: first tree -
  • - -
  • - u: second tree -
  • - -
- - - - - - -

Return value:

-first tree - - - -
- - - - -
metatable.__index (tr, i)
-
-Tree __index metamethod. - - -

Parameters

-
    - -
  • - tr: tree -
  • - -
  • - i: non-table, or list of keys {i1 ... in} -
  • - -
- - - - - - -

Return value:

-tr[i]...[in] if i is a table, or tr[i] otherwise - - - -
- - - - -
metatable.__newindex (tr, i, v)
-
-Tree __newindex metamethod. Sets tr[i1]...[in] = v if i is a table, or tr[i] = v otherwise - - -

Parameters

-
    - -
  • - tr: tree -
  • - -
  • - i: non-table, or list of keys {i1 ... in} -
  • - -
  • - v: value -
  • - -
- - - - - - - - -
- - - - -
new (t)
-
-Make a table into a tree - - -

Parameters

-
    - -
  • - t: table -
  • - -
- - - - - - -

Return value:

-tree - - - -
- - -
- - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/files/xml.html b/files/xml.html deleted file mode 100644 index 9bbda48..0000000 --- a/files/xml.html +++ /dev/null @@ -1,247 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

File xml.lua

- - - - - - - -

Functions

- - - - - - - -
string.writeXML (t, indent, spacing)Write a table as XML.
- - - - - - -
-
- - - - -

Functions

-
- - - -
string.writeXML (t, indent, spacing)
-
-Write a table as XML. The input format is assumed to be that output by luaexpat. - - -

Parameters

-
    - -
  • - t: table to print. In each element, tag is its name, attr is the table of attributes, and the sub-elements are held in the integer keys -
  • - -
  • - indent: indent between levels (default: "\t") -
  • - -
  • - spacing: space before every line -
  • - -
- - - - - - - - -
- - -
- - - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/index.html b/index.html index c92cf55..2e8e186 100644 --- a/index.html +++ b/index.html @@ -1,13 +1,13 @@ + Reference - - + - +
@@ -16,314 +16,121 @@
-
- - -
-

Valid XHTML 1.0!

+generated by LDoc 1.4.0
- -
+
diff --git a/ldoc.css b/ldoc.css new file mode 100644 index 0000000..765c710 --- /dev/null +++ b/ldoc.css @@ -0,0 +1,302 @@ +/* BEGIN RESET + +Copyright (c) 2010, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 +*/ +html { + color: #000; + background: #FFF; +} +body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td { + margin: 0; + padding: 0; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +fieldset,img { + border: 0; +} +address,caption,cite,code,dfn,em,strong,th,var,optgroup { + font-style: inherit; + font-weight: inherit; +} +del,ins { + text-decoration: none; +} +li { + list-style: disc; + margin-left: 20px; +} +caption,th { + text-align: left; +} +h1,h2,h3,h4,h5,h6 { + font-size: 100%; + font-weight: bold; +} +q:before,q:after { + content: ''; +} +abbr,acronym { + border: 0; + font-variant: normal; +} +sup { + vertical-align: baseline; +} +sub { + vertical-align: baseline; +} +legend { + color: #000; +} +input,button,textarea,select,optgroup,option { + font-family: inherit; + font-size: inherit; + font-style: inherit; + font-weight: inherit; +} +input,button,textarea,select {*font-size:100%; +} +/* END RESET */ + +body { + margin-left: 1em; + margin-right: 1em; + font-family: arial, helvetica, geneva, sans-serif; + background-color: #ffffff; margin: 0px; +} + +code, tt { font-family: monospace; } +span.parameter { font-family:monospace; } +span.parameter:after { content:":"; } +span.types:before { content:"("; } +span.types:after { content:")"; } +.type { font-weight: bold; font-style:italic } + +body, p, td, th { font-size: .95em; line-height: 1.2em;} + +p, ul { margin: 10px 0 0 0px;} + +strong { font-weight: bold;} + +em { font-style: italic;} + +h1 { + font-size: 1.5em; + margin: 0 0 20px 0; +} +h2, h3, h4 { margin: 15px 0 10px 0; } +h2 { font-size: 1.25em; } +h3 { font-size: 1.15em; } +h4 { font-size: 1.06em; } + +a:link { font-weight: bold; color: #004080; text-decoration: none; } +a:visited { font-weight: bold; color: #006699; text-decoration: none; } +a:link:hover { text-decoration: underline; } + +hr { + color:#cccccc; + background: #00007f; + height: 1px; +} + +blockquote { margin-left: 3em; } + +ul { list-style-type: disc; } + +p.name { + font-family: "Andale Mono", monospace; + padding-top: 1em; +} + +pre.example { + background-color: rgb(245, 245, 245); + border: 1px solid silver; + padding: 10px; + margin: 10px 0 10px 0; + font-family: "Andale Mono", monospace; + font-size: .85em; +} + +pre { + background-color: rgb(245, 245, 245); + border: 1px solid silver; + padding: 10px; + margin: 10px 0 10px 0; + overflow: auto; + font-family: "Andale Mono", monospace; +} + + +table.index { border: 1px #00007f; } +table.index td { text-align: left; vertical-align: top; } + +#container { + margin-left: 1em; + margin-right: 1em; + background-color: #f0f0f0; +} + +#product { + text-align: center; + border-bottom: 1px solid #cccccc; + background-color: #ffffff; +} + +#product big { + font-size: 2em; +} + +#main { + background-color: #f0f0f0; + border-left: 2px solid #cccccc; +} + +#navigation { + float: left; + width: 18em; + vertical-align: top; + background-color: #f0f0f0; + overflow: visible; +} + +#navigation h2 { + background-color:#e7e7e7; + font-size:1.1em; + color:#000000; + text-align: left; + padding:0.2em; + border-top:1px solid #dddddd; + border-bottom:1px solid #dddddd; +} + +#navigation ul +{ + font-size:1em; + list-style-type: none; + margin: 1px 1px 10px 1px; +} + +#navigation li { + text-indent: -1em; + display: block; + margin: 3px 0px 0px 22px; +} + +#navigation li li a { + margin: 0px 3px 0px -1em; +} + +#content { + margin-left: 18em; + padding: 1em; + width: 700px; + border-left: 2px solid #cccccc; + border-right: 2px solid #cccccc; + background-color: #ffffff; +} + +#about { + clear: both; + padding: 5px; + border-top: 2px solid #cccccc; + background-color: #ffffff; +} + +@media print { + body { + font: 12pt "Times New Roman", "TimeNR", Times, serif; + } + a { font-weight: bold; color: #004080; text-decoration: underline; } + + #main { + background-color: #ffffff; + border-left: 0px; + } + + #container { + margin-left: 2%; + margin-right: 2%; + background-color: #ffffff; + } + + #content { + padding: 1em; + background-color: #ffffff; + } + + #navigation { + display: none; + } + pre.example { + font-family: "Andale Mono", monospace; + font-size: 10pt; + page-break-inside: avoid; + } +} + +table.module_list { + border-width: 1px; + border-style: solid; + border-color: #cccccc; + border-collapse: collapse; +} +table.module_list td { + border-width: 1px; + padding: 3px; + border-style: solid; + border-color: #cccccc; +} +table.module_list td.name { background-color: #f0f0f0; min-width: 200px; } +table.module_list td.summary { width: 100%; } + + +table.function_list { + border-width: 1px; + border-style: solid; + border-color: #cccccc; + border-collapse: collapse; +} +table.function_list td { + border-width: 1px; + padding: 3px; + border-style: solid; + border-color: #cccccc; +} +table.function_list td.name { background-color: #f0f0f0; min-width: 200px; } +table.function_list td.summary { width: 100%; } + +ul.nowrap { + overflow:auto; + white-space:nowrap; +} + +dl.table dt, dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;} +dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;} +dl.table h3, dl.function h3 {font-size: .95em;} + +/* stop sublists from having initial vertical space */ +ul ul { margin-top: 0px; } +ol ul { margin-top: 0px; } +ol ol { margin-top: 0px; } +ul ol { margin-top: 0px; } + +/* styles for prettification of source */ +pre .comment { color: #558817; } +pre .constant { color: #a8660d; } +pre .escape { color: #844631; } +pre .keyword { color: #2239a8; font-weight: bold; } +pre .library { color: #0e7c6b; } +pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; } +pre .string { color: #a8660d; } +pre .number { color: #f8660d; } +pre .operator { color: #2239a8; font-weight: bold; } +pre .preprocessor, pre .prepro { color: #a33243; } +pre .global { color: #800080; } +pre .prompt { color: #558817; } +pre .url { color: #272fc2; text-decoration: underline; } diff --git a/luadoc.css b/luadoc.css deleted file mode 100644 index bc0f98a..0000000 --- a/luadoc.css +++ /dev/null @@ -1,286 +0,0 @@ -body { - margin-left: 1em; - margin-right: 1em; - font-family: arial, helvetica, geneva, sans-serif; - background-color:#ffffff; margin:0px; -} - -code { - font-family: "Andale Mono", monospace; -} - -tt { - font-family: "Andale Mono", monospace; -} - -body, td, th { font-size: 11pt; } - -h1, h2, h3, h4 { margin-left: 0em; } - -textarea, pre, tt { font-size:10pt; } -body, td, th { color:#000000; } -small { font-size:0.85em; } -h1 { font-size:1.5em; } -h2 { font-size:1.25em; } -h3 { font-size:1.15em; } -h4 { font-size:1.06em; } - -a:link { font-weight:bold; color: #004080; text-decoration: none; } -a:visited { font-weight:bold; color: #006699; text-decoration: none; } -a:link:hover { text-decoration:underline; } -hr { color:#cccccc } -img { border-width: 0px; } - - -h3 { padding-top: 1em; } - -p { margin-left: 1em; } - -p.name { - font-family: "Andale Mono", monospace; - padding-top: 1em; - margin-left: 0em; -} - -blockquote { margin-left: 3em; } - -pre.example { - background-color: rgb(245, 245, 245); - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-left-style: solid; - border-top-color: silver; - border-right-color: silver; - border-bottom-color: silver; - border-left-color: silver; - padding: 1em; - margin-left: 1em; - margin-right: 1em; - font-family: "Andale Mono", monospace; - font-size: smaller; -} - - -hr { - margin-left: 0em; - background: #00007f; - border: 0px; - height: 1px; -} - -ul { list-style-type: disc; } - -table.index { border: 1px #00007f; } -table.index td { text-align: left; vertical-align: top; } -table.index ul { padding-top: 0em; margin-top: 0em; } - -table { - border: 1px solid black; - border-collapse: collapse; - margin-left: auto; - margin-right: auto; -} -th { - border: 1px solid black; - padding: 0.5em; -} -td { - border: 1px solid black; - padding: 0.5em; -} -div.header, div.footer { margin-left: 0em; } - -#container -{ - margin-left: 1em; - margin-right: 1em; - background-color: #f0f0f0; -} - -#product -{ - text-align: center; - border-bottom: 1px solid #cccccc; - background-color: #ffffff; -} - -#product big { - font-size: 2em; -} - -#product_logo -{ -} - -#product_name -{ -} - -#product_description -{ -} - -#main -{ - background-color: #f0f0f0; - border-left: 2px solid #cccccc; -} - -#navigation -{ - float: left; - width: 18em; - margin: 0; - vertical-align: top; - background-color: #f0f0f0; - overflow:visible; -} - -#navigation h1 { - background-color:#e7e7e7; - font-size:1.1em; - color:#000000; - text-align:left; - margin:0px; - padding:0.2em; - border-top:1px solid #dddddd; - border-bottom:1px solid #dddddd; -} - -#navigation ul -{ - font-size:1em; - list-style-type: none; - padding: 0; - margin: 1px; -} - -#navigation li -{ - text-indent: -1em; - margin: 0em 0em 0em 0.5em; - display: block; - padding: 3px 0px 0px 12px; -} - -#navigation li li a -{ - padding: 0px 3px 0px -1em; -} - -#content -{ - margin-left: 18em; - padding: 1em; - border-left: 2px solid #cccccc; - border-right: 2px solid #cccccc; - background-color: #ffffff; -} - -#about -{ - clear: both; - margin: 0; - padding: 5px; - border-top: 2px solid #cccccc; - background-color: #ffffff; -} - -@media print { - body { - font: 12pt "Times New Roman", "TimeNR", Times, serif; - } - a { font-weight:bold; color: #004080; text-decoration: underline; } - - #main { background-color: #ffffff; border-left: 0px; } - #container { margin-left: 2%; margin-right: 2%; background-color: #ffffff; } - - #content { margin-left: 0px; padding: 1em; border-left: 0px; border-right: 0px; background-color: #ffffff; } - - #navigation { display: none; - } - pre.example { - font-family: "Andale Mono", monospace; - font-size: 10pt; - page-break-inside: avoid; - } -} - -table.module_list td -{ - border-width: 1px; - padding: 3px; - border-style: solid; - border-color: #cccccc; -} -table.module_list td.name { background-color: #f0f0f0; } -table.module_list td.summary { width: 100%; } - -table.file_list -{ - border-width: 1px; - border-style: solid; - border-color: #cccccc; - border-collapse: collapse; -} -table.file_list td -{ - border-width: 1px; - padding: 3px; - border-style: solid; - border-color: #cccccc; -} -table.file_list td.name { background-color: #f0f0f0; } -table.file_list td.summary { width: 100%; } - - -table.function_list -{ - border-width: 1px; - border-style: solid; - border-color: #cccccc; - border-collapse: collapse; -} -table.function_list td -{ - border-width: 1px; - padding: 3px; - border-style: solid; - border-color: #cccccc; -} -table.function_list td.name { background-color: #f0f0f0; } -table.function_list td.summary { width: 100%; } - - -table.table_list -{ - border-width: 1px; - border-style: solid; - border-color: #cccccc; - border-collapse: collapse; -} -table.table_list td -{ - border-width: 1px; - padding: 3px; - border-style: solid; - border-color: #cccccc; -} -table.table_list td.name { background-color: #f0f0f0; } -table.table_list td.summary { width: 100%; } - -dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;} -dl.function dd {padding-bottom: 1em;} -dl.function h3 {padding: 0; margin: 0; font-size: medium;} - -dl.table dt {border-top: 1px solid #ccc; padding-top: 1em;} -dl.table dd {padding-bottom: 1em;} -dl.table h3 {padding: 0; margin: 0; font-size: medium;} - -#TODO: make module_list, file_list, function_list, table_list inherit from a list - diff --git a/modules/base.html b/modules/base.html deleted file mode 100644 index 8f85c51..0000000 --- a/modules/base.html +++ /dev/null @@ -1,1531 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

Module base

- -

Adds to the existing global functions

- - - - - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
_G.assert (v, f, ...)Extend to allow formatted arguments.
_G.bind (f, ...)Partially apply a function.
_G.collect (i, ...)Collect the results of an iterator.
_G.compose (..., f1...fn)Compose functions.
_G.curry (f, n)Curry a function.
_G.die (...)Die with error.
_G.eval (s)Evaluate a string.
_G.filter (p, i, ...)Filter an iterator with a predicate.
_G.fold (f, d, i, ...)Fold a binary function into an iterator.
_G.id (...)Identity function.
_G.ileaves (tr)Tree iterator which returns just numbered leaves, in order.
_G.inodes (tr)Tree iterator over numbered nodes, in order.
_G.leaves (tr)Tree iterator which returns just leaves.
_G.map (f, i, ...)Map a function over an iterator.
_G.memoize (fn)Memoize a function, by wrapping it in a functable.
_G.metamethod (x, n)Return given metamethod, if any, or nil.
_G.nodes (tr)Tree iterator.
_G.pack (...)Turn a tuple into a list.
_G.pickle (x)Convert a value to a string.
_G.prettytostring (t, indent, spacing)Pretty-print a table.
_G.render (x, open, close, elem, pair, sep, roots)Turn tables into strings with recursion detection.
_G.require_version (module, min, too_big, pattern)Require a module with a particular version
_G.ripairs (t)An iterator like ipairs, but in reverse.
_G.tostring (x)Extend tostring to work better on tables.
_G.totable (x)Turn an object into a table according to __totable metamethod.
_G.warn (...)Give warning with the name of program and file (if any).
render_CloseRenderer (t)
render_ElementRenderer (e)
render_OpenRenderer (t)
render_PairRenderer N.B. the function should not try to render i and v, or treat them recursively. (t, i, v, is, vs)
render_SeparatorRenderer (t, i, v, j, w)
tree_Iterator (it, tr, n)
- - - - -

Tables

- - - - - - - -
_G.opFunctional forms of infix operators.
- - - -
-
- - - -

Functions

-
- - - -
_G.assert (v, f, ...)
-
-Extend to allow formatted arguments. - - -

Parameters

-
    - -
  • - v: value to assert -
  • - -
  • - f: format -
  • - -
  • - ...: arguments to format -
  • - -
- - - - - - -

Return value:

-value - - - -
- - - - -
_G.bind (f, ...)
-
-Partially apply a function. - - -

Parameters

-
    - -
  • - f: function to apply partially -
  • - -
  • - ...: arguments to bind -
  • - -
- - - - - - -

Return value:

-function with ai already bound - - - -
- - - - -
_G.collect (i, ...)
-
-Collect the results of an iterator. - - -

Parameters

-
    - -
  • - i: iterator -
  • - -
  • - ...: -
  • - -
- - - - - - -

Return value:

-results of running the iterator on its arguments - - - -
- - - - -
_G.compose (..., f1...fn)
-
-Compose functions. - - -

Parameters

-
    - -
  • - ...: -
  • - -
  • - f1...fn: functions to compose -
  • - -
- - - - - - -

Return value:

-composition of f1 ... fn - - - -
- - - - -
_G.curry (f, n)
-
-Curry a function. - - -

Parameters

-
    - -
  • - f: function to curry -
  • - -
  • - n: number of arguments -
  • - -
- - - - - - -

Return value:

-curried version of f - - - -
- - - - -
_G.die (...)
-
-Die with error. - - -

Parameters

-
    - -
  • - ...: arguments for format -
  • - -
- - - - - - - - -
- - - - -
_G.eval (s)
-
-Evaluate a string. - - -

Parameters

-
    - -
  • - s: string -
  • - -
- - - - - - -

Return value:

-value of string - - - -
- - - - -
_G.filter (p, i, ...)
-
-Filter an iterator with a predicate. - - -

Parameters

-
    - -
  • - p: predicate -
  • - -
  • - i: iterator -
  • - -
  • - ...: -
  • - -
- - - - - - -

Return value:

-result table containing elements e for which p (e) - - - -
- - - - -
_G.fold (f, d, i, ...)
-
-Fold a binary function into an iterator. - - -

Parameters

-
    - -
  • - f: function -
  • - -
  • - d: initial first argument -
  • - -
  • - i: iterator -
  • - -
  • - ...: -
  • - -
- - - - - - -

Return value:

-result - - - -
- - - - -
_G.id (...)
-
-Identity function. - - -

Parameters

-
    - -
  • - ...: -
  • - -
- - - - - - -

Return value:

-the arguments passed to the function - - - -
- - - - -
_G.ileaves (tr)
-
-Tree iterator which returns just numbered leaves, in order. - - -

Parameters

-
    - -
  • - tr: tree to iterate over -
  • - -
- - - - - - -

Return values:

-
    - -
  1. iterator function - -
  2. the tree, as above - -
- - - -
- - - - -
_G.inodes (tr)
-
-Tree iterator over numbered nodes, in order. - - -

Parameters

-
    - -
  • - tr: tree to iterate over -
  • - -
- - - - - - -

Return values:

-
    - -
  1. iterator function - -
  2. the tree, as above - -
- - - -

See also:

- - -
- - - - -
_G.leaves (tr)
-
-Tree iterator which returns just leaves. - - -

Parameters

-
    - -
  • - tr: tree to iterate over -
  • - -
- - - - - - -

Return values:

-
    - -
  1. iterator function - -
  2. the tree, as above - -
- - - -
- - - - -
_G.map (f, i, ...)
-
-Map a function over an iterator. - - -

Parameters

-
    - -
  • - f: function -
  • - -
  • - i: iterator -
  • - -
  • - ...: -
  • - -
- - - - - - -

Return value:

-result table - - - -
- - - - -
_G.memoize (fn)
-
-Memoize a function, by wrapping it in a functable. - - -

Parameters

-
    - -
  • - fn: function that returns a single result -
  • - -
- - - - - - -

Return value:

-memoized function - - - -
- - - - -
_G.metamethod (x, n)
-
-Return given metamethod, if any, or nil. - - -

Parameters

-
    - -
  • - x: object to get metamethod of -
  • - -
  • - n: name of metamethod to get -
  • - -
- - - - - - -

Return value:

-metamethod function or nil if no metamethod or not a function - - - -
- - - - -
_G.nodes (tr)
-
-Tree iterator. - - -

Parameters

-
    - -
  • - tr: tree to iterate over -
  • - -
- - - - - - -

Return values:

-
    - -
  1. iterator function - -
  2. the tree, as above - -
- - - -

See also:

- - -
- - - - -
_G.pack (...)
-
-Turn a tuple into a list. - - -

Parameters

-
    - -
  • - ...: tuple -
  • - -
- - - - - - -

Return value:

-list - - - -
- - - - -
_G.pickle (x)
-
-Convert a value to a string. The string can be passed to dostring to retrieve the value.
TODO: Make it work for recursive tables. - - -

Parameters

-
    - -
  • - x: object to pickle -
  • - -
- - - - - - -

Return value:

-string such that eval (s) is the same value as x - - - -
- - - - -
_G.prettytostring (t, indent, spacing)
-
-Pretty-print a table. - - -

Parameters

-
    - -
  • - t: table to print -
  • - -
  • - indent: indent between levels ["\t"] -
  • - -
  • - spacing: space before every line -
  • - -
- - - - - - -

Return value:

-pretty-printed string - - - -
- - - - -
_G.render (x, open, close, elem, pair, sep, roots)
-
-Turn tables into strings with recursion detection. N.B. Functions calling render should not recurse, or recursion detection will not work. - - -

Parameters

-
    - -
  • - x: object to convert to string -
  • - -
  • - open: open table renderer -
  • - -
  • - close: close table renderer -
  • - -
  • - elem: element renderer -
  • - -
  • - pair: pair renderer -
  • - -
  • - sep: separator renderer -
  • - -
  • - roots: -
  • - -
- - - - - - -

Return value:

-string representation - - - -

See also:

- - -
- - - - -
_G.require_version (module, min, too_big, pattern)
-
-Require a module with a particular version - - -

Parameters

-
    - -
  • - module: module to require -
  • - -
  • - min: lowest acceptable version (default: any) -
  • - -
  • - too_big: lowest version that is too big (default: none) -
  • - -
  • - pattern: -
  • - -
- - - - - - - - -
- - - - -
_G.ripairs (t)
-
-An iterator like ipairs, but in reverse. - - -

Parameters

-
    - -
  • - t: table to iterate over -
  • - -
- - - - - - -

Return values:

-
    - -
  1. iterator function - -
  2. the table, as above - -
  3. #t + 1 - -
- - - -
- - - - -
_G.tostring (x)
-
-Extend tostring to work better on tables. The original tostring is available as _tostring. - - -

Parameters

-
    - -
  • - x: object to convert to string -
  • - -
- - - - - - -

Return value:

-string representation - - - -
- - - - -
_G.totable (x)
-
-Turn an object into a table according to __totable metamethod. - - -

Parameters

-
    - -
  • - x: object to turn into a table -
  • - -
- - - - - - -

Return value:

-table or nil - - - -
- - - - -
_G.warn (...)
-
-Give warning with the name of program and file (if any). - - -

Parameters

-
    - -
  • - ...: arguments for format -
  • - -
- - - - - - - - -
- - - - -
render_CloseRenderer (t)
-
- - - -

Parameters

-
    - -
  • - t: table -
  • - -
- - - - - - -

Return value:

-close table string - - - -
- - - - -
render_ElementRenderer (e)
-
- - - -

Parameters

-
    - -
  • - e: element -
  • - -
- - - - - - -

Return value:

-element string - - - -
- - - - -
render_OpenRenderer (t)
-
- - - -

Parameters

-
    - -
  • - t: table -
  • - -
- - - - - - -

Return value:

-open table string - - - -
- - - - -
render_PairRenderer N.B. the function should not try to render i and v, or treat them recursively. (t, i, v, is, vs)
-
- - - -

Parameters

-
    - -
  • - t: table -
  • - -
  • - i: index -
  • - -
  • - v: value -
  • - -
  • - is: index string -
  • - -
  • - vs: value string -
  • - -
- - - - - - -

Return value:

-element string - - - -
- - - - -
render_SeparatorRenderer (t, i, v, j, w)
-
- - - -

Parameters

-
    - -
  • - t: table -
  • - -
  • - i: preceding index (nil on first call) -
  • - -
  • - v: preceding value (nil on first call) -
  • - -
  • - j: following index (nil on last call) -
  • - -
  • - w: following value (nil on last call) -
  • - -
- - - - - - -

Return value:

-separator string - - - -
- - - - -
tree_Iterator (it, tr, n)
-
- - - -

Parameters

-
    - -
  • - it: -
  • - -
  • - tr: -
  • - -
  • - n: current node -
  • - -
- - - - - - -

Return values:

-
    - -
  1. type ("leaf", "branch" (pre-order) or "join" (post-order)) - -
  2. path to node ({i1...ik}) - -
  3. node - -
- - - -
- - -
- - - - -

Tables

-
- -
_G.op
-
Functional forms of infix operators. Defined here so that other modules can write to it. - - - -
- - -
- - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/modules/bin.html b/modules/bin.html deleted file mode 100644 index 3491814..0000000 --- a/modules/bin.html +++ /dev/null @@ -1,328 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

Module bin

- -

Binary data utilities

- - - - - -

Functions

- - - - - - - - - - - - -
le_to_hex (s)Turn a little-endian word into a hex string
le_to_number (s)Turn a little-endian word into a number
- - - - - - -
-
- - - -

Functions

-
- - - -
le_to_hex (s)
-
-Turn a little-endian word into a hex string - - -

Parameters

-
    - -
  • - s: -
  • - -
- - - - - - - - -
- - - - -
le_to_number (s)
-
-Turn a little-endian word into a number - - -

Parameters

-
    - -
  • - s: -
  • - -
- - - - - - - - -
- - -
- - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/modules/debug.html b/modules/debug.html deleted file mode 100644 index 502ef24..0000000 --- a/modules/debug.html +++ /dev/null @@ -1,343 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

Module debug

- -

Additions to the debug module

- - - - - -

Functions

- - - - - - - - - - - - - - - - - -
debug ()The global function debug is an abbreviation for debug.say (1, ...)
say (n, ...)Print a debugging message
trace (event)Trace function calls Use as debug.sethook (trace, "cr"), which is done automatically when _DEBUG.call is set.
- - - - -

Tables

- - - - - - - -
_DEBUGTo activate debugging set _DEBUG either to any true value (equivalent to {level = 1}), or as documented below.
- - - -
-
- - - -

Functions

-
- - - -
debug ()
-
-The global function debug is an abbreviation for debug.say (1, ...) - - - - - - - - - -

See also:

- - -
- - - - -
say (n, ...)
-
-Print a debugging message - - -

Parameters

-
    - -
  • - n: debugging level, defaults to 1 -
  • - -
  • - ...: objects to print (as for print) -
  • - -
- - - - - - - - -
- - - - -
trace (event)
-
-Trace function calls Use as debug.sethook (trace, "cr"), which is done automatically when _DEBUG.call is set. Based on test/trace-calls.lua from the Lua distribution. - - -

Parameters

-
    - -
  • - event: event causing the call -
  • - -
- - - - - - - - -
- - -
- - - - -

Tables

-
- -
_DEBUG
-
To activate debugging set _DEBUG either to any true value (equivalent to {level = 1}), or as documented below. - - -Fields -
    - -
  • - level: debugging level -
  • - -
  • - call: do call trace debugging -
  • - -
  • - std: do standard library debugging (run examples & test code) -
  • - -
- - -
- - -
- - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/modules/fstable.html b/modules/fstable.html deleted file mode 100644 index f998230..0000000 --- a/modules/fstable.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

Module fstable

- -

Tables mapped to the filing system Only string keys are permitted; package.dirsep characters are converted to underscores. Values are stored as strings (converted by tostring). As with disk operations, a table's elements must be set to nil (deleted) before the table itself can be set to nil.

- - - - - -

Functions

- - - - - - - -
new (path, t)Bind a directory to a table
- - - - - - -
-
- - - -

Functions

-
- - - -
new (path, t)
-
-Bind a directory to a table - - -

Parameters

-
    - -
  • - path: directory path -
  • - -
  • - t: table to merge with directory -
  • - -
- - - - - - -

Return value:

-table bound to directory - - - -
- - -
- - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/modules/getopt.html b/modules/getopt.html deleted file mode 100644 index 0a6f18f..0000000 --- a/modules/getopt.html +++ /dev/null @@ -1,473 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

Module getopt

- -

Simplified getopt, based on Svenne Panne's Haskell GetOpt.
Usage:

  • options = {Option {...}, ...}
    getopt.processArgs ()
  • Assumes prog = {name[, banner] [, purpose] [, notes] [, usage]}
  • Options take a single dash, but may have a double dash.
  • Arguments may be given as -opt=arg or -opt arg.
  • If an option taking an argument is given multiple times, only the last value is returned; missing arguments are returned as 1.
getOpt, usageInfo and usage can be called directly (see below, and the example at the end). Set _DEBUG.std to a non-nil value to run the example.
  • TODO: Sort out the packaging. getopt.Option is tedious to type, but surely Option shouldn't be in the root namespace?
  • TODO: Wrap all messages; do all wrapping in processArgs, not usageInfo; use sdoc-like library (see string.format todos).
  • TODO: Don't require name to be repeated in banner.
  • TODO: Store version separately (construct banner?).

- - - - - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
getOpt (argIn, options)Perform argument processing
makeOptions (t)Options table constructor: adds lookup tables for the option names
processArgs ()Simple getOpt wrapper.
usage ()Emit a usage message.
usageInfo (header, optDesc, pageWidth)Produce usage info for the given options
- - - - -

Tables

- - - - - - - -
_G.OptionOptions table type.
- - - -
-
- - - -

Functions

-
- - - -
getOpt (argIn, options)
-
-Perform argument processing - - -

Parameters

-
    - -
  • - argIn: list of command-line args -
  • - -
  • - options: options table -
  • - -
- - - - - - -

Return values:

-
    - -
  1. table of remaining non-options - -
  2. table of option key-value list pairs - -
  3. table of error messages - -
- - - -
- - - - -
makeOptions (t)
-
-Options table constructor: adds lookup tables for the option names - - -

Parameters

-
    - -
  • - t: -
  • - -
- - - - - - - - -
- - - - -
processArgs ()
-
-Simple getOpt wrapper. Adds -version/-V and -help/-h automatically; stops program if there was an error, or if -help or -version was used. - - - - - - - - - -
- - - - -
usage ()
-
-Emit a usage message. - - - - - - - - - -
- - - - -
usageInfo (header, optDesc, pageWidth)
-
-Produce usage info for the given options - - -

Parameters

-
    - -
  • - header: header string -
  • - -
  • - optDesc: option descriptors -
  • - -
  • - pageWidth: width to format to [78] -
  • - -
- - - - - - -

Return value:

-formatted string - - - -
- - -
- - - - -

Tables

-
- -
_G.Option
-
Options table type. - - -Fields -
    - -
  • - name: list of names -
  • - -
  • - desc: description of this option -
  • - -
  • - type: type of argument (if any): Req(uired), Opt(ional) -
  • - -
  • - var: descriptive name for the argument -
  • - -
- - -
- - -
- - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/modules/io.html b/modules/io.html deleted file mode 100644 index 8f7f7b4..0000000 --- a/modules/io.html +++ /dev/null @@ -1,476 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

Module io

- -

Additions to the io module

- - - - - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
catdir (...)Concatenate two or more directories into a path, removing the trailing slash.
catfile (...)Concatenate one or more directories and a filename into a path.
processFiles (f)Process files specified on the command-line.
readlines (h)Read a file or file handle into a list of lines.
shell (c)Perform a shell command and return its output.
slurp (h)Slurp a file handle.
splitdir (path)Split a directory path into components.
writelines (h, ...)Write values adding a newline after each.
- - - - - - -
-
- - - -

Functions

-
- - - -
catdir (...)
-
-Concatenate two or more directories into a path, removing the trailing slash. - - -

Parameters

-
    - -
  • - ...: path components -
  • - -
- - - - - - -

Return value:

-path - - - -
- - - - -
catfile (...)
-
-Concatenate one or more directories and a filename into a path. - - -

Parameters

-
    - -
  • - ...: path components -
  • - -
- - - - - - -

Return value:

-path - - - -
- - - - -
processFiles (f)
-
-Process files specified on the command-line. If no files given, process io.stdin; in list of files, - means io.stdin.
FIXME: Make the file list an argument to the function. - - -

Parameters

-
    - -
  • - f: function to process files with, which is passed (name, arg_no) -
  • - -
- - - - - - - - -
- - - - -
readlines (h)
-
-Read a file or file handle into a list of lines. - - -

Parameters

-
    - -
  • - h: file handle or name (default: io.input ()); if h is a handle, the file is closed after reading -
  • - -
- - - - - - -

Return value:

-list of lines - - - -
- - - - -
shell (c)
-
-Perform a shell command and return its output. - - -

Parameters

-
    - -
  • - c: command -
  • - -
- - - - - - -

Return value:

-output, or nil if error - - - -
- - - - -
slurp (h)
-
-Slurp a file handle. - - -

Parameters

-
    - -
  • - h: file handle or name (default: io.input ()) -
  • - -
- - - - - - -

Return value:

-contents of file or handle, or nil if error - - - -
- - - - -
splitdir (path)
-
-Split a directory path into components. Empty components are retained: the root directory becomes {"", ""}. - - -

Parameters

-
    - -
  • - path: path -
  • - -
- - - - - - -

Return value:

-list of path components - - - -
- - - - -
writelines (h, ...)
-
-Write values adding a newline after each. - - -

Parameters

-
    - -
  • - h: file handle (default: io.output () -
  • - -
  • - ...: values to write (as for write) -
  • - -
- - - - - - - - -
- - -
- - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/modules/lcs.html b/modules/lcs.html deleted file mode 100644 index 7dc03d2..0000000 --- a/modules/lcs.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

Module lcs

- -

Longest Common Subsequence algorithm. After pseudo-code in lecture notes by David Eppstein.

- - - - - -

Functions

- - - - - - - -
longestCommonSubseq (a, b, s)Find the longest common subsequence of two sequences.
- - - - - - -
-
- - - -

Functions

-
- - - -
longestCommonSubseq (a, b, s)
-
-Find the longest common subsequence of two sequences. The sequence objects must have an __append metamethod. This is provided by string_ext for strings, and by list for lists. - - -

Parameters

-
    - -
  • - a: first sequence -
  • - -
  • - b: second sequence -
  • - -
  • - s: an empty sequence of the same type, to hold the result -
  • - -
- - - - - - -

Return value:

-the LCS of a and b - - - -
- - -
- - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/modules/list.html b/modules/list.html deleted file mode 100644 index 002336a..0000000 --- a/modules/list.html +++ /dev/null @@ -1,1212 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

Module list

- -

Tables as lists.

- - - - - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
append (l, x)Append an item to a list.
compare (l, m)Compare two lists element by element left-to-right
concat (...)Concatenate lists.
cons (l, x)Prepend an item to a list.
depair (ls)Turn a list of pairs into a table.
elems (l)An iterator over the elements of a list.
enpair (t)Turn a table into a list of pairs.
filter (p, l)Filter a list according to a predicate.
flatten (l)Flatten a list.
foldl (f, e, l)Fold a binary function through a list left associatively.
foldr (f, e, l)Fold a binary function through a list right associatively.
indexKey (f, l)Make an index of a list of tables on a given field
indexValue (f, l)Copy a list of tables, indexed on a given field
map (f, l)Map a function over a list.
mapWith (f, l, ls)Map a function over a list of lists.
new (l, t)List constructor.
project (f, l)Project a list of fields from a list of tables.
relems (l)An iterator over the elements of a list, in reverse.
rep (l, n)Repeat a list.
reverse (l)Reverse a list.
shape (s, l)Shape a list according to a list of dimensions.
slice (l, from, to)Return a slice of a list.
tail (l)Return a list with its first element removed.
transpose (ls)Transpose a list of lists.
zipWith (f, ls)Zip lists together with a function.
- - - - - - -
-
- - - -

Functions

-
- - - -
append (l, x)
-
-Append an item to a list. - - -

Parameters

-
    - -
  • - l: list -
  • - -
  • - x: item -
  • - -
- - - - - - -

Return value:

-{l[1], ..., l[#l], x} - - - -
- - - - -
compare (l, m)
-
-Compare two lists element by element left-to-right - - -

Parameters

-
    - -
  • - l: first list -
  • - -
  • - m: second list -
  • - -
- - - - - - -

Return value:

--1 if l is less than m, 0 if they are the same, and 1 if l is greater than m - - - -
- - - - -
concat (...)
-
-Concatenate lists. - - -

Parameters

-
    - -
  • - ...: lists -
  • - -
- - - - - - -

Return value:

-{l1[1], ..., l1[#l1], ..., ln[1], ..., ln[#ln]} - - - -
- - - - -
cons (l, x)
-
-Prepend an item to a list. - - -

Parameters

-
    - -
  • - l: list -
  • - -
  • - x: item -
  • - -
- - - - - - -

Return value:

-{x, unpack (l)} - - - -
- - - - -
depair (ls)
-
-Turn a list of pairs into a table.
FIXME: Find a better name. - - -

Parameters

-
    - -
  • - ls: list {{i1, v1}, ..., {in, vn}} -
  • - -
- - - - - - -

Return value:

-table {i1=v1, ..., in=vn} - - - -
- - - - -
elems (l)
-
-An iterator over the elements of a list. - - -

Parameters

-
    - -
  • - l: list to iterate over -
  • - -
- - - - - - -

Return values:

-
    - -
  1. iterator function which returns successive elements of the list - -
  2. the list l as above - -
  3. true - -
- - - -
- - - - -
enpair (t)
-
-Turn a table into a list of pairs.
FIXME: Find a better name. - - -

Parameters

-
    - -
  • - t: table {i1=v1, ..., in=vn} -
  • - -
- - - - - - -

Return value:

-list {{i1, v1}, ..., {in, vn}} - - - -
- - - - -
filter (p, l)
-
-Filter a list according to a predicate. - - -

Parameters

-
    - -
  • - p: predicate (function of one argument returning a boolean) -
  • - -
  • - l: list of lists -
  • - -
- - - - - - -

Return value:

-result list containing elements e of l for which p (e) is true - - - -
- - - - -
flatten (l)
-
-Flatten a list. - - -

Parameters

-
    - -
  • - l: list to flatten -
  • - -
- - - - - - -

Return value:

-flattened list - - - -
- - - - -
foldl (f, e, l)
-
-Fold a binary function through a list left associatively. - - -

Parameters

-
    - -
  • - f: function -
  • - -
  • - e: element to place in left-most position -
  • - -
  • - l: list -
  • - -
- - - - - - -

Return value:

-result - - - -
- - - - -
foldr (f, e, l)
-
-Fold a binary function through a list right associatively. - - -

Parameters

-
    - -
  • - f: function -
  • - -
  • - e: element to place in right-most position -
  • - -
  • - l: list -
  • - -
- - - - - - -

Return value:

-result - - - -
- - - - -
indexKey (f, l)
-
-Make an index of a list of tables on a given field - - -

Parameters

-
    - -
  • - f: field -
  • - -
  • - l: list of tables {t1, ..., tn} -
  • - -
- - - - - - -

Return value:

-index {t1[f]=1, ..., tn[f]=n} - - - -
- - - - -
indexValue (f, l)
-
-Copy a list of tables, indexed on a given field - - -

Parameters

-
    - -
  • - f: field whose value should be used as index -
  • - -
  • - l: list of tables {i1=t1, ..., in=tn} -
  • - -
- - - - - - -

Return value:

-index {t1[f]=t1, ..., tn[f]=tn} - - - -
- - - - -
map (f, l)
-
-Map a function over a list. - - -

Parameters

-
    - -
  • - f: function -
  • - -
  • - l: list -
  • - -
- - - - - - -

Return value:

-result list {f (l[1]), ..., f (l[#l])} - - - -
- - - - -
mapWith (f, l, ls)
-
-Map a function over a list of lists. - - -

Parameters

-
    - -
  • - f: function -
  • - -
  • - l: -
  • - -
  • - ls: list of lists -
  • - -
- - - - - - -

Return value:

-result list {f (unpack (ls[1]))), ..., f (unpack (ls[#ls]))} - - - -
- - - - -
new (l, t)
-
-List constructor. Needed in order to use metamethods. - - -

Parameters

-
    - -
  • - l: -
  • - -
  • - t: list (as a table) -
  • - -
- - - - - - -

Return value:

-list (with list metamethods) - - - -
- - - - -
project (f, l)
-
-Project a list of fields from a list of tables. - - -

Parameters

-
    - -
  • - f: field to project -
  • - -
  • - l: list of tables -
  • - -
- - - - - - -

Return value:

-list of f fields - - - -
- - - - -
relems (l)
-
-An iterator over the elements of a list, in reverse. - - -

Parameters

-
    - -
  • - l: list to iterate over -
  • - -
- - - - - - -

Return values:

-
    - -
  1. iterator function which returns precessive elements of the list - -
  2. the list l as above - -
  3. true - -
- - - -
- - - - -
rep (l, n)
-
-Repeat a list. - - -

Parameters

-
    - -
  • - l: list -
  • - -
  • - n: number of times to repeat -
  • - -
- - - - - - -

Return value:

-n copies of l appended together - - - -
- - - - -
reverse (l)
-
-Reverse a list. - - -

Parameters

-
    - -
  • - l: list -
  • - -
- - - - - - -

Return value:

-list {l[#l], ..., l[1]} - - - -
- - - - -
shape (s, l)
-
-Shape a list according to a list of dimensions. Dimensions are given outermost first and items from the original list are distributed breadth first; there may be one 0 indicating an indefinite number. Hence, {0} is a flat list, {1} is a singleton, {2, 0} is a list of two lists, and {0, 2} is a list of pairs.
Algorithm: turn shape into all positive numbers, calculating the zero if necessary and making sure there is at most one; recursively walk the shape, adding empty tables until the bottom level is reached at which point add table items instead, using a counter to walk the flattened original list.
- - -

Parameters

-
    - -
  • - s: {d1, ..., dn} -
  • - -
  • - l: list to reshape -
  • - -
- - - - - - -

Return value:

-reshaped list FIXME: Use ileaves instead of flatten (needs a while instead of a for in fill function) - - - -
- - - - -
slice (l, from, to)
-
-Return a slice of a list. (Negative list indices count from the end of the list.) - - -

Parameters

-
    - -
  • - l: list -
  • - -
  • - from: start of slice (default: 1) -
  • - -
  • - to: end of slice (default: #l) -
  • - -
- - - - - - -

Return value:

-{l[from], ..., l[to]} - - - -
- - - - -
tail (l)
-
-Return a list with its first element removed. - - -

Parameters

-
    - -
  • - l: list -
  • - -
- - - - - - -

Return value:

-{l[2], ..., l[#l]} - - - -
- - - - -
transpose (ls)
-
-Transpose a list of lists. This function in Lua is equivalent to zip and unzip in more strongly typed languages. - - -

Parameters

-
    - -
  • - ls: {{l1,1, ..., l1,c}, ..., {lr,1, ..., lr,c}} -
  • - -
- - - - - - -

Return value:

-{{l1,1, ..., lr,1}, ..., {l1,c, ..., lr,c}} - - - -
- - - - -
zipWith (f, ls)
-
-Zip lists together with a function. - - -

Parameters

-
    - -
  • - f: function -
  • - -
  • - ls: list of lists -
  • - -
- - - - - - -

Return value:

-{f (ls[1][1], ..., ls[#ls][1]), ..., f (ls[1][N], ..., ls[#ls][N]) where N = max {map (function (l) return #l end, ls)} - - - -
- - -
- - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/modules/math.html b/modules/math.html deleted file mode 100644 index 019911f..0000000 --- a/modules/math.html +++ /dev/null @@ -1,282 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

Module math

- -

Additions to the math module.

- - - - - -

Functions

- - - - - - - - - - - - -
floor (n, p)Extend math.floor to take the number of decimal places.
round (n, p)Round a number to a given number of decimal places
- - - - - - -
-
- - - -

Functions

-
- - - -
floor (n, p)
-
-Extend math.floor to take the number of decimal places. - - -

Parameters

-
    - -
  • - n: number -
  • - -
  • - p: number of decimal places to truncate to (default: 0) -
  • - -
- - - - - - -

Return value:

-n truncated to p decimal places - - - -
- - - - -
round (n, p)
-
-Round a number to a given number of decimal places - - -

Parameters

-
    - -
  • - n: number -
  • - -
  • - p: number of decimal places to round to (default: 0) -
  • - -
- - - - - - -

Return value:

-n rounded to p decimal places - - - -
- - -
- - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/modules/mbox.html b/modules/mbox.html deleted file mode 100644 index 4e5d5ed..0000000 --- a/modules/mbox.html +++ /dev/null @@ -1,300 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

Module mbox

- -

mbox parser. Based on code by Diego Nahab.

- - - - - -

Functions

- - - - - - - -
parse (s)Parse a mailbox into messages.
- - - - - - -
-
- - - -

Functions

-
- - - -
parse (s)
-
-Parse a mailbox into messages. - - -

Parameters

-
    - -
  • - s: mailbox as a string -
  • - -
- - - - - - -

Return value:

-list of messages, each of form {header = {...}, body = "..."} - - - -
- - -
- - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/modules/object.html b/modules/object.html deleted file mode 100644 index 6522980..0000000 --- a/modules/object.html +++ /dev/null @@ -1,292 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

Module object

- -

Prototype-based objects

  • Create an object/class:
    • Either, if the _init field is a list:
      • object/Class = prototype {value, ...; field = value, ...}
      • Named values are assigned to the corresponding fields, and unnamed values to the fields given by _init.
    • Or, if the _init field is a function:
      • object/Class = prototype (value, ...)
      • The given values are passed as arguments to the _init function.
    • An object's metatable is itself.
    • Private fields and methods start with "_".
  • Access an object field: object.field
  • Call an object method: object:method (...)
  • Call a class method: Class.method (object, ...)
  • Add a field: object.field = x
  • Add a method: function object:method (...) ... end
  • - - - - - - - - -

    Tables

    - - - - - - - -
    ObjectRoot object
    - - - -
    -
    - - - - - - -

    Tables

    -
    - -
    Object
    -
    Root object - - -Fields -
      - -
    • - _init: constructor method or list of fields to be initialised by the constructor -
    • - -
    • - _clone: object constructor which provides the behaviour for _init documented above -
    • - -
    - - -
    - - -
    - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/modules/package.html b/modules/package.html deleted file mode 100644 index ce97e71..0000000 --- a/modules/package.html +++ /dev/null @@ -1,256 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

Module package

- -

- - - - - - - - -

Tables

- - - - - - - -
packageMake named constants for package.config (undocumented in 5.1; see luaconf.h for C equivalents).
- - - -
-
- - - - - - -

Tables

-
- -
package
-
Make named constants for package.config (undocumented in 5.1; see luaconf.h for C equivalents). - - -Fields -
    - -
  • - dirsep: directory separator -
  • - -
  • - pathsep: path separator -
  • - -
  • - path_mark: string that marks substitution points in a path template -
  • - -
  • - execdir: (Windows only) replaced by the executable's directory in a path -
  • - -
  • - igmark: Mark to ignore all before it when building luaopen_ function name. -
  • - -
- - -
- - -
- - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/modules/parser.html b/modules/parser.html deleted file mode 100644 index 9c6c08e..0000000 --- a/modules/parser.html +++ /dev/null @@ -1,342 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

Module parser

- -

Parser generator.

A parser is created by

p = Parser {grammar}

and called with

result = p:parse (start_token, token_list[, from])

where start_token is the non-terminal at which to start parsing in the grammar, token_list is a list of tokens of the form

{ty = "token_type", tok = "token_text"}

and from is the token in the list from which to start (the default value is 1).

The output of the parser is a tree, each of whose nodes is of the form:

{ty = symbol, node1 = tree1, node2 = tree2, ... [, list]}

where each nodei is a symbolic name, and list is the list of trees returned if the corresponding token was a list token.

A grammar is a table of rules of the form

non-terminal = {production1, production2, ...}

plus a special item

lexemes = Set {"class1", "class2", ...}

Each production gives a form that a non-terminal may take. A production has the form

production = {"token1", "token2", ..., [action][,abstract]}

A production

  • must not start with the non-terminal being defined (it must not be left-recursive)
  • must not be a prefix of a later production in the same non-terminal

Each token may be

  • a non-terminal, i.e. a token defined by the grammar
    • an optional symbol is indicated by the suffix _opt
    • a list is indicated by the suffix _list, and may be followed by _≤separator-symbol> (default is no separator)
  • a lexeme class
  • a string to match literally

The parse tree for a literal string or lexeme class is the string that was matched. The parse tree for a non-terminal is a table of the form

{ty = "non_terminal_name", tree1, tree2, ...}

where the treei are the parse trees for the corresponding terminals and non-terminals.

An action is of the form

action = function (tree, token, pos) ... return tree_ end

It is passed the parse tree for the current node, the token list, and the current position in the token list, and returns a new parse tree.

An abstract syntax rule is of the form

name = {i1, i2, ...}

where i1, i2, ... are numbers. This results in a parse tree of the form

{ty = "name"; treei1, treei2, ...}

If a production has no abstract syntax rule, the result is the parse node for the current node.

FIXME: Give lexemes as an extra argument to Parser?
FIXME: Rename second argument to parse method to "tokens"?
FIXME: Make start_token an optional argument to parse? (swap with token list) and have it default to the first non-terminal?

- - - - - -

Functions

- - - - - - - - - - - - -
Parser:_init (grammar)Parser constructor
Parser:parse (start, token, from)Parse a token list.
- - - - - - -
-
- - - -

Functions

-
- - - -
Parser:_init (grammar)
-
-Parser constructor - - -

Parameters

-
    - -
  • - grammar: parser grammar -
  • - -
- - - - - - -

Return value:

-parser - - - -
- - - - -
Parser:parse (start, token, from)
-
-Parse a token list. - - -

Parameters

-
    - -
  • - start: the token at which to start -
  • - -
  • - token: the list of tokens -
  • - -
  • - from: the index of the token to start from (default: 1) -
  • - -
- - - - - - -

Return value:

-parse tree - - - -
- - -
- - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/modules/set.html b/modules/set.html deleted file mode 100644 index 90cd4e8..0000000 --- a/modules/set.html +++ /dev/null @@ -1,640 +0,0 @@ - - - - Reference - - - - - -
- -
- -
-
-
- -
- - - -
- -

Module set

- -

- - - - - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
delete (s, e)Delete an element from a set
difference (s, t)Find the difference of two sets
equal (s, t)Find whether two sets are equal
insert (s, e)Insert an element into a set
intersection (s, t)Find the intersection of two sets
member (s, e)Say whether an element is in a set
propersubset (s, t)Find whether one set is a proper subset of another
subset (s, t)Find whether one set is a subset of another
symmetric_difference (s, t)Find the symmetric difference of two sets
union (s, t)Find the union of two sets
- - - - - - -
-
- - - -

Functions

-
- - - -
delete (s, e)
-
-Delete an element from a set - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - e: element -
  • - -
- - - - - - - - -
- - - - -
difference (s, t)
-
-Find the difference of two sets - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - t: set -
  • - -
- - - - - - -

Return value:

-s with elements of t removed - - - -
- - - - -
equal (s, t)
-
-Find whether two sets are equal - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - t: set -
  • - -
- - - - - - -

Return value:

-true if sets are equal, false otherwise - - - -
- - - - -
insert (s, e)
-
-Insert an element into a set - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - e: element -
  • - -
- - - - - - - - -
- - - - -
intersection (s, t)
-
-Find the intersection of two sets - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - t: set -
  • - -
- - - - - - -

Return value:

-set intersection of s and t - - - -
- - - - -
member (s, e)
-
-Say whether an element is in a set - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - e: element -
  • - -
- - - - - - -

Return value:

-true if e is in set, false otherwise - - - -
- - - - -
propersubset (s, t)
-
-Find whether one set is a proper subset of another - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - t: set -
  • - -
- - - - - - -

Return value:

-true if s is a proper subset of t, false otherwise - - - -
- - - - -
subset (s, t)
-
-Find whether one set is a subset of another - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - t: set -
  • - -
- - - - - - -

Return value:

-true if s is a subset of t, false otherwise - - - -
- - - - -
symmetric_difference (s, t)
-
-Find the symmetric difference of two sets - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - t: set -
  • - -
- - - - - - -

Return value:

-elements of s and t that are in s or t but not both - - - -
- - - - -
union (s, t)
-
-Find the union of two sets - - -

Parameters

-
    - -
  • - s: set -
  • - -
  • - t: set -
  • - -
- - - - - - -

Return value:

-set union of s and t - - - -
- - -
- - - - - - -
- -
- -
-

Valid XHTML 1.0!

-
- -
- - diff --git a/modules/std.debug.html b/modules/std.debug.html new file mode 100644 index 0000000..6b08ac9 --- /dev/null +++ b/modules/std.debug.html @@ -0,0 +1,204 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module std.debug

+ +

Additions to the debug module

+

+ +

+ + +

Functions

+ + + + + + + + + + + + + +
debug ()The global function debug is an abbreviation for debug.say (1, ...)
say (n, ...)Print a debugging message.
trace (event)Trace function calls.
+

Tables

+ + + + + +
_DEBUGTo activate debugging set _DEBUG either to any true value + (equivalent to {level = 1}), or as documented below.
+ +
+
+ + +

Functions

+
+
+ + debug () +
+
+ The global function debug is an abbreviation for debug.say (1, ...) + + + + +

See also:

+ + + +
+
+ + say (n, ...) +
+
+ Print a debugging message. + +

Parameters:

+
    +
  • n + debugging level, defaults to 1 +
  • +
  • ... + objects to print (as for print) +
  • +
+ + + + + +
+
+ + trace (event) +
+
+ Trace function calls. + Use as debug.sethook (trace, "cr"), which is done automatically + when _DEBUG.call is set. + Based on test/trace-calls.lua from the Lua distribution. + +

Parameters:

+
    +
  • event + event causing the call +
  • +
+ + + + + +
+
+

Tables

+
+
+ + _DEBUG +
+
+ To activate debugging set _DEBUG either to any true value + (equivalent to {level = 1}), or as documented below. + +

Fields:

+
    +
  • level + debugging level +
  • +
  • call + do call trace debugging +
  • +
  • std + do standard library debugging (run examples & test code) +
  • +
+ + + + + +
+
+ + +
+
+
+generated by LDoc 1.4.0 +
+
+ + diff --git a/modules/std.functional.html b/modules/std.functional.html new file mode 100644 index 0000000..6113a67 --- /dev/null +++ b/modules/std.functional.html @@ -0,0 +1,489 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module std.functional

+ +

Functional programming.

+

+ +

+ + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bind (f, ...)Partially apply a function.
collect (i)Collect the results of an iterator.
compose ()Compose functions.
curry (f, n)Curry a function.
eval (s)Evaluate a string.
filter (p, i)Filter an iterator with a predicate.
fold (f, d, i)Fold a binary function into an iterator.
id (...)Identity function.
map (f, i)Map a function over an iterator.
memoize (fn)Memoize a function, by wrapping it in a functable.
metamethod (x, n)Return given metamethod, if any, or nil.
+

Tables

+ + + + + +
opFunctional forms of infix operators.
+ +
+
+ + +

Functions

+
+
+ + bind (f, ...) +
+
+ Partially apply a function. + +

Parameters:

+
    +
  • f + function to apply partially +
  • +
  • ... + arguments to bind +
  • +
+ +

Returns:

+
    + + function with ai already bound +
+ + + + +
+
+ + collect (i) +
+
+ Collect the results of an iterator. + +

Parameters:

+
    +
  • i + iterator +
  • +
+ +

Returns:

+
    + + results of running the iterator on its arguments +
+ + + + +
+
+ + compose () +
+
+ Compose functions. + + +

Returns:

+
    + + composition of f1 ... fn +
+ + + + +
+
+ + curry (f, n) +
+
+ Curry a function. + +

Parameters:

+
    +
  • f + function to curry +
  • +
  • n + number of arguments +
  • +
+ +

Returns:

+
    + + curried version of f +
+ + + + +
+
+ + eval (s) +
+
+ Evaluate a string. + +

Parameters:

+
    +
  • s + string +
  • +
+ +

Returns:

+
    + + value of string +
+ + + + +
+
+ + filter (p, i) +
+
+ Filter an iterator with a predicate. + +

Parameters:

+
    +
  • p + predicate +
  • +
  • i + iterator +
  • +
+ +

Returns:

+
    + + result table containing elements e for which p (e) +
+ + + + +
+
+ + fold (f, d, i) +
+
+ Fold a binary function into an iterator. + +

Parameters:

+
    +
  • f + function +
  • +
  • d + initial first argument +
  • +
  • i + iterator +
  • +
+ +

Returns:

+
    + + result +
+ + + + +
+
+ + id (...) +
+
+ Identity function. + +

Parameters:

+
    +
  • ... + + + +
  • +
+ +

Returns:

+
    + + the arguments passed to the function +
+ + + + +
+
+ + map (f, i) +
+
+ Map a function over an iterator. + +

Parameters:

+
    +
  • f + function +
  • +
  • i + iterator +
  • +
+ +

Returns:

+
    + + result table +
+ + + + +
+
+ + memoize (fn) +
+
+ Memoize a function, by wrapping it in a functable. + +

Parameters:

+
    +
  • fn + function that returns a single result +
  • +
+ +

Returns:

+
    + + memoized function +
+ + + + +
+
+ + metamethod (x, n) +
+
+ Return given metamethod, if any, or nil. + +

Parameters:

+
    +
  • x + object to get metamethod of +
  • +
  • n + name of metamethod to get +
  • +
+ +

Returns:

+
    + + metamethod function or nil if no metamethod or not a + function +
+ + + + +
+
+

Tables

+
+
+ + op +
+
+ Functional forms of infix operators. + Defined here so that other modules can write to it. + +

Fields:

+
    +
  • dereference + table index +
  • +
  • addition + + + +
  • +
  • subtraction + + + +
  • +
  • multiplication + + + +
  • +
  • division + + + +
  • +
  • and + logical and +
  • +
  • or + logical or +
  • +
  • not + logical not +
  • +
  • equality + + + +
  • +
  • inequality + + + +
  • +
+ + + + + +
+
+ + +
+
+
+generated by LDoc 1.4.0 +
+
+ + diff --git a/modules/std.getopt.html b/modules/std.getopt.html new file mode 100644 index 0000000..1def5d7 --- /dev/null +++ b/modules/std.getopt.html @@ -0,0 +1,244 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module std.getopt

+ +

Simplified getopt, based on Svenne Panne's Haskell GetOpt.

+

Usage:

+ +
 prog = {<
+   name = <progname>,
+   [usage = <usage line>,]
+   [options = {
+     {{<name>[, ...]}, <desc>, [<type> [, <var>]]},
+     ...
+   },]
+   [banner = <banner string>,]
+   [purpose = <purpose string>,]
+   [notes = <additional notes>]
+ }
+
+ +
    +
  • The type of option argument is one of Req(uired), + Opt(ional)
  • +
  • The varis a descriptive name for the option argument.
  • +
  • getopt.processargs (prog)
  • +
  • Options take a single dash, but may have a double dash.
  • +
  • Arguments may be given as -opt=arg or -opt arg.
  • +
  • If an option taking an argument is given multiple times, only the + last value is returned; missing arguments are returned as 1.
  • +
+ +

getOpt, usageinfo and usage can be called directly (see + below, and the example at the end). Set _DEBUG.std to a non-nil + value to run the example.

+ + +

Functions

+ + + + + + + + + + + + + + + + + +
getopt (argIn, options, stop_at_nonopt)Perform argument processing
processargs (prog, ...)Simple getopt wrapper.
usage (prog)Emit a usage message.
usageinfo (header, optDesc, pageWidth)Produce usage info for the given options.
+ +
+
+ + +

Functions

+
+
+ + getopt (argIn, options, stop_at_nonopt) +
+
+ Perform argument processing + +

Parameters:

+
    +
  • argIn + list of command-line args +
  • +
  • options + options table +
  • +
  • stop_at_nonopt + if true, stop option processing at first non-option +
  • +
+ +

Returns:

+
    +
  1. + table of remaining non-options
  2. +
  3. + table of option key-value list pairs
  4. +
  5. + table of error messages
  6. +
+ + + + +
+
+ + processargs (prog, ...) +
+
+ Simple getopt wrapper. + If the caller didn't supply their own already, -- adds --version/-V + and --help/-h options automatically; + stops program if there was an error, or if --help or --version was + used. + +

Parameters:

+
    +
  • prog + table of named parameters +
  • +
  • ... + extra arguments for getopt +
  • +
+ + + + + +
+
+ + usage (prog) +
+
+ Emit a usage message. + +

Parameters:

+
    +
  • prog + table of named parameters +
  • +
+ + + + + +
+
+ + usageinfo (header, optDesc, pageWidth) +
+
+ Produce usage info for the given options. + +

Parameters:

+
    +
  • header + header string +
  • +
  • optDesc + option descriptors +
  • +
  • pageWidth + width to format to [78] +
  • +
+ +

Returns:

+
    + + formatted string +
+ + + + +
+
+ + +
+
+
+generated by LDoc 1.4.0 +
+
+ + diff --git a/modules/std.html b/modules/std.html index 907beef..04eff5b 100644 --- a/modules/std.html +++ b/modules/std.html @@ -1,13 +1,13 @@ + Reference - - + - +
@@ -16,241 +16,680 @@
+
+ + + -
  • - base -
  • +
    -
  • - bin -
  • +

    Module std

    -
  • - debug -
  • +

    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.opFunctional forms of infix operators.
    stdModule table.
    -
  • - fstable -
  • +
    +
    -
  • - getopt -
  • -
  • - io -
  • +

    Functions

    +
    +
    + + _G.assert () +
    +
    + Extend to allow formatted arguments. -
  • - lcs -
  • -
  • - list -
  • -
  • - math -
  • -
  • - mbox -
  • +

    See also:

    + -
  • - object -
  • -
  • - package -
  • +
    +
    + + _G.bind () +
    +
    + Partially apply a function. -
  • - parser -
  • -
  • - set -
  • -
  • std
  • - -
  • - strbuf -
  • -
  • - string -
  • +

    See also:

    + -
  • - table -
  • -
  • - tree -
  • +
    +
    + + _G.collect () +
    +
    + Collect the results of an iterator. - - +

    See also:

    + -

    Files

    -
    +
    + + _G.compose () +
    +
    + Compose functions. -
  • - bin.lua -
  • -
  • - debug_ext.lua -
  • -
  • - debug_init.lua -
  • -
  • - fstable.lua -
  • +

    See also:

    + -
  • - getopt.lua -
  • -
  • - io_ext.lua -
  • +
    +
    + + _G.curry () +
    +
    + Curry a function. -
  • - lcs.lua -
  • -
  • - list.lua -
  • -
  • - math_ext.lua -
  • -
  • - mbox.lua -
  • +

    See also:

    + -
  • - modules.lua -
  • -
  • - object.lua -
  • +
    +
    + + _G.die () +
    +
    + Die with an error. -
  • - package_ext.lua -
  • -
  • - parser.lua -
  • -
  • - set.lua -
  • -
  • - std.lua -
  • +

    See also:

    + -
  • - strbuf.lua -
  • -
  • - strict.lua -
  • +
    +
    + + _G.eval () +
    +
    + Evaluate a string. -
  • - string_ext.lua -
  • -
  • - table_ext.lua -
  • -
  • - tree.lua -
  • -
  • - xml.lua -
  • +

    See also:

    + - +
    +
    + + _G.filter () +
    +
    + Filter an iterator with a predicate. +

    See also:

    + -
    -
    + +
    + + _G.fold () +
    +
    + Fold a binary function into an iterator. -

    Module std

    -

    Lua standard library

    • TODO: Write a style guide (indenting/wrapping, capitalisation, function and variable names); library functions should call error, not die; OO vs non-OO (a thorny problem).
    • TODO: Add tests for each function immediately after the function; this also helps to check module dependencies.
    • TODO: pre-compile.

    +

    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. + +

    Fields:

    +
      +
    • version + release version string +
    • +
    + + + + + +
    +
    + + +
    +
    -

    Valid XHTML 1.0!

    +generated by LDoc 1.4.0
    - - + diff --git a/modules/std.io.html b/modules/std.io.html new file mode 100644 index 0000000..209ddc5 --- /dev/null +++ b/modules/std.io.html @@ -0,0 +1,361 @@ + + + + + Reference + + + + +
    + +
    + +
    +
    +
    + + +
    + + + + + + +
    + +

    Module std.io

    + +

    Additions to the io module.

    +

    + +

    + + +

    Functions

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    catdir (...)Concatenate two or more directories into a path, removing the trailing slash.
    catfile (...)Concatenate one or more directories and a filename into a path.
    die (...)Die with error.
    process_files (f)Process files specified on the command-line.
    readlines (h)Read a file or file handle into a list of lines.
    shell (c)Perform a shell command and return its output.
    slurp (h)Slurp a file handle.
    splitdir (path)Split a directory path into components.
    warn (...)Give warning with the name of program and file (if any).
    writelines (h, ...)Write values adding a newline after each.
    + +
    +
    + + +

    Functions

    +
    +
    + + catdir (...) +
    +
    + Concatenate two or more directories into a path, removing the trailing slash. + +

    Parameters:

    +
      +
    • ... + path components +
    • +
    + +

    Returns:

    +
      + + path +
    + + + + +
    +
    + + catfile (...) +
    +
    + Concatenate one or more directories and a filename into a path. + +

    Parameters:

    +
      +
    • ... + path components +
    • +
    + +

    Returns:

    +
      + + path +
    + + + + +
    +
    + + die (...) +
    +
    + Die with error. + +

    Parameters:

    +
      +
    • ... + arguments for format +
    • +
    + + + + + +
    +
    + + process_files (f) +
    +
    + Process files specified on the command-line. + If no files given, process io.stdin; in list of files, + - means io.stdin. + +

    Parameters:

    +
      +
    • f + function to process files with, which is passed + (name, arg_no) +
    • +
    + + + + + +
    +
    + + readlines (h) +
    +
    + Read a file or file handle into a list of lines. + +

    Parameters:

    +
      +
    • h + file handle or name (default: io.input ()); + if h is a handle, the file is closed after reading +
    • +
    + +

    Returns:

    +
      + + list of lines +
    + + + + +
    +
    + + shell (c) +
    +
    + Perform a shell command and return its output. + +

    Parameters:

    +
      +
    • c + command +
    • +
    + +

    Returns:

    +
      + + output, or nil if error +
    + + + + +
    +
    + + slurp (h) +
    +
    + Slurp a file handle. + +

    Parameters:

    +
      +
    • h + file handle or name (default: io.input ()) +
    • +
    + +

    Returns:

    +
      + + contents of file or handle, or nil if error +
    + + + + +
    +
    + + splitdir (path) +
    +
    + Split a directory path into components. + Empty components are retained: the root directory becomes {"", ""}. + +

    Parameters:

    +
      +
    • path + path +
    • +
    + +

    Returns:

    +
      + + list of path components +
    + + + + +
    +
    + + warn (...) +
    +
    + Give warning with the name of program and file (if any). + +

    Parameters:

    +
      +
    • ... + arguments for format +
    • +
    + + + + + +
    +
    + + writelines (h, ...) +
    +
    + Write values adding a newline after each. + +

    Parameters:

    +
      +
    • h + file handle (default: io.output () +
    • +
    • ... + values to write (as for write) +
    • +
    + + + + + +
    +
    + + +
    +
    +
    +generated by LDoc 1.4.0 +
    +
    + + diff --git a/modules/std.math.html b/modules/std.math.html new file mode 100644 index 0000000..4c3b234 --- /dev/null +++ b/modules/std.math.html @@ -0,0 +1,155 @@ + + + + + Reference + + + + +
    + +
    + +
    +
    +
    + + +
    + + + + + + +
    + +

    Module std.math

    + +

    Additions to the math module.

    +

    + +

    + + +

    Functions

    + + + + + + + + + +
    floor (n, p)Extend math.floor to take the number of decimal places.
    round (n, p)Round a number to a given number of decimal places
    + +
    +
    + + +

    Functions

    +
    +
    + + floor (n, p) +
    +
    + Extend math.floor to take the number of decimal places. + +

    Parameters:

    +
      +
    • n + number +
    • +
    • p + number of decimal places to truncate to (default: 0) +
    • +
    + +

    Returns:

    +
      + + n truncated to p decimal places +
    + + + + +
    +
    + + round (n, p) +
    +
    + Round a number to a given number of decimal places + +

    Parameters:

    +
      +
    • n + number +
    • +
    • p + number of decimal places to round to (default: 0) +
    • +
    + +

    Returns:

    +
      + + n rounded to p decimal places +
    + + + + +
    +
    + + +
    +
    +
    +generated by LDoc 1.4.0 +
    +
    + + diff --git a/modules/std.package.html b/modules/std.package.html new file mode 100644 index 0000000..e88b54a --- /dev/null +++ b/modules/std.package.html @@ -0,0 +1,130 @@ + + + + + Reference + + + + +
    + +
    + +
    +
    +
    + + +
    + + + + + + +
    + +

    Module std.package

    + +

    Additions to the package module.

    +

    + +

    + + +

    Tables

    + + + + + +
    packageMake named constants for package.config + (undocumented in 5.1; see luaconf.h for C equivalents).
    + +
    +
    + + +

    Tables

    +
    +
    + + package +
    +
    + Make named constants for package.config + (undocumented in 5.1; see luaconf.h for C equivalents). + +

    Fields:

    +
      +
    • dirsep + directory separator +
    • +
    • pathsep + path separator +
    • +
    • path_mark + string that marks substitution points in a path template +
    • +
    • execdir + (Windows only) replaced by the executable's directory in a path +
    • +
    • igmark + Mark to ignore all before it when building luaopen_ function name. +
    • +
    + + + + + +
    +
    + + +
    +
    +
    +generated by LDoc 1.4.0 +
    +
    + + diff --git a/modules/std.strict.html b/modules/std.strict.html new file mode 100644 index 0000000..1ff2f51 --- /dev/null +++ b/modules/std.strict.html @@ -0,0 +1,128 @@ + + + + + Reference + + + + +
    + +
    + +
    +
    +
    + + +
    + + + + + + +
    + +

    Module std.strict

    + +

    Checks uses of undeclared global variables.

    +

    All global variables must be 'declared' through a regular + assignment (even assigning nil will do) in a top-level + chunk before being used anywhere or assigned to inside a function. + From Lua distribution (etc/strict.lua).

    + + +

    Metamethods

    + + + + + + + + + +
    __indexDetect derefrence of undeclared global.
    __newindexDetect assignment to undeclared global.
    + +
    +
    + + +

    Metamethods

    +
    +
    + + __index +
    +
    + Detect derefrence of undeclared global. + + + + + + +
    +
    + + __newindex +
    +
    + Detect assignment to undeclared global. + + + + + + +
    +
    + + +
    +
    +
    +generated by LDoc 1.4.0 +
    +
    + + diff --git a/modules/std.string.html b/modules/std.string.html new file mode 100644 index 0000000..2ca18f6 --- /dev/null +++ b/modules/std.string.html @@ -0,0 +1,935 @@ + + + + + Reference + + + + +
    + +
    + +
    +
    +
    + + +
    + + + + + + +
    + +

    Module std.string

    + +

    Additions to the string module.

    +

    + +

    + + +

    Functions

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    assert (v, f, ...)Extend to allow formatted arguments.
    caps (s)Capitalise each word in a string.
    chomp (s)Remove any final newline from a string.
    escape_pattern (s)Escape a string to be used as a pattern.
    finds (s, p, init, plain)Do multiple finds on a string.
    format (f, arg1, ...)Extend to work better with one argument.
    ltrim (s, r)Remove leading matter from a string.
    numbertosi (n)Write a number using SI suffixes.
    ordinal_suffix (n)Return the English suffix for an ordinal.
    pad (s, w, p)Justify a string.
    pickle (x)Convert a value to a string.
    prettytostring (t, indent, spacing)Pretty-print a table.
    render (x, open, close, elem, pair, sep, roots)Turn tables into strings with recursion detection.
    render_CloseRenderer (t) + +
    render_ElementRenderer (e) + +
    render_OpenRenderer (t) + +
    render_PairRenderer (t, i, v, is, vs)NB.
    render_SeparatorRenderer (t, i, v, j, w) + +
    require_version (module, min, too_big, pattern)Require a module with a particular version.
    rtrim (s, r)Remove trailing matter from a string.
    split (s, sep)Split a string at a given separator.
    tfind (s, p, init, plain)Do find, returning captures as a list.
    tostring (x)Extend tostring to work better on tables.
    trim (s, r)Remove leading and trailing matter from a string.
    wrap (s, w, ind, ind1)Wrap a string into a paragraph.
    + +
    +
    + + +

    Functions

    +
    +
    + + assert (v, f, ...) +
    +
    + Extend to allow formatted arguments. + +

    Parameters:

    +
      +
    • v + value to assert +
    • +
    • f + format +
    • +
    • ... + arguments to format +
    • +
    + +

    Returns:

    +
      + + value +
    + + + + +
    +
    + + caps (s) +
    +
    + Capitalise each word in a string. + +

    Parameters:

    +
      +
    • s + string +
    • +
    + +

    Returns:

    +
      + + capitalised string +
    + + + + +
    +
    + + chomp (s) +
    +
    + Remove any final newline from a string. + +

    Parameters:

    +
      +
    • s + string to process +
    • +
    + +

    Returns:

    +
      + + processed string +
    + + + + +
    +
    + + escape_pattern (s) +
    +
    + Escape a string to be used as a pattern. + +

    Parameters:

    +
      +
    • s + string to process +
    • +
    + +

    Returns:

    +
      + + processed string +
    + + + + +
    +
    + + finds (s, p, init, plain) +
    +
    + Do multiple finds on a string. + +

    Parameters:

    +
      +
    • s + target string +
    • +
    • p + pattern +
    • +
    • init + start position (default: 1) +
    • +
    • plain + inhibit magic characters (default: nil) +
    • +
    + +

    Returns:

    +
      + + list of {from, to; capt = {captures}} +
    + + + + +
    +
    + + format (f, arg1, ...) +
    +
    + Extend to work better with one argument. + If only one argument is passed, no formatting is attempted. + +

    Parameters:

    +
      +
    • f + format +
    • +
    • arg1 + first argument to format +
    • +
    • ... + arguments to format +
    • +
    + +

    Returns:

    +
      + + formatted string +
    + + + + +
    +
    + + ltrim (s, r) +
    +
    + Remove leading matter from a string. + +

    Parameters:

    +
      +
    • s + string +
    • +
    • r + leading pattern (default: "%s+") +
    • +
    + +

    Returns:

    +
      + + string without leading r +
    + + + + +
    +
    + + numbertosi (n) +
    +
    + Write a number using SI suffixes. + The number is always written to 3 s.f. + +

    Parameters:

    +
      +
    • n + number +
    • +
    + +

    Returns:

    +
      + + string +
    + + + + +
    +
    + + ordinal_suffix (n) +
    +
    + Return the English suffix for an ordinal. + +

    Parameters:

    +
      +
    • n + number of the day +
    • +
    + +

    Returns:

    +
      + + suffix +
    + + + + +
    +
    + + pad (s, w, p) +
    +
    + Justify a string. + When the string is longer than w, it is truncated (left or right + according to the sign of w). + +

    Parameters:

    +
      +
    • s + string to justify +
    • +
    • w + width to justify to (-ve means right-justify; +ve means + left-justify) +
    • +
    • p + string to pad with (default: " ") +
    • +
    + +

    Returns:

    +
      + + justified string +
    + + + + +
    +
    + + pickle (x) +
    +
    + Convert a value to a string. + The string can be passed to dostring to retrieve the value. + +

    Parameters:

    +
      +
    • x + object to pickle +
    • +
    + +

    Returns:

    +
      + + string such that eval (s) is the same value as x +
    + + + + +
    +
    + + prettytostring (t, indent, spacing) +
    +
    + Pretty-print a table. + +

    Parameters:

    +
      +
    • t + table to print +
    • +
    • indent + indent between levels ["\t"] +
    • +
    • spacing + space before every line +
    • +
    + +

    Returns:

    +
      + + pretty-printed string +
    + + + + +
    +
    + + render (x, open, close, elem, pair, sep, roots) +
    +
    + Turn tables into strings with recursion detection. + N.B. Functions calling render should not recurse, or recursion + detection will not work. + +

    Parameters:

    +
      +
    • x + object to convert to string +
    • +
    • open + open table renderer +
    • +
    • close + close table renderer +
    • +
    • elem + element renderer +
    • +
    • pair + pair renderer +
    • +
    • sep + separator renderer +
    • +
    • roots + accumulates table references to detect recursion +
    • +
    + +

    Returns:

    +
      +
    1. + string representation
    2. +
    3. + open table string
    4. +
    + + +

    See also:

    + + + +
    +
    + + render_CloseRenderer (t) +
    +
    + + +

    Parameters:

    +
      +
    • t + table +
    • +
    + +

    Returns:

    +
      +
    1. + close table string
    2. +
    3. + element string
    4. +
    + + + + +
    +
    + + render_ElementRenderer (e) +
    +
    + + +

    Parameters:

    +
      +
    • e + element +
    • +
    + +

    Returns:

    +
      + + element string +
    + + + + +
    +
    + + render_OpenRenderer (t) +
    +
    + + +

    Parameters:

    +
      +
    • t + table +
    • +
    + +

    Returns:

    +
      +
    1. + open table string
    2. +
    3. + close table string
    4. +
    + + + + +
    +
    + + render_PairRenderer (t, i, v, is, vs) +
    +
    + NB. the function should not try to render i and v, or treat them recursively. + +

    Parameters:

    +
      +
    • t + table +
    • +
    • i + index +
    • +
    • v + value +
    • +
    • is + index string +
    • +
    • vs + value string +
    • +
    + +

    Returns:

    +
      +
    1. + element string
    2. +
    3. + separator string
    4. +
    + + + + +
    +
    + + render_SeparatorRenderer (t, i, v, j, w) +
    +
    + + +

    Parameters:

    +
      +
    • t + table +
    • +
    • i + preceding index (nil on first call) +
    • +
    • v + preceding value (nil on first call) +
    • +
    • j + following index (nil on last call) +
    • +
    • w + following value (nil on last call) +
    • +
    + +

    Returns:

    +
      + + separator string +
    + + + + +
    +
    + + require_version (module, min, too_big, pattern) +
    +
    + Require a module with a particular version. + +

    Parameters:

    +
      +
    • module + module to require +
    • +
    • min + lowest acceptable version (default: any) +
    • +
    • too_big + lowest version that is too big (default: none) +
    • +
    • pattern + to match version in module.version or + module.VERSION (default: ".*[%.%d]+" +
    • +
    + + + + + +
    +
    + + rtrim (s, r) +
    +
    + Remove trailing matter from a string. + +

    Parameters:

    +
      +
    • s + string +
    • +
    • r + trailing pattern (default: "%s+") +
    • +
    + +

    Returns:

    +
      + + string without trailing r +
    + + + + +
    +
    + + split (s, sep) +
    +
    + Split a string at a given separator. + +

    Parameters:

    +
      +
    • s + string to split +
    • +
    • sep + separator pattern +
    • +
    + +

    Returns:

    +
      + + list of strings +
    + + + + +
    +
    + + tfind (s, p, init, plain) +
    +
    + Do find, returning captures as a list. + +

    Parameters:

    +
      +
    • s + target string +
    • +
    • p + pattern +
    • +
    • init + start position (default: 1) +
    • +
    • plain + inhibit magic characters (default: nil) +
    • +
    + +

    Returns:

    +
      + + start of match, end of match, table of captures +
    + + + + +
    +
    + + tostring (x) +
    +
    + Extend tostring to work better on tables. + +

    Parameters:

    +
      +
    • x + object to convert to string +
    • +
    + +

    Returns:

    +
      + + string representation +
    + + + + +
    +
    + + trim (s, r) +
    +
    + Remove leading and trailing matter from a string. + +

    Parameters:

    +
      +
    • s + string +
    • +
    • r + leading/trailing pattern (default: "%s+") +
    • +
    + +

    Returns:

    +
      + + string without leading/trailing r +
    + + + + +
    +
    + + wrap (s, w, ind, ind1) +
    +
    + Wrap a string into a paragraph. + +

    Parameters:

    +
      +
    • s + string to wrap +
    • +
    • w + width to wrap to (default: 78) +
    • +
    • ind + indent (default: 0) +
    • +
    • ind1 + indent of first line (default: ind) +
    • +
    + +

    Returns:

    +
      + + wrapped paragraph +
    + + + + +
    +
    + + +
    +
    +
    +generated by LDoc 1.4.0 +
    +
    + + diff --git a/modules/std.table.html b/modules/std.table.html new file mode 100644 index 0000000..8ba681f --- /dev/null +++ b/modules/std.table.html @@ -0,0 +1,505 @@ + + + + + Reference + + + + +
    + +
    + +
    +
    +
    + + +
    + + + + + + +
    + +

    Module std.table

    + +

    Extensions to the table module.

    +

    + +

    + + +

    Functions

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    clone (t, nometa)Make a shallow copy of a table, including any metatable.
    clone_rename (t, map)Clone a table, renaming some keys.
    empty (t)Return whether table is empty.
    invert (t)Invert a table.
    keys (t)Make the list of keys in table.
    merge (t, u)Destructively merge another table's fields into table.
    new (x, t)Make a table with a default value for unset keys.
    pack (...)Turn a tuple into a list.
    ripairs (t)An iterator like ipairs, but in reverse.
    size (t)Find the number of elements in a table.
    sort (t, c)Make table.sort return its result.
    totable (x)Turn an object into a table according to __totable metamethod.
    values (t)Make the list of values of a table.
    + +
    +
    + + +

    Functions

    +
    +
    + + clone (t, nometa) +
    +
    + Make a shallow copy of a table, including any metatable.

    + +

    To make deep copies, use std.tree.clone. + +

    Parameters:

    +
      +
    • t + table + +
        source table
      +
      + +
    • +
    • nometa + boolean + if non-nil don't copy metatable +
    • +
    + +

    Returns:

    +
      + + copy of table +
    + + + + +
    +
    + + clone_rename (t, map) +
    +
    + Clone a table, renaming some keys. + +

    Parameters:

    +
      +
    • t + table + source table +
    • +
    • map + table + table {oldkey=newkey, ...} +
    • +
    + +

    Returns:

    +
      + + copy of table +
    + + + + +
    +
    + + empty (t) +
    +
    + Return whether table is empty. + +

    Parameters:

    +
      +
    • t + table + any table +
    • +
    + +

    Returns:

    +
      + + true if t is empty, otherwise false +
    + + + + +
    +
    + + invert (t) +
    +
    + Invert a table. + +

    Parameters:

    +
      +
    • t + table + a table with {k=v, ...} +
    • +
    + +

    Returns:

    +
      + + table + inverted table {v=k, ...} +
    + + + + +
    +
    + + keys (t) +
    +
    + Make the list of keys in table. + +

    Parameters:

    +
      +
    • t + table + any table +
    • +
    + +

    Returns:

    +
      + + table + list of keys +
    + + + + +
    +
    + + merge (t, u) +
    +
    + Destructively merge another table's fields into table. + +

    Parameters:

    +
      +
    • t + table + destination table +
    • +
    • u + table + table with fields to merge +
    • +
    + +

    Returns:

    +
      + + table t with fields from u merged in +
    + + + + +
    +
    + + new (x, t) +
    +
    + Make a table with a default value for unset keys. + +

    Parameters:

    +
      +
    • x + default entry value (default: nil) +
    • +
    • t + table + initial table (default: {}) +
    • +
    + +

    Returns:

    +
      + + table + table whose unset elements are x +
    + + + + +
    +
    + + pack (...) +
    +
    + Turn a tuple into a list. + +

    Parameters:

    +
      +
    • ... + tuple +
    • +
    + +

    Returns:

    +
      + + list +
    + + + + +
    +
    + + ripairs (t) +
    +
    + An iterator like ipairs, but in reverse. + +

    Parameters:

    +
      +
    • t + table + any table +
    • +
    + +

    Returns:

    +
      +
    1. + function + iterator function
    2. +
    3. + table + the table, t
    4. +
    5. + number + #t + 1
    6. +
    + + + + +
    +
    + + size (t) +
    +
    + Find the number of elements in a table. + +

    Parameters:

    +
      +
    • t + table + any table +
    • +
    + +

    Returns:

    +
      + + number of non-nil values in t +
    + + + + +
    +
    + + sort (t, c) +
    +
    + Make table.sort return its result. + +

    Parameters:

    +
      +
    • t + table + unsorted table +
    • +
    • c + function + comparator function +
    • +
    + +

    Returns:

    +
      + + t with keys sorted accordind to c +
    + + + + +
    +
    + + totable (x) +
    +
    + Turn an object into a table according to __totable metamethod. + +

    Parameters:

    +
      +
    • x + std.object + object to turn into a table +
    • +
    + +

    Returns:

    +
      + + table + resulting table or nil +
    + + + + +
    +
    + + values (t) +
    +
    + Make the list of values of a table. + +

    Parameters:

    +
      +
    • t + table + any table +
    • +
    + +

    Returns:

    +
      + + table + list of values +
    + + + + +
    +
    + + +
    +
    +
    +generated by LDoc 1.4.0 +
    +
    + + diff --git a/modules/std.tree.html b/modules/std.tree.html new file mode 100644 index 0000000..eca5a3e --- /dev/null +++ b/modules/std.tree.html @@ -0,0 +1,390 @@ + + + + + Reference + + + + +
    + +
    + +
    +
    +
    + + +
    + + + + + + +
    + +

    Module std.tree

    + +

    Tables as trees.

    +

    + +

    + + +

    Functions

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    clone (t, nometa)Make a deep copy of a tree, including any metatables.
    ileaves (tr)Tree iterator which returns just numbered leaves, in order.
    inodes (tr)Tree iterator over numbered nodes, in order.
    leaves (tr)Tree iterator which returns just leaves.
    merge (t, u)Destructively deep-merge one tree into another.
    new (t)Make a table into a tree.
    nodes (tr)Tree iterator over all nodes.
    +

    Metamethods

    + + + + + + + + + +
    __indexTree __index metamethod.
    __newindexTree __newindex metamethod.
    + +
    +
    + + +

    Functions

    +
    +
    + + clone (t, nometa) +
    +
    + Make a deep copy of a tree, including any metatables.

    + +

    To make fast shallow copies, use std.table.clone. + +

    Parameters:

    +
      +
    • t + table + +
        table to be cloned
      +
      + +
    • +
    • nometa + boolean + if non-nil don't copy metatables +
    • +
    + +

    Returns:

    +
      + + table + a deep copy of t +
    + + + + +
    +
    + + ileaves (tr) +
    +
    + Tree iterator which returns just numbered leaves, in order. + +

    Parameters:

    +
      +
    • tr + std.tree + tree table +
    • +
    + +

    Returns:

    +
      +
    1. + function + iterator function
    2. +
    3. + std.tree + the tree tr
    4. +
    + + + + +
    +
    + + inodes (tr) +
    +
    + Tree iterator over numbered nodes, in order. + +

    Parameters:

    +
      +
    • tr + std.tree + tree to iterate over +
    • +
    + +

    Returns:

    +
      +
    1. + function + iterator function
    2. +
    3. + std.tree + the tree, t
    4. +
    + + + + +
    +
    + + leaves (tr) +
    +
    + Tree iterator which returns just leaves. + +

    Parameters:

    +
      +
    • tr + std.tree + tree table +
    • +
    + +

    Returns:

    +
      +
    1. + function + iterator function
    2. +
    3. + std.tree + the tree, tr
    4. +
    + + + + +
    +
    + + merge (t, u) +
    +
    + Destructively deep-merge one tree into another. + +

    Parameters:

    +
      +
    • t + std.tree + destination tree +
    • +
    • u + std.tree + tree with nodes to merge +
    • +
    + +

    Returns:

    +
      + + std.tree + t with nodes from u merged in +
    + + +

    See also:

    + + + +
    +
    + + new (t) +
    +
    + Make a table into a tree. + +

    Parameters:

    +
      +
    • t + table + any table +
    • +
    + +

    Returns:

    +
      + + std.tree + a new tree table +
    + + + + +
    +
    + + nodes (tr) +
    +
    + Tree iterator over all nodes. + +

    Parameters:

    +
      +
    • tr + std.tree + tree to iterate over +
    • +
    + +

    Returns:

    +
      +
    1. + function + iterator function
    2. +
    3. + std.tree + the tree, tr
    4. +
    + + + + +
    +
    +

    Metamethods

    +
    +
    + + __index +
    +
    + Tree __index metamethod. + +

    params:

    +
      +
    • i + non-table, or list of keys {i_1 ... i_n} +
    • +
    + + + + + +
    +
    + + __newindex +
    +
    + Tree __newindex metamethod.

    + +

    Sets tr[i_1]...[i_n] = v if i is a table, or tr[i] = v otherwise + +

    params:

    +
      +
    • i + non-table, or list of keys {i_1 ... i_n} +
    • +
    • v + value +
    • +
    + + + + + +
    +
    + + +
    +
    +
    +generated by LDoc 1.4.0 +
    +
    + + diff --git a/modules/strbuf.html b/modules/strbuf.html deleted file mode 100644 index e6b6aca..0000000 --- a/modules/strbuf.html +++ /dev/null @@ -1,338 +0,0 @@ - - - - Reference - - - - - -
    - -
    - -
    -
    -
    - -
    - - - -
    - -

    Module strbuf

    - -

    String buffers

    - - - - - -

    Functions

    - - - - - - - - - - - - -
    concat (b, s)Add a string to a buffer
    tostring (b)Convert a buffer to a string
    - - - - - - -
    -
    - - - -

    Functions

    -
    - - - -
    concat (b, s)
    -
    -Add a string to a buffer - - -

    Parameters

    -
      - -
    • - b: buffer -
    • - -
    • - s: string to add -
    • - -
    - - - - - - -

    Return value:

    -buffer - - - -
    - - - - -
    tostring (b)
    -
    -Convert a buffer to a string - - -

    Parameters

    -
      - -
    • - b: buffer -
    • - -
    - - - - - - -

    Return value:

    -string - - - -
    - - -
    - - - - - - -
    - -
    - -
    -

    Valid XHTML 1.0!

    -
    - -
    - - diff --git a/modules/string.html b/modules/string.html deleted file mode 100644 index 12ebe16..0000000 --- a/modules/string.html +++ /dev/null @@ -1,717 +0,0 @@ - - - - Reference - - - - - -
    - -
    - -
    -
    -
    - -
    - - - -
    - -

    Module string

    - -

    Additions to the string module TODO: Pretty printing (use in getopt); see source for details.

    - - - - - -

    Functions

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    caps (s)Capitalise each word in a string.
    chomp (s)Remove any final newline from a string.
    escapePattern (s)Escape a string to be used as a pattern
    finds (s, p, init, plain)Do multiple finds on a string.
    ltrim (s, r)Remove leading matter from a string.
    numbertosi (n)Write a number using SI suffixes.
    ordinalSuffix (n)Return the English suffix for an ordinal.
    pad (s, w, p)Justify a string.
    rtrim (s, r)Remove trailing matter from a string.
    split (s, sep)Split a string at a given separator.
    tfind (s, p, init, plain)Do find, returning captures as a list.
    trim (s, r)Remove leading and trailing matter from a string.
    wrap (s, w, ind, ind1)Wrap a string into a paragraph.
    - - - - - - -
    -
    - - - -

    Functions

    -
    - - - -
    caps (s)
    -
    -Capitalise each word in a string. - - -

    Parameters

    -
      - -
    • - s: string -
    • - -
    - - - - - - -

    Return value:

    -capitalised string - - - -
    - - - - -
    chomp (s)
    -
    -Remove any final newline from a string. - - -

    Parameters

    -
      - -
    • - s: string to process -
    • - -
    - - - - - - -

    Return value:

    -processed string - - - -
    - - - - -
    escapePattern (s)
    -
    -Escape a string to be used as a pattern - - -

    Parameters

    -
      - -
    • - s: string to process @return -
    • - -
    - - - - - - - - -
    - - - - -
    finds (s, p, init, plain)
    -
    -Do multiple finds on a string. - - -

    Parameters

    -
      - -
    • - s: target string -
    • - -
    • - p: pattern -
    • - -
    • - init: start position (default: 1) -
    • - -
    • - plain: inhibit magic characters (default: nil) -
    • - -
    - - - - - - -

    Return value:

    -list of {from, to; capt = {captures}} - - - -
    - - - - -
    ltrim (s, r)
    -
    -Remove leading matter from a string. - - -

    Parameters

    -
      - -
    • - s: string -
    • - -
    • - r: leading regex (default: "%s+") -
    • - -
    - - - - - - -

    Return value:

    -string without leading r - - - -
    - - - - -
    numbertosi (n)
    -
    -Write a number using SI suffixes. The number is always written to 3 s.f. - - -

    Parameters

    -
      - -
    • - n: number -
    • - -
    - - - - - - -

    Return value:

    -string - - - -
    - - - - -
    ordinalSuffix (n)
    -
    -Return the English suffix for an ordinal. - - -

    Parameters

    -
      - -
    • - n: number of the day -
    • - -
    - - - - - - -

    Return value:

    -suffix - - - -
    - - - - -
    pad (s, w, p)
    -
    -Justify a string. When the string is longer than w, it is truncated (left or right according to the sign of w). - - -

    Parameters

    -
      - -
    • - s: string to justify -
    • - -
    • - w: width to justify to (-ve means right-justify; +ve means left-justify) -
    • - -
    • - p: string to pad with (default: " ") -
    • - -
    - - - - - - -

    Return value:

    -justified string - - - -
    - - - - -
    rtrim (s, r)
    -
    -Remove trailing matter from a string. - - -

    Parameters

    -
      - -
    • - s: string -
    • - -
    • - r: trailing regex (default: "%s+") -
    • - -
    - - - - - - -

    Return value:

    -string without trailing r - - - -
    - - - - -
    split (s, sep)
    -
    -Split a string at a given separator. FIXME: Consider Perl and Python versions. - - -

    Parameters

    -
      - -
    • - s: string to split -
    • - -
    • - sep: separator regex -
    • - -
    - - - - - - -

    Return value:

    -list of strings - - - -
    - - - - -
    tfind (s, p, init, plain)
    -
    -Do find, returning captures as a list. - - -

    Parameters

    -
      - -
    • - s: target string -
    • - -
    • - p: pattern -
    • - -
    • - init: start position (default: 1) -
    • - -
    • - plain: inhibit magic characters (default: nil) -
    • - -
    - - - - - - -

    Return value:

    -start of match, end of match, table of captures - - - -
    - - - - -
    trim (s, r)
    -
    -Remove leading and trailing matter from a string. - - -

    Parameters

    -
      - -
    • - s: string -
    • - -
    • - r: leading/trailing regex (default: "%s+") -
    • - -
    - - - - - - -

    Return value:

    -string without leading/trailing r - - - -
    - - - - -
    wrap (s, w, ind, ind1)
    -
    -Wrap a string into a paragraph. - - -

    Parameters

    -
      - -
    • - s: string to wrap -
    • - -
    • - w: width to wrap to (default: 78) -
    • - -
    • - ind: indent (default: 0) -
    • - -
    • - ind1: indent of first line (default: ind) -
    • - -
    - - - - - - -

    Return value:

    -wrapped paragraph - - - -
    - - -
    - - - - - - -
    - -
    - -
    -

    Valid XHTML 1.0!

    -
    - -
    - - diff --git a/modules/table.html b/modules/table.html deleted file mode 100644 index f83fba0..0000000 --- a/modules/table.html +++ /dev/null @@ -1,578 +0,0 @@ - - - - Reference - - - - - -
    - -
    - -
    -
    -
    - -
    - - - -
    - -

    Module table

    - -

    - - - - - -

    Functions

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    clone (t, nometa)Make a shallow copy of a table, including any metatable (for a deep copy, use tree.clone).
    clone_rename (map, t)Clone a table, renaming some keys.
    empty (t)Return whether table is empty.
    invert (t)Invert a table.
    keys (t)Make the list of keys of a table.
    merge (t, u)Merge one table into another.
    new (x, t)Make a table with a default value for unset keys.
    size (t)Find the number of elements in a table.
    sort (t, c)Make table.sort return its result.
    values (t)Make the list of values of a table.
    - - - - - - -
    -
    - - - -

    Functions

    -
    - - - -
    clone (t, nometa)
    -
    -Make a shallow copy of a table, including any metatable (for a deep copy, use tree.clone). - - -

    Parameters

    -
      - -
    • - t: table -
    • - -
    • - nometa: if non-nil don't copy metatable -
    • - -
    - - - - - - -

    Return value:

    -copy of table - - - -
    - - - - -
    clone_rename (map, t)
    -
    -Clone a table, renaming some keys. - - -

    Parameters

    -
      - -
    • - map: table {old_key=new_key, ...} -
    • - -
    • - t: table to copy -
    • - -
    - - - - - - -

    Return value:

    -copy of table - - - -
    - - - - -
    empty (t)
    -
    -Return whether table is empty. - - -

    Parameters

    -
      - -
    • - t: table -
    • - -
    - - - - - - -

    Return value:

    -true if empty or false otherwise - - - -
    - - - - -
    invert (t)
    -
    -Invert a table. - - -

    Parameters

    -
      - -
    • - t: table {i=v, ...} -
    • - -
    - - - - - - -

    Return value:

    -inverted table {v=i, ...} - - - -
    - - - - -
    keys (t)
    -
    -Make the list of keys of a table. - - -

    Parameters

    -
      - -
    • - t: table -
    • - -
    - - - - - - -

    Return value:

    -list of keys - - - -
    - - - - -
    merge (t, u)
    -
    -Merge one table into another. u is merged into t. - - -

    Parameters

    -
      - -
    • - t: first table -
    • - -
    • - u: second table -
    • - -
    - - - - - - -

    Return value:

    -first table - - - -
    - - - - -
    new (x, t)
    -
    -Make a table with a default value for unset keys. - - -

    Parameters

    -
      - -
    • - x: default entry value (default: nil) -
    • - -
    • - t: initial table (default: {}) -
    • - -
    - - - - - - -

    Return value:

    -table whose unset elements are x - - - -
    - - - - -
    size (t)
    -
    -Find the number of elements in a table. - - -

    Parameters

    -
      - -
    • - t: table -
    • - -
    - - - - - - -

    Return value:

    -number of elements in t - - - -
    - - - - -
    sort (t, c)
    -
    -Make table.sort return its result. - - -

    Parameters

    -
      - -
    • - t: table -
    • - -
    • - c: comparator function -
    • - -
    - - - - - - -

    Return value:

    -sorted table - - - -
    - - - - -
    values (t)
    -
    -Make the list of values of a table. - - -

    Parameters

    -
      - -
    • - t: table -
    • - -
    - - - - - - -

    Return value:

    -list of values - - - -
    - - -
    - - - - - - -
    - -
    - -
    -

    Valid XHTML 1.0!

    -
    - -
    - - diff --git a/modules/tree.html b/modules/tree.html deleted file mode 100644 index 543f3b6..0000000 --- a/modules/tree.html +++ /dev/null @@ -1,415 +0,0 @@ - - - - Reference - - - - - -
    - -
    - -
    -
    -
    - -
    - - - -
    - -

    Module tree

    - -

    Tables as trees.

    - - - - - -

    Functions

    - - - - - - - - - - - - - - - - - - - - - - -
    clone (t, nometa)Make a deep copy of a tree, including any metatables
    metatable.__index (tr, i)Tree __index metamethod.
    metatable.__newindex (tr, i, v)Tree __newindex metamethod.
    new (t)Make a table into a tree
    - - - - - - -
    -
    - - - -

    Functions

    -
    - - - -
    clone (t, nometa)
    -
    -Make a deep copy of a tree, including any metatables - - -

    Parameters

    -
      - -
    • - t: table -
    • - -
    • - nometa: if non-nil don't copy metatables -
    • - -
    - - - - - - -

    Return value:

    -copy of table - - - -
    - - - - -
    metatable.__index (tr, i)
    -
    -Tree __index metamethod. - - -

    Parameters

    -
      - -
    • - tr: tree -
    • - -
    • - i: non-table, or list of keys {i1 ... in} -
    • - -
    - - - - - - -

    Return value:

    -tr[i]...[in] if i is a table, or tr[i] otherwise - - - -
    - - - - -
    metatable.__newindex (tr, i, v)
    -
    -Tree __newindex metamethod. Sets tr[i1]...[in] = v if i is a table, or tr[i] = v otherwise - - -

    Parameters

    -
      - -
    • - tr: tree -
    • - -
    • - i: non-table, or list of keys {i1 ... in} -
    • - -
    • - v: value -
    • - -
    - - - - - - - - -
    - - - - -
    new (t)
    -
    -Make a table into a tree - - -

    Parameters

    -
      - -
    • - t: table -
    • - -
    - - - - - - -

    Return value:

    -tree - - - -
    - - -
    - - - - - - -
    - -
    - -
    -

    Valid XHTML 1.0!

    -
    - -
    - - From ffa9c2fd786e3cc09468a3de8be68c80314e0489 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Tue, 26 Nov 2013 16:14:12 +1300 Subject: [PATCH 03/15] docs: regenerate with current LDoc master. Signed-off-by: Gary V. Vaughan --- classes/std.list.html | 283 ++++++++++++++++++------------------ classes/std.object.html | 128 +++++++++++----- classes/std.set.html | 127 ++++++++-------- classes/std.strbuf.html | 21 ++- index.html | 15 +- modules/std.debug.html | 7 +- modules/std.functional.html | 7 +- modules/std.getopt.html | 7 +- modules/std.html | 11 +- modules/std.io.html | 7 +- modules/std.math.html | 7 +- modules/std.package.html | 7 +- modules/std.strict.html | 7 +- modules/std.string.html | 119 ++++++++++++++- modules/std.table.html | 7 +- modules/std.tree.html | 7 +- 16 files changed, 459 insertions(+), 308 deletions(-) diff --git a/classes/std.list.html b/classes/std.list.html index e1bfdd1..adf3acc 100644 --- a/classes/std.list.html +++ b/classes/std.list.html @@ -37,14 +37,14 @@

    Contents

    Classes

    -
      +

      Modules

      -
        +
        • std
        • debug
        • functional
        • @@ -63,7 +63,6 @@

          Modules

          Class std.list

          -

          Tables as lists.

          Every list is also an object, and thus inherits all of the std.object methods, particularly use of object cloning for making new list objects.

          @@ -88,101 +87,101 @@

          Methods

          List order operator. - std.list:append (l, x) + std.list.append (l, x) Append an item to a list. - std.list:compare (l, m) - Compare two lists element-by-element, from left-to-right. - - - std.list:concat (...) + std.list.concat (...) Concatenate arguments into a list. - std.list:cons (l, x) + std.list.cons (l, x) Prepend an item to a list. - std.list:depair (ls) + std.list.depair (ls) Turn a list of pairs into a table. - std.list:elems (l) - An iterator over the elements of a list. - - - std.list:enpair (t) + std.list.enpair (t) Turn a table into a list of pairs. - std.list:filter (l, p) + std.list.filter (l, p) Filter a list according to a predicate. - std.list:flatten (l) + std.list.flatten (l) Flatten a list. - std.list:foldl (l, f, e) + std.list.foldl (l, f, e) Fold a binary function through a list left associatively. - std.list:foldr (l, f, e) + std.list.foldr (l, f, e) Fold a binary function through a list right associatively. - std.list:index_key (l, f) + std.list.index_key (l, f) Make an index of a list of tables on a given field - std.list:index_value (l, f) + std.list.index_value (l, f) Copy a list of tables, indexed on a given field - std.list:map (l, f) + std.list.map (l, f) Map a function over a list. - std.list:map_with (ls, f) + std.list.map_with (ls, f) Map a function over a list of lists. - std.list:project (l, f) + std.list.project (l, f) Project a list of fields from a list of tables. - std.list:relems (l) + std.list.relems (l) An iterator over the elements of a list, in reverse. - std.list:rep (l, n) + std.list.rep (l, n) Repeat a list. - std.list:reverse (l) + std.list.reverse (l) Reverse a list. - std.list:shape (l, s) + std.list.shape (l, s) Shape a list according to a list of dimensions. - std.list:sub (l, from, to) + std.list.sub (l, from, to) Return a sub-range of a list. - std.list:tail (l) + std.list.tail (l) Return a list with its first element removed. - std.list:transpose (ls) + std.list.transpose (ls) Transpose a list of lists. - std.list:zip_with (ls, f) + std.list.zip_with (ls, f) Zip a list of lists together with a function. + + std.list:compare (l, m) + Compare two lists element-by-element, from left-to-right. + + + std.list:elems (l) + An iterator over the elements of a list. +
          @@ -208,7 +207,7 @@

          Methods

          See also:

          @@ -229,7 +228,7 @@

          See also:

          See also:

          @@ -299,8 +298,8 @@

          See also:

          - - std.list:append (l, x) + + std.list.append (l, x)
          Append an item to a list. @@ -328,38 +327,8 @@

          Returns:

          - - std.list:compare (l, m) -
          -
          - Compare two lists element-by-element, from left-to-right. - -

          Parameters:

          -
            -
          • l - table - a list -
          • -
          • m - table - another list -
          • -
          - -

          Returns:

          -
            - - -1 if l is less than m, 0 if they are the same, and 1 - if l is greater than m -
          - - - - -
          -
          - - std.list:concat (...) + + std.list.concat (...)
          Concatenate arguments into a list. @@ -387,8 +356,8 @@

          Returns:

          - - std.list:cons (l, x) + + std.list.cons (l, x)
          Prepend an item to a list. @@ -416,8 +385,8 @@

          Returns:

          - - std.list:depair (ls) + + std.list.depair (ls)
          Turn a list of pairs into a table. @@ -440,45 +409,14 @@

          Returns:

          See also:

          - - std.list:elems (l) -
          -
          - An iterator over the elements of a list. - -

          Parameters:

          -
            -
          • l - table - a list -
          • -
          - -

          Returns:

          -
            -
          1. - function - iterator function which returns successive elements of self
          2. -
          3. - table - l
          4. -
          5. - true
          6. -
          - - - - -
          -
          - - std.list:enpair (t) + + std.list.enpair (t)
          Turn a table into a list of pairs. @@ -501,14 +439,14 @@

          Returns:

          See also:

          - - std.list:filter (l, p) + + std.list.filter (l, p)
          Filter a list according to a predicate. @@ -537,8 +475,8 @@

          Returns:

          - - std.list:flatten (l) + + std.list.flatten (l)
          Flatten a list. @@ -563,8 +501,8 @@

          Returns:

          - - std.list:foldl (l, f, e) + + std.list.foldl (l, f, e)
          Fold a binary function through a list left associatively. @@ -595,8 +533,8 @@

          Returns:

          - - std.list:foldr (l, f, e) + + std.list.foldr (l, f, e)
          Fold a binary function through a list right associatively. @@ -627,8 +565,8 @@

          Returns:

          - - std.list:index_key (l, f) + + std.list.index_key (l, f)
          Make an index of a list of tables on a given field @@ -656,8 +594,8 @@

          Returns:

          - - std.list:index_value (l, f) + + std.list.index_value (l, f)
          Copy a list of tables, indexed on a given field @@ -685,8 +623,8 @@

          Returns:

          - - std.list:map (l, f) + + std.list.map (l, f)
          Map a function over a list. @@ -715,8 +653,8 @@

          Returns:

          - - std.list:map_with (ls, f) + + std.list.map_with (ls, f)
          Map a function over a list of lists. @@ -745,8 +683,8 @@

          Returns:

          - - std.list:project (l, f) + + std.list.project (l, f)
          Project a list of fields from a list of tables. @@ -774,8 +712,8 @@

          Returns:

          - - std.list:relems (l) + + std.list.relems (l)
          An iterator over the elements of a list, in reverse. @@ -805,8 +743,8 @@

          Returns:

          - - std.list:rep (l, n) + + std.list.rep (l, n)
          Repeat a list. @@ -835,8 +773,8 @@

          Returns:

          - - std.list:reverse (l) + + std.list.reverse (l)
          Reverse a list. @@ -861,8 +799,8 @@

          Returns:

          - - std.list:shape (l, s) + + std.list.shape (l, s)
          Shape a list according to a list of dimensions.

          @@ -902,8 +840,8 @@

          Returns:

          - - std.list:sub (l, from, to) + + std.list.sub (l, from, to)
          Return a sub-range of a list. @@ -941,8 +879,8 @@

          Returns:

          - - std.list:tail (l) + + std.list.tail (l)
          Return a list with its first element removed. @@ -967,8 +905,8 @@

          Returns:

          - - std.list:transpose (ls) + + std.list.transpose (ls)
          Transpose a list of lists. @@ -996,8 +934,8 @@

          Returns:

          - - std.list:zip_with (ls, f) + + std.list.zip_with (ls, f)
          Zip a list of lists together with a function. @@ -1029,6 +967,67 @@

          Returns:

          +
          +
          + + std.list:compare (l, m) +
          +
          + Compare two lists element-by-element, from left-to-right. + +

          Parameters:

          +
            +
          • l + table + a list +
          • +
          • m + table + another list +
          • +
          + +

          Returns:

          +
            + + -1 if l is less than m, 0 if they are the same, and 1 + if l is greater than m +
          + + + + +
          +
          + + std.list:elems (l) +
          +
          + An iterator over the elements of a list. + +

          Parameters:

          +
            +
          • l + table + a list +
          • +
          + +

          Returns:

          +
            +
          1. + function + iterator function which returns successive elements of self
          2. +
          3. + table + l
          4. +
          5. + true
          6. +
          + + + +
          diff --git a/classes/std.object.html b/classes/std.object.html index ae90678..f87eb01 100644 --- a/classes/std.object.html +++ b/classes/std.object.html @@ -37,14 +37,14 @@

          Contents

          Classes

          -
            +

            Modules

            -
              +
              • std
              • debug
              • functional
              • @@ -63,7 +63,6 @@

                Modules

                Class std.object

                -

                Prototype-based objects.

                @@ -118,6 +117,14 @@

                Class std.object

                Methods

                + + + + + + + + @@ -127,17 +134,17 @@

                Methods

                - + - + - + + in object, where private fields have keys prefixed with "_". @@ -152,6 +159,64 @@

                Methods

                Methods

                +
                + + std.object.__call +
                +
                + Return a clone of object.

                + +

                Normally a cloned object will share its metatable with its prototype, + unless some new fields for the cloned object begin with '_', in which + case they are merged into a copy of the prototype metatable to form + a new metatable for the cloned object (and its clones). + +

                params:

                +
                  +
                • ... + arguments for _init +
                • +
                + + + + + +
                +
                + + std.object.__metatable +
                +
                + Metatable for objects.

                + +

                This can't and shouldn't be set directly, because the Object class + manages it transparently during cloning. + +

                Fields:

                +
                  +
                • _type + string + derived objects can override this for objects + intended to be a prototype for further specialised objects. +
                • +
                • _init + table or function + Derived objects can override this to be + a set of keys to use for assigning unnamed arguments, or a function + to that will be called with unnamed arguments durict cloning. +
                • +
                + + + +

                See also:

                + + + +
                std.object.__tostring @@ -164,7 +229,7 @@

                Methods

                See also:

                @@ -185,32 +250,25 @@

                See also:

                See also:

                - std.object:clone (prototype, ...) + std.object:clone (...)
                Clone an object.

                -

                Prototypes are cloned by calling directly as described above, so this - clone method is rarely used explicitly. +

                Objects are usually cloned by calling a prototype directly, so this + method is rarely used explicitly.

                Parameters:

                  -
                • prototype - std.object - source object -
                • ... - -
                     arguments
                  -
                  - + arguments for _init
                @@ -219,16 +277,20 @@

                Returns:

                std.object a clone of prototype, adjusted - according to the rules above, and sharing a metatable where possible. + according to the rules above, and sharing a metatable where possible +

                See also:

                +
                - std.object:tostring (o) + std.object:tostring ()
                Return a stringified version of the contents of object.

                @@ -238,15 +300,8 @@

                Returns:

                remaining key-value pairs.

                This function doesn't recurse explicity, but relies upon suitable - __tostring metamethods in contained objects. + __tostring metamethods in contained objects. -

                Parameters:

                -

                Returns:

                  @@ -261,19 +316,18 @@

                  Returns:

                - std.object:totable (o) + std.object:totable (self)
                Return a new table with a shallow copy of all non-private fields - in object.

                - -

                Where private fields have keys prefixed with "_". + in object, where private fields have keys prefixed with "_".

                Parameters:

                diff --git a/classes/std.set.html b/classes/std.set.html index 2e39d8c..2d7f80b 100644 --- a/classes/std.set.html +++ b/classes/std.set.html @@ -37,14 +37,14 @@

                Contents

                Classes

                -
                - + - + - - - - - + - + - + - + - + - + - + - + + + + +
                std.object.__callReturn a clone of object.
                std.object.__metatableMetatable for objects.
                std.object.__tostring Return a string representation of object. Return a shallow copy of non-private object fields.
                std.object:clone (prototype, ...)std.object:clone (...) Clone an object.
                std.object:tostring (o)std.object:tostring () Return a stringified version of the contents of object.
                std.object:totable (o)std.object:totable (self) Return a new table with a shallow copy of all non-private fields - in object.
                std.object:type (o) Object to table conversion.
                std.set:delete (s, e)std.set.delete (s, e) Delete an element from a set.
                std.set:difference (s, t)std.set.difference (s, t) Find the difference of two sets.
                std.set:elems (s)Iterator for sets.
                std.set:equal (s, t)std.set.equal (s, t) Find whether two sets are equal.
                std.set:insert (s, e)std.set.insert (s, e) Insert an element into a set.
                std.set:intersection (s, t)std.set.intersection (s, t) Find the intersection of two sets.
                std.set:member (s, e)std.set.member (s, e) Say whether an element is in a set.
                std.set:propersubset (s, t)std.set.propersubset (s, t) Find whether one set is a proper subset of another.
                std.set:subset (s, t)std.set.subset (s, t) Find whether one set is a subset of another.
                std.set:symmetric_difference (s, t)std.set.symmetric_difference (s, t) Find the symmetric difference of two sets.
                std.set:union (s, t)std.set.union (s, t) Find the union of two sets.
                std.set:elems (s)Iterator for sets.

                @@ -169,7 +168,7 @@

                Methods

                See also:

                @@ -190,7 +189,7 @@

                See also:

                See also:

                @@ -211,7 +210,7 @@

                See also:

                See also:

                @@ -232,7 +231,7 @@

                See also:

                See also:

                @@ -253,7 +252,7 @@

                See also:

                See also:

                @@ -274,7 +273,7 @@

                See also:

                See also:

                @@ -297,8 +296,8 @@

                See also:

                - - std.set:delete (s, e) + + std.set.delete (s, e)
                Delete an element from a set. @@ -324,8 +323,8 @@

                Returns:

                - - std.set:difference (s, t) + + std.set.difference (s, t)
                Find the difference of two sets. @@ -351,29 +350,8 @@

                Returns:

                - - std.set:elems (s) -
                -
                - Iterator for sets. - -

                Parameters:

                -
                  -
                • s - - - -
                • -
                - - - - - -
                -
                - - std.set:equal (s, t) + + std.set.equal (s, t)
                Find whether two sets are equal. @@ -399,8 +377,8 @@

                Returns:

                - - std.set:insert (s, e) + + std.set.insert (s, e)
                Insert an element into a set. @@ -426,8 +404,8 @@

                Returns:

                - - std.set:intersection (s, t) + + std.set.intersection (s, t)
                Find the intersection of two sets. @@ -453,8 +431,8 @@

                Returns:

                - - std.set:member (s, e) + + std.set.member (s, e)
                Say whether an element is in a set. @@ -481,8 +459,8 @@

                Returns:

                - - std.set:propersubset (s, t) + + std.set.propersubset (s, t)
                Find whether one set is a proper subset of another. @@ -508,8 +486,8 @@

                Returns:

                - - std.set:subset (s, t) + + std.set.subset (s, t)
                Find whether one set is a subset of another. @@ -535,8 +513,8 @@

                Returns:

                - - std.set:symmetric_difference (s, t) + + std.set.symmetric_difference (s, t)
                Find the symmetric difference of two sets. @@ -562,8 +540,8 @@

                Returns:

                - - std.set:union (s, t) + + std.set.union (s, t)
                Find the union of two sets. @@ -587,6 +565,27 @@

                Returns:

                +
                +
                + + std.set:elems (s) +
                +
                + Iterator for sets. + +

                Parameters:

                +
                  +
                • s + + + +
                • +
                + + + + +
                diff --git a/classes/std.strbuf.html b/classes/std.strbuf.html index 7e7243b..05a3a3c 100644 --- a/classes/std.strbuf.html +++ b/classes/std.strbuf.html @@ -37,14 +37,14 @@

                Contents

                Classes

                -
                  +

                  Modules

                  -
                    +
                    • std
                    • debug
                    • functional
                    • @@ -63,7 +63,6 @@

                      Modules

                      Class std.strbuf

                      -

                      String buffers.

                      @@ -81,11 +80,11 @@

                      Methods

                      Support fast conversion to Lua string. - std.strbuf:concat (b, s) + std.strbuf.concat (b, s) Add a string to a buffer. - std.strbuf:tostring (b) + std.strbuf.tostring (b) Convert a buffer to a string. @@ -113,7 +112,7 @@

                      Methods

                      See also:

                      @@ -134,14 +133,14 @@

                      See also:

                      See also:

                      - - std.strbuf:concat (b, s) + + std.strbuf.concat (b, s)
                      Add a string to a buffer. @@ -167,8 +166,8 @@

                      Returns:

                      - - std.strbuf:tostring (b) + + std.strbuf.tostring (b)
                      Convert a buffer to a string. diff --git a/index.html b/index.html index 2e8e186..df146e3 100644 --- a/index.html +++ b/index.html @@ -30,7 +30,7 @@

                      stdlib

                      Modules

                      -
                        +

                        Classes

                        -
                          -
                        • std.list
                        • + @@ -56,7 +56,6 @@

                          Classes

                          -

                          Standard Lua Libraries

                          Modules

                          @@ -108,14 +107,14 @@

                          Modules

                          Classes

                          - - - - + + + + diff --git a/modules/std.debug.html b/modules/std.debug.html index 6b08ac9..a0ba693 100644 --- a/modules/std.debug.html +++ b/modules/std.debug.html @@ -38,7 +38,7 @@

                          Contents

                          Modules

                          -
                            +

                            Classes

                            -
                              -
                            • std.list
                            • + @@ -64,7 +64,6 @@

                              Classes

                              Module std.debug

                              -

                              Additions to the debug module

                              diff --git a/modules/std.functional.html b/modules/std.functional.html index 6113a67..b9a39b0 100644 --- a/modules/std.functional.html +++ b/modules/std.functional.html @@ -38,7 +38,7 @@

                              Contents

                              Modules

                              -
                                +

                                Classes

                                -
                                  -
                                • std.list
                                • + @@ -64,7 +64,6 @@

                                  Classes

                                  Module std.functional

                                  -

                                  Functional programming.

                                  diff --git a/modules/std.getopt.html b/modules/std.getopt.html index 1def5d7..1971e8a 100644 --- a/modules/std.getopt.html +++ b/modules/std.getopt.html @@ -37,7 +37,7 @@

                                  Contents

                                  Modules

                                  -
                                    +

                                    Classes

                                    -
                                      -
                                    • std.list
                                    • + @@ -63,7 +63,6 @@

                                      Classes

                                      Module std.getopt

                                      -

                                      Simplified getopt, based on Svenne Panne's Haskell GetOpt.

                                      Usage:

                                      diff --git a/modules/std.html b/modules/std.html index 04eff5b..d0ae349 100644 --- a/modules/std.html +++ b/modules/std.html @@ -38,7 +38,7 @@

                                      Contents

                                      Modules

                                      -
                          - + @@ -597,7 +596,7 @@

                          See also:

                          _G.tostring ()
                          - Extend tostring to work better on tables. + Extend tostring to work better on tables. diff --git a/modules/std.io.html b/modules/std.io.html index 209ddc5..ffcf7b3 100644 --- a/modules/std.io.html +++ b/modules/std.io.html @@ -37,7 +37,7 @@

                          Contents

                          Modules

                          -
                            +

                            Classes

                            -
                              -
                            • std.list
                            • + @@ -63,7 +63,6 @@

                              Classes

                              Module std.io

                              -

                              Additions to the io module.

                              diff --git a/modules/std.math.html b/modules/std.math.html index 4c3b234..a43c7a0 100644 --- a/modules/std.math.html +++ b/modules/std.math.html @@ -37,7 +37,7 @@

                              Contents

                              Modules

                              -
                                +

                                Classes

                                -
                                  -
                                • std.list
                                • + @@ -63,7 +63,6 @@

                                  Classes

                                  Module std.math

                                  -

                                  Additions to the math module.

                                  diff --git a/modules/std.package.html b/modules/std.package.html index e88b54a..e5d775b 100644 --- a/modules/std.package.html +++ b/modules/std.package.html @@ -37,7 +37,7 @@

                                  Contents

                                  Modules

                                  -
                                    +

                                    Classes

                                    -
                                      -
                                    • std.list
                                    • + @@ -63,7 +63,6 @@

                                      Classes

                                      Module std.package

                                      -

                                      Additions to the package module.

                                      diff --git a/modules/std.strict.html b/modules/std.strict.html index 1ff2f51..a8f071f 100644 --- a/modules/std.strict.html +++ b/modules/std.strict.html @@ -37,7 +37,7 @@

                                      Contents

                                      Modules

                                      -
                          + + + + @@ -181,6 +185,21 @@

                          Functions

                          std.listTables as lists.
                          std.object Prototype-based objects.
                          std.listTables as lists.
                          std.set Set object.
                          _G.tostring ()Extend tostring to work better on tables.Extend tostring to work better on tables.
                          _G.totable () Escape a string to be used as a pattern.
                          escape_shell (s)Escape a string to be used as a shell token.
                          finds (s, p, init, plain) Do multiple finds on a string.
                          Wrap a string into a paragraph.
                          +

                          Fields

                          + + + + + + + + + + + + + +
                          sGive strings a subscription operator.
                          sGive strings an append metamethod.
                          sGive strings a concat metamethod.


                          @@ -289,6 +308,32 @@

                          Returns:

                          +
                      +
                      + + escape_shell (s) +
                      +
                      + Escape a string to be used as a shell token. + Quotes spaces, parentheses, brackets, quotes, apostrophes and + whitespace. + +

                      Parameters:

                      +
                        +
                      • s + string to process +
                      • +
                      + +

                      Returns:

                      +
                        + + processed string +
                      + + + +
                      @@ -921,6 +966,72 @@

                      Returns:

                      + + +

                      Fields

                      +
                      +
                      + + s +
                      +
                      + Give strings a subscription operator. + +
                        +
                      • s + string +
                      • +
                      • i + index +
                      • +
                      + + + + + +
                      +
                      + + s +
                      +
                      + Give strings an append metamethod. + +
                        +
                      • s + string +
                      • +
                      • c + character (1-character string) +
                      • +
                      + + + + + +
                      +
                      + + s +
                      +
                      + Give strings a concat metamethod. + +
                        +
                      • s + string +
                      • +
                      • o + object +
                      • +
                      + + + + +
                      diff --git a/modules/std.table.html b/modules/std.table.html index 8ba681f..645c2d1 100644 --- a/modules/std.table.html +++ b/modules/std.table.html @@ -37,7 +37,7 @@

                      Contents

                      Modules

                      -
                        +

                        Classes

                        -
                          -
                        • std.list
                        • + @@ -63,7 +63,6 @@

                          Classes

                          Module std.table

                          -

                          Extensions to the table module.

                          diff --git a/modules/std.tree.html b/modules/std.tree.html index eca5a3e..383fb4e 100644 --- a/modules/std.tree.html +++ b/modules/std.tree.html @@ -38,7 +38,7 @@

                          Contents

                          Modules

                          -
                            +

                            Classes

                            -
                              -
                            • std.list
                            • + @@ -64,7 +64,6 @@

                              Classes

                              Module std.tree

                              -

                              Tables as trees.

                              From 08691c59bf74a127fc0d7cd3b7a4c3b4abbec1c3 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Thu, 28 Nov 2013 14:15:10 +1300 Subject: [PATCH 04/15] docs: regenerate with latest LDoc master. Signed-off-by: Gary V. Vaughan --- classes/std.list.html | 743 ++++++++++++++++++------------------ classes/std.object.html | 205 +++++----- classes/std.set.html | 466 +++++++++++----------- classes/std.strbuf.html | 148 ++++--- index.html | 20 +- modules/std.debug.html | 20 +- modules/std.functional.html | 20 +- modules/std.getopt.html | 22 +- modules/std.html | 20 +- modules/std.io.html | 20 +- modules/std.math.html | 20 +- modules/std.package.html | 20 +- modules/std.strict.html | 34 +- modules/std.string.html | 20 +- modules/std.table.html | 20 +- modules/std.tree.html | 134 ++++--- 16 files changed, 1018 insertions(+), 914 deletions(-) diff --git a/classes/std.list.html b/classes/std.list.html index adf3acc..8cdd8f9 100644 --- a/classes/std.list.html +++ b/classes/std.list.html @@ -32,7 +32,9 @@

                              stdlib

                              Contents

                              @@ -46,16 +48,16 @@

                              Classes

                              Modules

                              @@ -64,123 +66,154 @@

                              Modules

                              Class std.list

                              Tables as lists.

                              +

                              + +

                              Every list is also an object, and thus inherits all of the std.object methods, particularly use of object cloning for making new list objects.

                              +

                              In addition to calling methods on list objects in OO style...

                              + +
                               local List = require "std.list"
                              + local l = List {1, 2, 3}
                              + for e in l:relems () do print (e) end
                              +   => 3
                              +   => 2
                              +   => 1
                              +
                              + +

                              ...they can also be called as module functions with an explicit argument:

                              + +
                               local List = require "std.list"
                              + local l = List {1, 2, 3}
                              + for e in List.relems (l) do print (e) end
                              +   => 3
                              +   => 2
                              +   => 1
                              +
                              + +

                              -

                              Methods

                              + +

                              Functions

                              - - + + - - + + - - + + - - + + - - + + - - + + - - + + +
                              std.list.__addAppend to list.std.list.depair (ls)Turn a list of pairs into a table.
                              std.list.__concatConcatenate lists.std.list.enpair (t)Turn a table into a list of pairs.
                              std.list.__leList equality or order operator.std.list.index_key (l, f)Make an index of a list of tables on a given field
                              std.list.__ltList order operator.std.list.index_value (l, f)Copy a list of tables, indexed on a given field
                              std.list.append (l, x)Append an item to a list.std.list.map_with (ls, f)Map a function over a list of lists.
                              std.list.concat (...)Concatenate arguments into a list.std.list.transpose (ls)Transpose a list of lists.
                              std.list.cons (l, x)Prepend an item to a list.std.list.zip_with (ls, f)Zip a list of lists together with a function.
                              +

                              Methods

                              + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + +
                              std.list.depair (ls)Turn a list of pairs into a table.std.list:append (x)Append an item to a list.
                              std.list.enpair (t)Turn a table into a list of pairs.std.list:compare (l)Compare two lists element-by-element, from left-to-right.
                              std.list.filter (l, p)Filter a list according to a predicate.std.list:concat (...)Concatenate arguments into a list.
                              std.list.flatten (l)Flatten a list.std.list:cons (x)Prepend an item to a list.
                              std.list.foldl (l, f, e)Fold a binary function through a list left associatively.std.list:elems ()An iterator over the elements of a list.
                              std.list.foldr (l, f, e)Fold a binary function through a list right associatively.std.list:filter (p)Filter a list according to a predicate.
                              std.list.index_key (l, f)Make an index of a list of tables on a given fieldstd.list:flatten (self)Flatten a list.
                              std.list.index_value (l, f)Copy a list of tables, indexed on a given fieldstd.list:foldl (f, e)Fold a binary function through a list left associatively.
                              std.list.map (l, f)Map a function over a list.std.list:foldr (f, e)Fold a binary function through a list right associatively.
                              std.list.map_with (ls, f)Map a function over a list of lists.std.list:map (f)Map a function over a list.
                              std.list.project (l, f)std.list:project (f) Project a list of fields from a list of tables.
                              std.list.relems (l)std.list:relems (self) An iterator over the elements of a list, in reverse.
                              std.list.rep (l, n)std.list:rep (n) Repeat a list.
                              std.list.reverse (l)std.list:reverse (self) Reverse a list.
                              std.list.shape (l, s)std.list:shape (s) Shape a list according to a list of dimensions.
                              std.list.sub (l, from, to)std.list:sub (from, to) Return a sub-range of a list.
                              std.list.tail (l)std.list:tail (self) Return a list with its first element removed.
                              +

                              Metamethods

                              + - - + + - - + + - - + + - - + +
                              std.list.transpose (ls)Transpose a list of lists.std.list:__add (list, element)Append element to list.
                              std.list.zip_with (ls, f)Zip a list of lists together with a function.std.list:__concat (list, table)Concatenate lists.
                              std.list:compare (l, m)Compare two lists element-by-element, from left-to-right.std.list:__le (list1, list2)List equality or order operator.
                              std.list:elems (l)An iterator over the elements of a list.std.list:__lt (list1, list2)List order operator.
                              @@ -188,130 +221,142 @@

                              Methods


                              -

                              Methods

                              - +

                              Functions

                              - - std.list.__add + + std.list.depair (ls)
                              + Turn a list of pairs into a table. -

                              Append to list.

                              -
                               list = list + element
                              -
                              - +

                              Parameters:

                              +
                                +
                              • ls + table + list of lists {{i1, v1}, ..., {in, vn}} +
                              • +
                              +

                              Returns:

                              +
                                + table + a new list containing table {i1=v1, ..., in=vn} +

                              See also:

                              - - std.list.__concat + + std.list.enpair (t)
                              + Turn a table into a list of pairs. -

                              Concatenate lists.

                              -
                               new = list .. table
                              -
                              - +

                              Parameters:

                              +
                                +
                              • t + table + a table {i1=v1, ..., in=vn} +
                              • +
                              +

                              Returns:

                              +
                                + std.list + a new list containing {{i1, v1}, ..., {in, vn}} +

                              See also:

                              - - std.list.__le + + std.list.index_key (l, f)
                              + Make an index of a list of tables on a given field -

                              List equality or order operator.

                              -
                               min = list1 <= list2 and list1 or list2
                              -
                              - - -

                              params:

                              +

                              Parameters:

                                -
                              • list1 - std.list - a list +
                              • l + table + list of tables {t1, ..., tn}
                              • -
                              • list2 - std.list - another list +
                              • f + field
                              +

                              Returns:

                              +
                                + + std.list + index {t1[f]=1, ..., tn[f]=n} +
                              -

                              See also:

                              -
                              - - std.list.__lt + + std.list.index_value (l, f)
                              + Copy a list of tables, indexed on a given field -

                              List order operator.

                              -
                               max = list1 > list2 and list1 or list2
                              -
                              - - -

                              params:

                              +

                              Parameters:

                                -
                              • list1 - std.list - a list +
                              • l + table + list of tables {i1=t1, ..., in=tn}
                              • -
                              • list2 - std.list - another list +
                              • f + field whose value should be used as index
                              +

                              Returns:

                              +
                                + + std.list + index {t1[f]=t1, ..., tn[f]=tn} +
                              -

                              See also:

                              -
                              - - std.list.append (l, x) + + std.list.map_with (ls, f)
                              - Append an item to a list. + Map a function over a list of lists.

                              Parameters:

                                -
                              • l +
                              • ls table - a list + a list of lists
                              • -
                              • x - item +
                              • f + function + map function
                              @@ -319,7 +364,7 @@

                              Returns:

                                std.list - new list containing {l[1], ..., l[#l], x} + new list {f (unpack (ls[1]))), ..., f (unpack (ls[#ls]))}
                              @@ -327,16 +372,19 @@

                              Returns:

                              - - std.list.concat (...) + + std.list.transpose (ls)
                              - Concatenate arguments into a list. + Transpose a list of lists. + This function in Lua is equivalent to zip and unzip in more strongly + typed languages.

                              Parameters:

                                -
                              • ... - tuple of lists +
                              • ls + table + {{ls<1,1>, ..., ls<1,c>}, ..., {ls<r,1>, ..., ls<r,c>}}
                              @@ -344,11 +392,8 @@

                              Returns:

                                std.list - -

                                new list containing

                                -
                                                   <code>{l\_1[1], ..., l\_1[#l\_1], ..., l\_n[1], ..., l\_n[#l\_n]}</code>
                                -
                                - + new list containing + {{ls<1,1>, ..., ls<r,1>}, ..., {ls<1,c>, ..., ls<r,c>}}
                              @@ -356,20 +401,21 @@

                              Returns:

                              - - std.list.cons (l, x) + + std.list.zip_with (ls, f)
                              - Prepend an item to a list. + Zip a list of lists together with a function.

                              Parameters:

                                -
                              • l +
                              • ls table - a list + list of lists
                              • -
                              • x - item +
                              • f + function + function
                              @@ -377,89 +423,88 @@

                              Returns:

                                std.list - new list containing {x, unpack (l)} + +
                                a new list containing
                                +
                                +

                                {f (ls[1][1], ..., ls[#ls][1]), ..., f (ls[1][N], ..., ls[#ls][N]) + where N = max {map (function (l) return #l end, ls)}

                                +
                              +
                              +

                              Methods

                              +
                              - - std.list.depair (ls) + + std.list:append (x)
                              - Turn a list of pairs into a table. + Append an item to a list.

                              Parameters:

                                -
                              • ls - table - list of lists {{i1, v1}, ..., {in, vn}} +
                              • x + item

                              Returns:

                                - table - a new list containing table {i1=v1, ..., in=vn} + std.list + new list containing {self[1], ..., self[#self], x}
                              -

                              See also:

                              -
                              - - std.list.enpair (t) + + std.list:compare (l)
                              - Turn a table into a list of pairs. + +

                              Compare two lists element-by-element, from left-to-right.

                              + +
                               if a_list:compare (another_list) == 0 then print "same" end
                              +
                              +

                              Parameters:

                                -
                              • t +
                              • l table - a table {i1=v1, ..., in=vn} + another list

                              Returns:

                                - std.list - a new list containing {{i1, v1}, ..., {in, vn}} + -1 if self is less than l, 0 if they are the same, and 1 + if self is greater than l
                              -

                              See also:

                              -
                              - - std.list.filter (l, p) + + std.list:concat (...)
                              - Filter a list according to a predicate. + Concatenate arguments into a list.

                              Parameters:

                                -
                              • l - table - a list -
                              • -
                              • p - function - predicate function, of one argument returning a boolean +
                              • ... + tuple of lists
                              @@ -467,7 +512,8 @@

                              Returns:

                                std.list - new list containing elements e of l for which p (e) is true + new list containing + {self[1], ..., self[#self], l_1[1], ..., l_1[#l_1], ..., l_n[1], ..., l_n[#l_n]}
                              @@ -475,17 +521,16 @@

                              Returns:

                              - - std.list.flatten (l) + + std.list:cons (x)
                              - Flatten a list. + Prepend an item to a list.

                              Parameters:

                                -
                              • l - table - a list +
                              • x + item
                              @@ -493,7 +538,7 @@

                              Returns:

                                std.list - flattened list + new list containing {x, unpack (self)}
                              @@ -501,31 +546,23 @@

                              Returns:

                              - - std.list.foldl (l, f, e) + + std.list:elems ()
                              - Fold a binary function through a list left associatively. + An iterator over the elements of a list. -

                              Parameters:

                              -
                                -
                              • l - table - a list -
                              • -
                              • f - function - binary function -
                              • -
                              • e - element to place in left-most position -
                              • -

                              Returns:

                                - - result +
                              1. + function + iterator function which returns successive elements of self
                              2. +
                              3. + table + list
                              4. +
                              5. + true
                              @@ -533,31 +570,25 @@

                              Returns:

                              - - std.list.foldr (l, f, e) + + std.list:filter (p)
                              - Fold a binary function through a list right associatively. + Filter a list according to a predicate.

                              Parameters:

                                -
                              • l - table - a list -
                              • -
                              • f +
                              • p function - binary function -
                              • -
                              • e - element to place in right-most position + predicate function, of one argument returning a boolean

                              Returns:

                                - result + std.list + new list containing elements e of self for which p (e) is true
                              @@ -565,20 +596,18 @@

                              Returns:

                              - - std.list.index_key (l, f) + + std.list:flatten (self)
                              - Make an index of a list of tables on a given field + Flatten a list.

                              Parameters:

                                -
                              • l - table - list of tables {t1, ..., tn} -
                              • -
                              • f - field +
                              • self + + +
                              @@ -586,7 +615,7 @@

                              Returns:

                                std.list - index {t1[f]=1, ..., tn[f]=n} + flattened list
                              @@ -594,28 +623,27 @@

                              Returns:

                              - - std.list.index_value (l, f) + + std.list:foldl (f, e)
                              - Copy a list of tables, indexed on a given field + Fold a binary function through a list left associatively.

                              Parameters:

                                -
                              • l - table - list of tables {i1=t1, ..., in=tn} -
                              • f - field whose value should be used as index + function + binary function +
                              • +
                              • e + element to place in left-most position

                              Returns:

                                - std.list - index {t1[f]=t1, ..., tn[f]=tn} + result
                              @@ -623,29 +651,27 @@

                              Returns:

                              - - std.list.map (l, f) + + std.list:foldr (f, e)
                              - Map a function over a list. + Fold a binary function through a list right associatively.

                              Parameters:

                                -
                              • l - table - a list -
                              • f function - map function + binary function +
                              • +
                              • e + element to place in right-most position

                              Returns:

                                - std.list - new list containing {f (list[1]), ..., f (list[#list])} + result
                              @@ -653,21 +679,17 @@

                              Returns:

                              - - std.list.map_with (ls, f) + + std.list:map (f)
                              - Map a function over a list of lists. + Map a function over a list.

                              Parameters:

                                -
                              • ls - table - a list of lists -
                              • f function - map function + map function
                              @@ -675,7 +697,7 @@

                              Returns:

                                std.list - new list {f (unpack (ls[1]))), ..., f (unpack (ls[#ls]))} + new list containing {f (self[1]), ..., f (self[#self])}
                              @@ -683,18 +705,14 @@

                              Returns:

                              - - std.list.project (l, f) + + std.list:project (f)
                              Project a list of fields from a list of tables.

                              Parameters:

                                -
                              • l - table - a list -
                              • f field to project
                              • @@ -712,17 +730,18 @@

                                Returns:

                              - - std.list.relems (l) + + std.list:relems (self)
                              An iterator over the elements of a list, in reverse.

                              Parameters:

                                -
                              • l - table - a list +
                              • self + + +
                              @@ -730,10 +749,10 @@

                              Returns:

                              1. function - iterator function which returns precessive elements of the list
                              2. + iterator function which returns precessive elements of the self
                              3. std.list - l
                              4. + self
                              5. true
                              @@ -743,18 +762,14 @@

                              Returns:

                              - - std.list.rep (l, n) + + std.list:rep (n)
                              Repeat a list.

                              Parameters:

                                -
                              • l - table - a list -
                              • n number number of times to repeat @@ -765,7 +780,7 @@

                                Returns:

                                  std.list - n copies of l appended together + n copies of self appended together
                                @@ -773,17 +788,18 @@

                                Returns:

                              - - std.list.reverse (l) + + std.list:reverse (self)
                              Reverse a list.

                              Parameters:

                                -
                              • l - table - a list +
                              • self + + +
                              @@ -791,7 +807,7 @@

                              Returns:

                                std.list - new list containing {l[#l], ..., l[1]} + new list containing {self[#self], ..., self[1]}
                              @@ -799,8 +815,8 @@

                              Returns:

                              - - std.list.shape (l, s) + + std.list:shape (s)
                              Shape a list according to a list of dimensions.

                              @@ -819,10 +835,6 @@

                              Returns:

                              Parameters:

                                -
                              • l - table - a list -
                              • s table {d1, ..., dn} @@ -840,30 +852,23 @@

                                Returns:

                              - - std.list.sub (l, from, to) + + std.list:sub (from, to)
                              Return a sub-range of a list. - (The equivalent of string.sub -- on strings; negative list indices + (The equivalent of string.sub on strings; negative list indices count from the end of the list.)

                              Parameters:

                                -
                              • l - table - -
                                a list
                                -
                                - -
                              • from number start of range (default: 1)
                              • to number - end of range (default: #list) + end of range (default: #self)
                              @@ -871,7 +876,7 @@

                              Returns:

                                std.list - new list containing {l[from], ..., l[to]} + new list containing {self[from], ..., self[to]}
                              @@ -879,17 +884,18 @@

                              Returns:

                              - - std.list.tail (l) + + std.list:tail (self)
                              Return a list with its first element removed.

                              Parameters:

                                -
                              • l - table - a list +
                              • self + + +
                              @@ -897,135 +903,140 @@

                              Returns:

                                std.list - new list containing {l[2], ..., l[#l]} + new list containing {self[2], ..., self[#self]}
                              +
                              +

                              Metamethods

                              +
                              - - std.list.transpose (ls) + + std.list:__add (list, element)
                              - Transpose a list of lists. - This function in Lua is equivalent to zip and unzip in more strongly - typed languages. + +

                              Append element to list.

                              +
                               list = list + element
                              +
                              +

                              Parameters:

                                -
                              • ls - table - {{ls<1,1>, ..., ls<1,c>}, ..., {ls<r,1>, ..., ls<r,c>}} +
                              • list + std.list + a list +
                              • +
                              • element + element to append
                              -

                              Returns:

                              -
                                - - std.list - new list containing - {{ls<1,1>, ..., ls<r,1>}, ..., {ls<1,c>, ..., ls<r,c>}} -
                              +

                              See also:

                              +
                              - - std.list.zip_with (ls, f) + + std.list:__concat (list, table)
                              - Zip a list of lists together with a function. + +

                              Concatenate lists.

                              +
                               new = list .. table
                              +
                              +

                              Parameters:

                                -
                              • ls - table - list of lists +
                              • list + std.list + a list
                              • -
                              • f - function - function +
                              • table + table + another list, hash part is ignored
                              -

                              Returns:

                              -
                                - - std.list - -
                                a new list containing
                                -
                                -

                                {f (ls[1][1], ..., ls[#ls][1]), ..., f (ls[1][N], ..., ls[#ls][N]) - where N = max {map (function (l) return #l end, ls)}

                                - -
                              +

                              See also:

                              +
                              - - std.list:compare (l, m) + + std.list:__le (list1, list2)
                              - Compare two lists element-by-element, from left-to-right. + +

                              List equality or order operator.

                              +
                               min = list1 <= list2 and list1 or list2
                              +
                              +

                              Parameters:

                              -

                              Returns:

                              -
                                - - -1 if l is less than m, 0 if they are the same, and 1 - if l is greater than m -
                              +

                              See also:

                              +
                              - - std.list:elems (l) + + std.list:__lt (list1, list2)
                              - An iterator over the elements of a list. + +

                              List order operator.

                              +
                               max = list1 > list2 and list1 or list2
                              +
                              +

                              Parameters:

                              -

                              Returns:

                              -
                                -
                              1. - function - iterator function which returns successive elements of self
                              2. -
                              3. - table - l
                              4. -
                              5. - true
                              6. -
                              +

                              See also:

                              +
                              diff --git a/classes/std.object.html b/classes/std.object.html index f87eb01..a0c44f1 100644 --- a/classes/std.object.html +++ b/classes/std.object.html @@ -32,7 +32,9 @@

                              stdlib

                              Contents

                              @@ -46,16 +48,16 @@

                              Classes

                              Modules

                          @@ -115,24 +117,15 @@

                          Class std.object

                          -

                          Methods

                          +

                          Tables

                          - - - - - + - - - - - - - - +
                          std.object.__callReturn a clone of object.
                          std.object.__metatablestd.object._metatable Metatable for objects.
                          std.object.__tostringReturn a string representation of object.
                          std.object.__totableReturn a shallow copy of non-private object fields.
                          +

                          Methods

                          + @@ -151,41 +144,31 @@

                          Methods

                          std.object:clone (...) Clone an object. Return the extended object type, if any, else primitive type.
                          +

                          Metamethods

                          + + + + + + + + + + + + + +
                          std.object:__call (...)Return a clone of object.
                          std.object:__tostring ()Return a string representation of object.
                          std.object:__totable ()Return a shallow copy of non-private object fields.


                          -

                          Methods

                          - +

                          Tables

                          - - std.object.__call -
                          -
                          - Return a clone of object.

                          - -

                          Normally a cloned object will share its metatable with its prototype, - unless some new fields for the cloned object begin with '_', in which - case they are merged into a copy of the prototype metatable to form - a new metatable for the cloned object (and its clones). - -

                          params:

                          -
                            -
                          • ... - arguments for _init -
                          • -
                          - - - - - -
                          -
                          - - std.object.__metatable + + std.object._metatable
                          Metatable for objects.

                          @@ -217,44 +200,9 @@

                          See also:

                          -
                          - - std.object.__tostring -
                          -
                          - Return a string representation of object. - - - - -

                          See also:

                          - - - -
                          -
                          - - std.object.__totable -
                          -
                          - Return a shallow copy of non-private object fields.

                          - -

                          This pseudo-metamethod is used during object cloning to make the - intial new object table, and can be overridden in other objects - for greater control of which fields are considered non-private. - - - - -

                          See also:

                          - - - -
                          +
                          +

                          Methods

                          +
                          std.object:clone (...) @@ -283,7 +231,7 @@

                          Returns:

                          See also:

                          @@ -300,7 +248,7 @@

                          See also:

                          remaining key-value pairs.

                          This function doesn't recurse explicity, but relies upon suitable - __tostring metamethods in contained objects. + __tostring metamethods in contained objects.

                          Returns:

                          @@ -388,6 +336,77 @@

                          Returns:

                          + +
                          +

                          Metamethods

                          +
                          +
                          + + std.object:__call (...) +
                          +
                          + Return a clone of object.

                          + +

                          Normally a cloned object will share its metatable with its prototype, + unless some new fields for the cloned object begin with '_', in which + case they are merged into a copy of the prototype metatable to form + a new metatable for the cloned object (and its clones). + +

                          Parameters:

                          +
                            +
                          • ... + arguments for _init +
                          • +
                          + +

                          Returns:

                          +
                            + + std.object + a clone of the called object. +
                          + + + + +
                          +
                          + + std.object:__tostring () +
                          +
                          + Return a string representation of object. + + + + +

                          See also:

                          + + + +
                          +
                          + + std.object:__totable () +
                          +
                          + Return a shallow copy of non-private object fields.

                          + +

                          This pseudo-metamethod is used during object cloning to make the + intial new object table, and can be overridden in other objects + for greater control of which fields are considered non-private. + + + + +

                          See also:

                          + + +
                          diff --git a/classes/std.set.html b/classes/std.set.html index 2d7f80b..542689a 100644 --- a/classes/std.set.html +++ b/classes/std.set.html @@ -32,7 +32,8 @@

                          stdlib

                          Contents

                          @@ -46,16 +47,16 @@

                          Classes

                          Modules

                      @@ -69,79 +70,82 @@

                      Class std.set

                      -

                      Methods

                      +

                      Methods

                      - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + +
                      std.set.__addUnion operator.std.set:delete (e)Delete an element from a set.
                      std.set.__divSymmetric difference operator.std.set:difference (s)Find the difference of two sets.
                      std.set.__leSubset operator.std.set:elems (self)Iterator for sets.
                      std.set.__ltProper subset operator.std.set:equal (s)Find whether two sets are equal.
                      std.set.__mulIntersection operator.std.set:insert (e)Insert an element into a set.
                      std.set.__subDifference operator.std.set:intersection (s)Find the intersection of two sets.
                      std.set.__totableObject to table conversion.std.set:member (e)Say whether an element is in a set.
                      std.set.delete (s, e)Delete an element from a set.std.set:propersubset (s)Find whether one set is a proper subset of another.
                      std.set.difference (s, t)Find the difference of two sets.std.set:subset (s)Find whether one set is a subset of another.
                      std.set.equal (s, t)Find whether two sets are equal.std.set:symmetric_difference (s)Find the symmetric difference of two sets.
                      std.set.insert (s, e)Insert an element into a set.std.set:union (s)Find the union of two sets.
                      +

                      Metamethods

                      + - - + + - - + + - - + + - - + + - - + + - - + + - - + +
                      std.set.intersection (s, t)Find the intersection of two sets.std.set:__add (set, table)Union operator.
                      std.set.member (s, e)Say whether an element is in a set.std.set:__div (set, table)Symmetric difference operator.
                      std.set.propersubset (s, t)Find whether one set is a proper subset of another.std.set:__le (set, table)Subset operator.
                      std.set.subset (s, t)Find whether one set is a subset of another.std.set:__lt (set, table)Proper subset operator.
                      std.set.symmetric_difference (s, t)Find the symmetric difference of two sets.std.set:__mul (set, table)Intersection operator.
                      std.set.union (s, t)Find the union of two sets.std.set:__sub (set, table)Difference operator.
                      std.set:elems (s)Iterator for sets.std.set:__totable (self)Object to table conversion.
                      @@ -149,173 +153,192 @@

                      Methods


                      -

                      Methods

                      - +

                      Methods

                      - - std.set.__add + + std.set:delete (e)
                      + Delete an element from a set. -

                      Union operator.

                      -
                       set + table = union
                      -
                      +

                      Parameters:

                      +
                        +
                      • e + element +
                      • +
                      +

                      Returns:

                      +
                        + the modified set +
                      -

                      See also:

                      - -
                      - - std.set.__div + + std.set:difference (s)
                      + Find the difference of two sets. -

                      Symmetric difference operator.

                      -
                       set / table = symmetric difference
                      -
                      - +

                      Parameters:

                      +
                        +
                      • s + set +
                      • +
                      +

                      Returns:

                      +
                        + self with elements of s removed +
                      -

                      See also:

                      -
                      - - std.set.__le + + std.set:elems (self)
                      + Iterator for sets. -

                      Subset operator.

                      -
                       set <= table = subset
                      -
                      +

                      Parameters:

                      +
                        +
                      • self +
                      • +
                      + -

                      See also:

                      -
                      - - std.set.__lt + + std.set:equal (s)
                      + Find whether two sets are equal. -

                      Proper subset operator.

                      -
                       set < table = proper subset
                      -
                      - +

                      Parameters:

                      +
                        +
                      • s + set +
                      • +
                      +

                      Returns:

                      +
                        + true if self and s are equal, false otherwise +
                      -

                      See also:

                      -
                      - - std.set.__mul + + std.set:insert (e)
                      + Insert an element into a set. -

                      Intersection operator.

                      -
                       set * table = intersection
                      -
                      - +

                      Parameters:

                      +
                        +
                      • e + element +
                      • +
                      +

                      Returns:

                      +
                        + the modified set +
                      -

                      See also:

                      -
                      - - std.set.__sub + + std.set:intersection (s)
                      + Find the intersection of two sets. -

                      Difference operator.

                      -
                       set - table = set difference
                      -
                      - +

                      Parameters:

                      +
                        +
                      • s + set +
                      • +
                      +

                      Returns:

                      +
                        + set intersection of self and s +
                      -

                      See also:

                      -
                      - - std.set.__totable + + std.set:member (e)
                      + Say whether an element is in a set. -

                      Object to table conversion.

                      -
                       table = set:totable ()
                      -
                      - +

                      Parameters:

                      +
                        +
                      • e + element +
                      • +
                      +

                      Returns:

                      +
                        + true if e is in set, false + otherwise +
                      - - std.set.delete (s, e) + + std.set:propersubset (s)
                      - Delete an element from a set. + Find whether one set is a proper subset of another.

                      Parameters:

                      • s set
                      • -
                      • e - element -

                      Returns:

                        - the modified set + true if self is a proper subset of s, false otherwise
                      @@ -323,26 +346,23 @@

                      Returns:

                      - - std.set.difference (s, t) + + std.set:subset (s)
                      - Find the difference of two sets. + Find whether one set is a subset of another.

                      Parameters:

                      • s set
                      • -
                      • t - set -

                      Returns:

                        - s with elements of t removed + true if self is a subset of s, false otherwise
                      @@ -350,26 +370,23 @@

                      Returns:

                      - - std.set.equal (s, t) + + std.set:symmetric_difference (s)
                      - Find whether two sets are equal. + Find the symmetric difference of two sets.

                      Parameters:

                      • s set
                      • -
                      • t - set -

                      Returns:

                        - true if sets are equal, false otherwise + elements of self and s that are in self or s but not both
                      @@ -377,205 +394,226 @@

                      Returns:

                      - - std.set.insert (s, e) + + std.set:union (s)
                      - Insert an element into a set. + Find the union of two sets.

                      Parameters:

                      • s - set -
                      • -
                      • e - element + set or set-like table

                      Returns:

                        - the modified set + set union of self and s
                      +
                      +

                      Metamethods

                      +
                      - - std.set.intersection (s, t) + + std.set:__add (set, table)
                      - Find the intersection of two sets. + +

                      Union operator.

                      +
                       set + table = union
                      +
                      +

                      Parameters:

                        -
                      • s +
                      • set set
                      • -
                      • t - set +
                      • table + set or set-like table
                      -

                      Returns:

                      -
                        - - set intersection of s and t -
                      +

                      See also:

                      +
                      - - std.set.member (s, e) + + std.set:__div (set, table)
                      - Say whether an element is in a set. + +

                      Symmetric difference operator.

                      +
                       set / table = symmetric difference
                      +
                      +

                      Parameters:

                        -
                      • s +
                      • set set
                      • -
                      • e - element +
                      • table + set or set-like table
                      -

                      Returns:

                      -
                        - - true if e is in set, false - otherwise -
                      +

                      See also:

                      +
                      - - std.set.propersubset (s, t) + + std.set:__le (set, table)
                      - Find whether one set is a proper subset of another. + +

                      Subset operator.

                      +
                       set <= table = subset
                      +
                      +

                      Parameters:

                        -
                      • s +
                      • set set
                      • -
                      • t - set +
                      • table + set or set-like table
                      -

                      Returns:

                      -
                        - - true if s is a proper subset of t, false otherwise -
                      +

                      See also:

                      +
                      - - std.set.subset (s, t) + + std.set:__lt (set, table)
                      - Find whether one set is a subset of another. + +

                      Proper subset operator.

                      +
                       set < table = proper subset
                      +
                      +

                      Parameters:

                        -
                      • s +
                      • set set
                      • -
                      • t - set +
                      • table + set or set-like table
                      -

                      Returns:

                      -
                        - - true if s is a subset of t, false otherwise -
                      +

                      See also:

                      +
                      - - std.set.symmetric_difference (s, t) + + std.set:__mul (set, table)
                      - Find the symmetric difference of two sets. + +

                      Intersection operator.

                      +
                       set * table = intersection
                      +
                      +

                      Parameters:

                        -
                      • s +
                      • set set
                      • -
                      • t - set +
                      • table + set or set-like table
                      -

                      Returns:

                      -
                        - - elements of s and t that are in s or t but not both -
                      +

                      See also:

                      +
                      - - std.set.union (s, t) + + std.set:__sub (set, table)
                      - Find the union of two sets. + +

                      Difference operator.

                      +
                       set - table = set difference
                      +
                      +

                      Parameters:

                        -
                      • s +
                      • set set
                      • -
                      • t +
                      • table set or set-like table
                      -

                      Returns:

                      -
                        - - set union of s and t -
                      +

                      See also:

                      +
                      - - std.set:elems (s) + + std.set:__totable (self)
                      - Iterator for sets. + +

                      Object to table conversion.

                      +
                       table = set:totable ()
                      +
                      +

                      Parameters:

                @@ -69,23 +70,26 @@

                Class std.strbuf

                -

                Methods

                +

                Methods

                - - + + - - + + +
                std.strbuf.__concatSupport concatenation of StrBuf objects.std.strbuf:concat (s)Add a string to a buffer.
                std.strbuf.__tostringSupport fast conversion to Lua string.std.strbuf:tostring (self)Convert a buffer to a string.
                +

                Metamethods

                + - - + + - - + +
                std.strbuf.concat (b, s)Add a string to a buffer.std.strbuf:__concat (buffer, str)Support concatenation of StrBuf objects.
                std.strbuf.tostring (b)Convert a buffer to a string.std.strbuf:__tostring (buffer)Support fast conversion to Lua string.
                @@ -93,99 +97,133 @@

                Methods


                -

                Methods

                - +

                Methods

                - - std.strbuf.__concat + + std.strbuf:concat (s)
                + Add a string to a buffer. -

                Support concatenation of StrBuf objects.

                -
                 buffer = buffer .. str
                -
                - +

                Parameters:

                +
                  +
                • s + string + string to add +
                • +
                +

                Returns:

                +
                  + std.strbuf + modified buffer +
                -

                See also:

                -
                - - std.strbuf.__tostring + + std.strbuf:tostring (self)
                + Convert a buffer to a string. -

                Support fast conversion to Lua string.

                -
                 str = tostring (buffer)
                -
                +

                Parameters:

                +
                  +
                • self +
                • +
                + +

                Returns:

                +
                  + + string + stringified self +
                -

                See also:

                -
                +
                +

                Metamethods

                +
                - - std.strbuf.concat (b, s) + + std.strbuf:__concat (buffer, str)
                - Add a string to a buffer. + +

                Support concatenation of StrBuf objects.

                +
                 buffer = buffer .. str
                +
                +

                Parameters:

                  -
                • b - buffer +
                • buffer + std.strbuf + StrBuf object
                • -
                • s - string to add +
                • str + string + a string or string-like object

                Returns:

                  - buffer + std.strbuf + modified buffer
                +

                See also:

                +
                - - std.strbuf.tostring (b) + + std.strbuf:__tostring (buffer)
                - Convert a buffer to a string. + +

                Support fast conversion to Lua string.

                +
                 str = tostring (buffer)
                +
                +

                Parameters:

                  -
                • b - buffer +
                • buffer + std.strbuf + Strbuf object

                Returns:

                  - string + string + concatenation of buffer contents
                +

                See also:

                +
                diff --git a/index.html b/index.html index df146e3..7db6534 100644 --- a/index.html +++ b/index.html @@ -32,16 +32,16 @@

                stdlib

                Modules

                Classes

                  diff --git a/modules/std.debug.html b/modules/std.debug.html index a0ba693..4eff7d0 100644 --- a/modules/std.debug.html +++ b/modules/std.debug.html @@ -40,16 +40,16 @@

                  Contents

                  Modules

                  Classes

                    diff --git a/modules/std.functional.html b/modules/std.functional.html index b9a39b0..e8dec33 100644 --- a/modules/std.functional.html +++ b/modules/std.functional.html @@ -40,16 +40,16 @@

                    Contents

                    Modules

                    Classes

                      diff --git a/modules/std.getopt.html b/modules/std.getopt.html index 1971e8a..a24afc2 100644 --- a/modules/std.getopt.html +++ b/modules/std.getopt.html @@ -39,16 +39,16 @@

                      Contents

                      Modules

                      Classes

                        @@ -161,7 +161,7 @@

                        Returns:

                        Simple getopt wrapper. - If the caller didn't supply their own already, -- adds --version/-V + If the caller didn't supply their own already, adds --version/-V and --help/-h options automatically; stops program if there was an error, or if --help or --version was used. diff --git a/modules/std.html b/modules/std.html index d0ae349..a5b9dea 100644 --- a/modules/std.html +++ b/modules/std.html @@ -40,16 +40,16 @@

                        Contents

                        Modules

                        Classes

                          diff --git a/modules/std.io.html b/modules/std.io.html index ffcf7b3..3aa4cb6 100644 --- a/modules/std.io.html +++ b/modules/std.io.html @@ -39,16 +39,16 @@

                          Contents

                          Modules

                          Classes

                            diff --git a/modules/std.math.html b/modules/std.math.html index a43c7a0..c33efea 100644 --- a/modules/std.math.html +++ b/modules/std.math.html @@ -39,16 +39,16 @@

                            Contents

                            Modules

                            Classes

                              diff --git a/modules/std.package.html b/modules/std.package.html index e5d775b..f980b4c 100644 --- a/modules/std.package.html +++ b/modules/std.package.html @@ -39,16 +39,16 @@

                              Contents

                              Modules

                              Classes

                                diff --git a/modules/std.strict.html b/modules/std.strict.html index a8f071f..2ac2295 100644 --- a/modules/std.strict.html +++ b/modules/std.strict.html @@ -32,23 +32,23 @@

                                stdlib

                                Contents

                                Modules

                                Classes

                                  @@ -70,14 +70,14 @@

                                  Module std.strict

                                  From Lua distribution (etc/strict.lua).

                                  -

                                  Metamethods

                                  +

                                  Functions

                                  - + - +
                                  __index__index () Detect derefrence of undeclared global.
                                  __newindex__newindex () Detect assignment to undeclared global.
                                  @@ -86,11 +86,11 @@

                                  Metamethods


                                  -

                                  Metamethods

                                  +

                                  Functions

                                  - __index + __index ()
                                  Detect derefrence of undeclared global. @@ -103,7 +103,7 @@

                                  Metamethods

                                  - __newindex + __newindex ()
                                  Detect assignment to undeclared global. diff --git a/modules/std.string.html b/modules/std.string.html index 209f71c..cd9b095 100644 --- a/modules/std.string.html +++ b/modules/std.string.html @@ -40,16 +40,16 @@

                                  Contents

                                  Modules

                                  Classes

                                  -
                                  -

                                  Metamethods

                                  -
                                  -
                                  - - __index -
                                  -
                                  - Tree __index metamethod. - -

                                  params:

                                  -
                                    -
                                  • i - non-table, or list of keys {i_1 ... i_n} -
                                  • -
                                  - - - - - -
                                  -
                                  - - __newindex -
                                  -
                                  - Tree __newindex metamethod.

                                  - -

                                  Sets tr[i_1]...[i_n] = v if i is a table, or tr[i] = v otherwise - -

                                  params:

                                  -
                                    -
                                  • i - non-table, or list of keys {i_1 ... i_n} -
                                  • -
                                  • v - value -
                                  • -
                                  - - - - -
                                  From 2d8f99d9384fbcba4e7283df81c1825fb47edadb Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Thu, 16 Jan 2014 10:43:40 +1300 Subject: [PATCH 05/15] gh-pages: update for release-v36. * classes/std.container.html: New file. * modules/std.tree.html: Move from here... * classes/std.tree.html: ...to here. * classes/std.list.html, classes/std.object.html, classes/std.set.html, classes/std.strbuf.html, classes/std.tree.html, index.html, modules/std.debug.html, modules/std.functional.html, modules/std.getopt.html, modules/std.html, modules/std.io.html, modules/std.math.html, modules/std.package.html, modules/std.strict.html, modules/std.string.html, modules/std.table.html: Update. Signed-off-by: Gary V. Vaughan --- classes/std.container.html | 278 ++++++++++++++++++++++ classes/std.list.html | 331 ++++++++++++++------------ classes/std.object.html | 307 +++++++++++------------- classes/std.set.html | 389 ++++++++++++++++++++---------- classes/std.strbuf.html | 121 +++++----- classes/std.tree.html | 461 ++++++++++++++++++++++++++++++++++++ index.html | 17 +- modules/std.debug.html | 7 +- modules/std.functional.html | 15 +- modules/std.getopt.html | 7 +- modules/std.html | 39 ++- modules/std.io.html | 13 +- modules/std.math.html | 5 +- modules/std.package.html | 4 +- modules/std.strict.html | 5 +- modules/std.string.html | 32 ++- modules/std.table.html | 18 +- modules/std.tree.html | 387 ------------------------------ 18 files changed, 1521 insertions(+), 915 deletions(-) create mode 100644 classes/std.container.html create mode 100644 classes/std.tree.html delete mode 100644 modules/std.tree.html diff --git a/classes/std.container.html b/classes/std.container.html new file mode 100644 index 0000000..8fdd62f --- /dev/null +++ b/classes/std.container.html @@ -0,0 +1,278 @@ + + + + + Reference + + + + +
                                  + +
                                  + +
                                  +
                                  +
                                  + + +
                                  + + + + + + +
                                  + +

                                  Class std.container

                                  +

                                  Container object.

                                  +

                                  A container is a std.object with no methods. It's functionality is + instead defined by its metamethods.

                                  + +

                                  Where an Object uses the __index metatable entry to hold object + methods, a Container stores its contents using __index, preventing + it from having methods in there too.

                                  + +

                                  Although there are no actual methods, Containers are free to use + metamethods (__index, __sub, etc) and, like Objects, can supply + module functions by listing them in _functions. Also, since a + std.container is a std.object, it can be passed to the + std.object module functions, or anywhere else a std.object is + expected.

                                  + +

                                  Container derived objects returned directly from a require statement + may also provide module functions, which can be called only from the + initial prototype object returned by require , but are not passed + on to derived objects during cloning:

                                  + +
                                    > Container = require "std.container"
                                  +  > x = Container {}
                                  +  > = Container.prototype (x)
                                  +  Object
                                  +  > = x.prototype (o)
                                  +  stdin:1: attempt to call field 'prototype' (a nil value)
                                  +  ...
                                  +
                                  + +

                                  To add functions like this to your own prototype objects, pass a table + of the module functions in the _functions private field before + cloning, and those functions will not be inherited by clones.

                                  + +
                                    > Container = require "std.container"
                                  +  > Graph = Container {
                                  +  >>   _type = "Graph",
                                  +  >>   _functions = {
                                  +  >>     nodes = function (graph)
                                  +  >>       local n = 0
                                  +  >>       for _ in pairs (graph) do n = n + 1 end
                                  +  >>       return n
                                  +  >>     end,
                                  +  >>   },
                                  +  >> }
                                  +  > g = Graph { "node1", "node2" }
                                  +  > = Graph.nodes (g)
                                  +  2
                                  +  > = g.nodes
                                  +  nil
                                  +
                                  + +

                                  When making your own prototypes, start from std.container if you + want to access the contents of your objects with the [] operator, or + std.object if you want to access the functionality of your objects + with named object methods.

                                  + + +

                                  Tables

                                  + + + + + +
                                  std.containerContainer prototype.
                                  +

                                  Metamethods

                                  + + + + + + + + + + + + + +
                                  std.container:__call (...)Return a clone of this container.
                                  std.container:__tostring ()Return a string representation of this container.
                                  std.container:__totable ()Return a table representation of this container.
                                  + +
                                  +
                                  + + +

                                  Tables

                                  +
                                  +
                                  + + std.container +
                                  +
                                  + Container prototype. + + +

                                  Fields:

                                  +
                                    +
                                  • _init + table or function + a table of field names, or + initialisation function, used by __call +
                                  • +
                                  • _functions + nil or table + a table of module functions not copied + by std.object.__call +
                                  • +
                                  • _type + string + type of Container, returned by + std.object.prototype + (default "Container") +
                                  • +
                                  + + + + + +
                                  +
                                  +

                                  Metamethods

                                  +
                                  +
                                  + + std.container:__call (...) +
                                  +
                                  + Return a clone of this container. + + +

                                  Parameters:

                                  +
                                    +
                                  • ... + arguments for _init +
                                  • +
                                  + +

                                  Returns:

                                  +
                                    + + std.container + a clone of the called container. +
                                  + + +

                                  See also:

                                  + + + +
                                  +
                                  + + std.container:__tostring () +
                                  +
                                  + Return a string representation of this container. + + + +

                                  Returns:

                                  +
                                    + + string + stringified container representation +
                                  + + +

                                  See also:

                                  + + + +
                                  +
                                  + + std.container:__totable () +
                                  +
                                  + Return a table representation of this container. + + + +

                                  Returns:

                                  +
                                    + + table + a shallow copy of non-private container fields +
                                  + + +

                                  See also:

                                  + + + +
                                  +
                                  + + +
                                  +
                                  +
                                  +generated by LDoc 1.4.0 +
                                  +
                                  + + diff --git a/classes/std.list.html b/classes/std.list.html index 8cdd8f9..561ad08 100644 --- a/classes/std.list.html +++ b/classes/std.list.html @@ -33,17 +33,19 @@

                                  stdlib

                                  Contents

                                  Classes

                                  Modules

          @@ -126,6 +127,25 @@

          Functions

          Zip a list of lists together with a function. +

          Metamethods

          + + + + + + + + + + + + + + + + + +
          std.list:__add (list, element)Append element to list.
          std.list:__concat (list, table)Concatenate lists.
          std.list:__le (list1, list2)List equality or order operator.
          std.list:__lt (list1, list2)List order operator.

          Methods

          @@ -197,25 +217,6 @@

          Methods

          Return a list with its first element removed.
          -

          Metamethods

          - - - - - - - - - - - - - - - - - -
          std.list:__add (list, element)Append element to list.
          std.list:__concat (list, table)Concatenate lists.
          std.list:__le (list1, list2)List equality or order operator.
          std.list:__lt (list1, list2)List order operator.


          @@ -230,6 +231,7 @@

          Functions

          Turn a list of pairs into a table. +

          Parameters:

          • ls @@ -260,6 +262,7 @@

            See also:

            Turn a table into a list of pairs. +

            Parameters:

            • t @@ -290,6 +293,7 @@

              See also:

              Make an index of a list of tables on a given field +

              Parameters:

              • l @@ -319,6 +323,7 @@

                Returns:

                Copy a list of tables, indexed on a given field +

                Parameters:

                • l @@ -348,6 +353,7 @@

                  Returns:

                  Map a function over a list of lists. +

                  Parameters:

                  • ls @@ -380,6 +386,7 @@

                    Returns:

                    This function in Lua is equivalent to zip and unzip in more strongly typed languages. +

                    Parameters:

                    • ls @@ -407,6 +414,7 @@

                      Returns:

                      Zip a list of lists together with a function. +

                      Parameters:

                      • ls @@ -434,6 +442,140 @@

                        Returns:

                        +
                      + +

                      Metamethods

                      +
                      +
                      + + std.list:__add (list, element) +
                      +
                      + +

                      Append element to list.

                      +
                       list = list + element
                      +
                      + + + +

                      Parameters:

                      +
                        +
                      • list + std.list + a list +
                      • +
                      • element + element to append +
                      • +
                      + + + +

                      See also:

                      + + + +
                      +
                      + + std.list:__concat (list, table) +
                      +
                      + +

                      Concatenate lists.

                      +
                       new = list .. table
                      +
                      + + + +

                      Parameters:

                      +
                        +
                      • list + std.list + a list +
                      • +
                      • table + table + another list, hash part is ignored +
                      • +
                      + + + +

                      See also:

                      + + + +
                      +
                      + + std.list:__le (list1, list2) +
                      +
                      + +

                      List equality or order operator.

                      +
                       min = list1 <= list2 and list1 or list2
                      +
                      + + + +

                      Parameters:

                      + + + + +

                      See also:

                      + + + +
                      +
                      + + std.list:__lt (list1, list2) +
                      +
                      + +

                      List order operator.

                      +
                       max = list1 > list2 and list1 or list2
                      +
                      + + + +

                      Parameters:

                      + + + + +

                      See also:

                      + + +

                      Methods

                      @@ -445,6 +587,7 @@

                      Methods

                      Append an item to a list. +

                      Parameters:

                      • x @@ -475,6 +618,7 @@

                        Returns:

                        +

                        Parameters:

                        • l @@ -501,6 +645,7 @@

                          Returns:

                          Concatenate arguments into a list. +

                          Parameters:

                          • ... @@ -527,6 +672,7 @@

                            Returns:

                            Prepend an item to a list. +

                            Parameters:

                            • x @@ -553,6 +699,7 @@

                              Returns:

                              An iterator over the elements of a list. +

                              Returns:

                              1. @@ -576,6 +723,7 @@

                                Returns:

                                Filter a list according to a predicate. +

                                Parameters:

                                • p @@ -602,6 +750,7 @@

                                  Returns:

                                  Flatten a list. +

                                  Parameters:

                                  • self @@ -629,6 +778,7 @@

                                    Returns:

                                    Fold a binary function through a list left associatively. +

                                    Parameters:

                                    • f @@ -657,6 +807,7 @@

                                      Returns:

                                      Fold a binary function through a list right associatively. +

                                      Parameters:

                                      • f @@ -685,6 +836,7 @@

                                        Returns:

                                        Map a function over a list. +

                                        Parameters:

                                        • f @@ -711,6 +863,7 @@

                                          Returns:

                                          Project a list of fields from a list of tables. +

                                          Parameters:

                                          • f @@ -736,6 +889,7 @@

                                            Returns:

                                            An iterator over the elements of a list, in reverse. +

                                            Parameters:

                                            • self @@ -768,6 +922,7 @@

                                              Returns:

                                              Repeat a list. +

                                              Parameters:

                                              • n @@ -794,6 +949,7 @@

                                                Returns:

                                                Reverse a list. +

                                                Parameters:

                                                • self @@ -833,6 +989,7 @@

                                                  Returns:

                                                  level is reached at which point add table items instead, using a counter to walk the flattened original list. +

                                                  Parameters:

                                                  • s @@ -860,6 +1017,7 @@

                                                    Returns:

                                                    (The equivalent of string.sub on strings; negative list indices count from the end of the list.) +

                                                    Parameters:

                                                    • from @@ -890,6 +1048,7 @@

                                                      Returns:

                                                      Return a list with its first element removed. +

                                                      Parameters:

                                                      • self @@ -909,136 +1068,6 @@

                                                        Returns:

                                                        -
                                                      - -

                                                      Metamethods

                                                      -
                                                      -
                                                      - - std.list:__add (list, element) -
                                                      -
                                                      - -

                                                      Append element to list.

                                                      -
                                                       list = list + element
                                                      -
                                                      - - -

                                                      Parameters:

                                                      -
                                                        -
                                                      • list - std.list - a list -
                                                      • -
                                                      • element - element to append -
                                                      • -
                                                      - - - -

                                                      See also:

                                                      - - - -
                                                      -
                                                      - - std.list:__concat (list, table) -
                                                      -
                                                      - -

                                                      Concatenate lists.

                                                      -
                                                       new = list .. table
                                                      -
                                                      - - -

                                                      Parameters:

                                                      -
                                                        -
                                                      • list - std.list - a list -
                                                      • -
                                                      • table - table - another list, hash part is ignored -
                                                      • -
                                                      - - - -

                                                      See also:

                                                      - - - -
                                                      -
                                                      - - std.list:__le (list1, list2) -
                                                      -
                                                      - -

                                                      List equality or order operator.

                                                      -
                                                       min = list1 <= list2 and list1 or list2
                                                      -
                                                      - - -

                                                      Parameters:

                                                      - - - - -

                                                      See also:

                                                      - - - -
                                                      -
                                                      - - std.list:__lt (list1, list2) -
                                                      -
                                                      - -

                                                      List order operator.

                                                      -
                                                       max = list1 > list2 and list1 or list2
                                                      -
                                                      - - -

                                                      Parameters:

                                                      - - - - -

                                                      See also:

                                                      - - -
                                                      diff --git a/classes/std.object.html b/classes/std.object.html index a0c44f1..82f840c 100644 --- a/classes/std.object.html +++ b/classes/std.object.html @@ -33,17 +33,19 @@

                                                      stdlib

                                                      Contents

                                                      Classes

                                                      Modules

                                                      @@ -66,27 +67,24 @@

                                                      Modules

                                                      Class std.object

                                                      Prototype-based objects.

                                                      -

                                                      - -

                                                      This module creates the root prototype object from which every other object is descended. There are no classes as such, rather new objects - are created by cloning an existing prototype object, and then changing - or adding to it. Further objects can then be made by cloning the changed + are created by cloning an existing object, and then changing or adding + to the clone. Further objects can then be made by cloning the changed object, and so on.

                                                      -

                                                      Objects are cloned by simply calling an existing object which then - serves as a prototype, from which the new object is copied.

                                                      +

                                                      Objects are cloned by simply calling an existing object, which then + serves as a prototype from which the new object is copied.

                                                      All valid objects contain a field _init, which determines the syntax required to execute the cloning process:

                                                      1. _init can be a list of keys; then the unnamed init_1 through - init_n values from the argument table are assigned to the + init_m values from the argument table are assigned to the corresponding keys in new_object;

                                                        -
                                                         new_object = prototype {
                                                        +
                                                         new_object = proto_object {
                                                            init_1, ..., init_m;
                                                            field_1 = value_1,
                                                            ...
                                                        @@ -96,67 +94,67 @@ 

                                                        Class std.object

                                                      2. Or it can be a function, in which the arguments passed to the prototype during cloning are simply handed to the _init function:

                                                        -
                                                        new_object = prototype (value, ...)
                                                        +
                                                        new_object = proto_object (arg, ...)
                                                         
                                                      -

                                                      Field names beginning with "_" are private, and moved into the object - metatable during cloning. Unless new_object changes the metatable this - way, then it will share a metatable with prototype for efficiency.

                                                      -

                                                      Objects, then, are essentially tables of field_n = value_n pairs:

                                                      -
                                                        -
                                                      • Access an object field: object.field
                                                      • -
                                                      • Call an object method: object:method (...)
                                                      • -
                                                      • Call a "class" method: Class.method (object, ...)
                                                      • -
                                                      • Add a field: object.field = x
                                                      • -
                                                      • Add a method: function object:method (...) ... end
                                                      • -
                                                      +
                                                        > o = Object {
                                                      +  >>  field_1 = "value_1",
                                                      +  >>  method_1 = function (self) return self.field_1 end,
                                                      +  >> }
                                                      +  > = o.field_1
                                                      +  value_1
                                                      +  > o.field_2 = 2
                                                      +  > function o:method_2 (n) return self.field_2 + n end
                                                      +  > = o:method_2 (2)
                                                      +  4
                                                      +
                                                      + +

                                                      Normally new_object automatically shares a metatable with + proto_object. However, field names beginning with "_" are private, + and moved into the object metatable during cloning. So, adding new + private fields to an object during cloning will result in a new + metatable for new_object that also contains a copy of all the entries + in the proto_object metatable.

                                                      -

                                                      +

                                                      Note that Object methods are stored in the __index field of their + metatable, and so cannot also use __index to lookup references with + square brackets. See std.container objects if you want to do that.

                                                      Tables

                                                      - - + +
                                                      std.object._metatableMetatable for objects.std.objectRoot object.
                                                      -

                                                      Methods

                                                      +

                                                      Metamethods

                                                      - - - - - - + + - - + + - - + +
                                                      std.object:clone (...)Clone an object.
                                                      std.object:tostring ()Return a stringified version of the contents of object.std.object:__call (...)Return a clone of this object, and its metatable.
                                                      std.object:totable (self)Return a new table with a shallow copy of all non-private fields - in object, where private fields have keys prefixed with "_".std.object:__tostring ()Return a string representation of this object.
                                                      std.object:type (o)Return the extended object type, if any, else primitive type.std.object:__totable ()Return a shallow copy of non-private object fields.
                                                      -

                                                      Metamethods

                                                      +

                                                      Methods

                                                      - - + + - - - - - - + +
                                                      std.object:__call (...)Return a clone of object.std.object:clone (o, ...)Clone this Object.
                                                      std.object:__tostring ()Return a string representation of object.
                                                      std.object:__totable ()Return a shallow copy of non-private object fields.std.object:prototype (x)Type of an object, or primitive.
                                                      @@ -167,56 +165,57 @@

                                                      Metamethods

                                                      Tables

                                                      - - std.object._metatable + + std.object
                                                      - Metatable for objects.

                                                      + Root object.

                                                      + +

                                                      Changing the values of these fields in a new object will change the + corresponding behaviour. -

                                                      This can't and shouldn't be set directly, because the Object class - manages it transparently during cloning.

                                                      Fields:

                                                        -
                                                      • _type - string - derived objects can override this for objects - intended to be a prototype for further specialised objects. -
                                                      • _init table or function - Derived objects can override this to be - a set of keys to use for assigning unnamed arguments, or a function - to that will be called with unnamed arguments durict cloning. + a table of field names, or + initialisation function, used by clone +
                                                      • +
                                                      • _functions + nil or table + a table of module functions not copied + by std.object.__call +
                                                      • +
                                                      • _type + string + type of Object, returned by prototype + (default "Object")
                                                      -

                                                      See also:

                                                      -
                                                      -

                                                      Methods

                                                      +

                                                      Metamethods

                                                      - - std.object:clone (...) + + std.object:__call (...)
                                                      - Clone an object.

                                                      + Return a clone of this object, and its metatable.

                                                      + +

                                                      Private fields are stored in the metatable. -

                                                      Objects are usually cloned by calling a prototype directly, so this - method is rarely used explicitly.

                                                      Parameters:

                                                      • ... - arguments for _init + arguments for _init
                                                      @@ -224,138 +223,96 @@

                                                      Returns:

                                                        std.object - a clone of prototype, adjusted - according to the rules above, and sharing a metatable where possible + a clone of the this object.

                                                      See also:

                                                      - - std.object:tostring () + + std.object:__tostring ()
                                                      - Return a stringified version of the contents of object.

                                                      + Return a string representation of this object.

                                                      -

                                                      First the object type, and then between { and } a list of the array - part of the object table (without numeric keys) followed by the - remaining key-value pairs.

                                                      +

                                                      First the object type, and then between { and } a list of the + array part of the object table (without numeric keys) followed + by the remaining key-value pairs.

                                                      This function doesn't recurse explicity, but relies upon suitable - __tostring metamethods in contained objects. + __tostring metamethods in field values. +

                                                      Returns:

                                                        string - stringified object representation + stringified container representation
                                                      +

                                                      See also:

                                                      +
                                                      - - std.object:totable (self) + + std.object:__totable ()
                                                      - Return a new table with a shallow copy of all non-private fields - in object, where private fields have keys prefixed with "_". - -

                                                      Parameters:

                                                      -
                                                        -
                                                      • self + Return a shallow copy of non-private object fields.

                                                        +

                                                        Used by clone to get the base contents of the new object. Can + be overridden in other objects for greater control of which fields + are considered non-private. -

                                                      • -

                                                      Returns:

                                                        table - raw (non-object) table of object fields + a shallow copy of non-private object fields
                                                      - - -
                                                      -
                                                      - - std.object:type (o) -
                                                      -
                                                      - -

                                                      Return the extended object type, if any, else primitive type.

                                                      - -

                                                      It's conventional to organise similar objects according to a string - valued _type field, which can then be queried using this function.

                                                      - -
                                                       Stack = Object {
                                                      -   _type = "Stack",
                                                      -
                                                      -   __tostring = function (self) ... end,
                                                      -
                                                      -   __index = {
                                                      -     push = function (self) ... end,
                                                      -     pop  = function (self) ... end,
                                                      -   },
                                                      - }
                                                      - stack = Stack {}
                                                      -
                                                      - stack:type () --> "Stack"
                                                      -
                                                      - - - -

                                                      Parameters:

                                                      +

                                                      See also:

                                                      -

                                                      Returns:

                                                      -
                                                        - - string - type of the object -
                                                      - - -
                                                      -

                                                      Metamethods

                                                      +

                                                      Methods

                                                      - - std.object:__call (...) + + std.object:clone (o, ...)
                                                      - Return a clone of object.

                                                      + Clone this Object. -

                                                      Normally a cloned object will share its metatable with its prototype, - unless some new fields for the cloned object begin with '_', in which - case they are merged into a copy of the prototype metatable to form - a new metatable for the cloned object (and its clones).

                                                      Parameters:

                                                        +
                                                      • o + std.object + an object +
                                                      • ... - arguments for _init + a list of arguments if o._init is a function, or a + single table if o._init is a table.
                                                      @@ -363,49 +320,63 @@

                                                      Returns:

                                                        std.object - a clone of the called object. + a clone of o
                                                      +

                                                      See also:

                                                      +
                                                      - - std.object:__tostring () + + std.object:prototype (x)
                                                      - Return a string representation of object. +

                                                      Type of an object, or primitive.

                                                      +

                                                      It's conventional to organise similar objects according to a + string valued _type field, which can then be queried using this + function.

                                                      +
                                                       Stack = Object {
                                                      +   _type = "Stack",
                                                       
                                                      -    

                                                      See also:

                                                      - - + __tostring = function (self) ... end, -
                                                      -
                                                      - - std.object:__totable () -
                                                      -
                                                      - Return a shallow copy of non-private object fields.

                                                      + __index = { + push = function (self) ... end, + pop = function (self) ... end, + }, + } + stack = Stack {} -

                                                      This pseudo-metamethod is used during object cloning to make the - intial new object table, and can be overridden in other objects - for greater control of which fields are considered non-private. + stack:prototype () --> "Stack" + -

                                                      See also:

                                                      +

                                                      Parameters:

                                                      +

                                                      Returns:

                                                      +
                                                        + + string + type of x +
                                                      + + +
                                                      diff --git a/classes/std.set.html b/classes/std.set.html index 542689a..b1b8754 100644 --- a/classes/std.set.html +++ b/classes/std.set.html @@ -32,17 +32,20 @@

                                                      stdlib

                                                      Contents

                                                      Classes

                                                      Modules

                                                      @@ -64,106 +66,116 @@

                                                      Modules

                                                      Class std.set

                                                      -

                                                      Set object.

                                                      -

                                                      +

                                                      Set container.

                                                      +

                                                      Derived from std.container, and inherits Container's metamethods.

                                                      -

                                                      +

                                                      Note that Functions listed below are available only available from the + Set prototype returned by requiring this module, because Container + objects cannot have object methods.

                                                      -

                                                      Methods

                                                      +

                                                      Functions

                                                      - + - + - + - + - + - + - + - + - + - + - +
                                                      std.set:delete (e)std.set.delete (set, e) Delete an element from a set.
                                                      std.set:difference (s)std.set.difference (set1, set2) Find the difference of two sets.
                                                      std.set:elems (self)std.set.elems (set) Iterator for sets.
                                                      std.set:equal (s)std.set.equal (set1, set2) Find whether two sets are equal.
                                                      std.set:insert (e)std.set.insert (set, e) Insert an element into a set.
                                                      std.set:intersection (s)std.set.intersection (set1, set2) Find the intersection of two sets.
                                                      std.set:member (e)std.set.member (set, e) Say whether an element is in a set.
                                                      std.set:propersubset (s)std.set.proper_subset (set1, set2) Find whether one set is a proper subset of another.
                                                      std.set:subset (s)std.set.subset (set1, set2) Find whether one set is a subset of another.
                                                      std.set:symmetric_difference (s)std.set.symmetric_difference (set1, set2) Find the symmetric difference of two sets.
                                                      std.set:union (s)std.set.union (set1, set2) Find the union of two sets.
                                                      +

                                                      Tables

                                                      + + + + + +
                                                      std.setSet prototype object.

                                                      Metamethods

                                                      - + - + - + - + - + - + - - - -
                                                      std.set:__add (set, table)std.set.__add (set, table) Union operator.
                                                      std.set:__div (set, table)std.set.__div (set, table) Symmetric difference operator.
                                                      std.set:__le (set, table)std.set.__le (set, table) Subset operator.
                                                      std.set:__lt (set, table)std.set.__lt (set, table) Proper subset operator.
                                                      std.set:__mul (set, table)std.set.__mul (set, table) Intersection operator.
                                                      std.set:__sub (set, table)std.set.__sub (set, table) Difference operator.
                                                      std.set:__totable (self)Object to table conversion.


                                                      -

                                                      Methods

                                                      +

                                                      Functions

                                                      - - std.set:delete (e) + + std.set.delete (set, e)
                                                      Delete an element from a set. +

                                                      Parameters:

                                                        +
                                                      • set + set + a set +
                                                      • e element
                                                      • @@ -180,23 +192,29 @@

                                                        Returns:

                                                      - - std.set:difference (s) + + std.set.difference (set1, set2)
                                                      Find the difference of two sets. +

                                                      Parameters:

                                                        -
                                                      • s - set +
                                                      • set1 + set + a set +
                                                      • +
                                                      • set2 + table or set + another set, or table

                                                      Returns:

                                                        - self with elements of s removed + set1 with elements of s removed
                                                      @@ -204,18 +222,18 @@

                                                      Returns:

                                                      - - std.set:elems (self) + + std.set.elems (set)
                                                      Iterator for sets. +

                                                      Parameters:

                                                        -
                                                      • self - - - +
                                                      • set + set + a set
                                                      @@ -225,23 +243,29 @@

                                                      Parameters:

                                                      - - std.set:equal (s) + + std.set.equal (set1, set2)
                                                      Find whether two sets are equal. +

                                                      Parameters:

                                                        -
                                                      • s - set +
                                                      • set1 + set + a set +
                                                      • +
                                                      • set2 + table or set + another set, or table

                                                      Returns:

                                                        - true if self and s are equal, false otherwise + true if set1 and set2 are equal, false otherwise
                                                      @@ -249,14 +273,19 @@

                                                      Returns:

                                                      - - std.set:insert (e) + + std.set.insert (set, e)
                                                      Insert an element into a set. +

                                                      Parameters:

                                                        +
                                                      • set + set + a set +
                                                      • e element
                                                      • @@ -273,23 +302,29 @@

                                                        Returns:

                                                      - - std.set:intersection (s) + + std.set.intersection (set1, set2)
                                                      Find the intersection of two sets. +

                                                      Parameters:

                                                        -
                                                      • s - set +
                                                      • set1 + set + a set +
                                                      • +
                                                      • set2 + table or set + another set, or table

                                                      Returns:

                                                        - set intersection of self and s + set intersection of set1 and set2
                                                      @@ -297,14 +332,19 @@

                                                      Returns:

                                                      - - std.set:member (e) + + std.set.member (set, e)
                                                      Say whether an element is in a set. +

                                                      Parameters:

                                                        +
                                                      • set + set + a set +
                                                      • e element
                                                      • @@ -313,7 +353,7 @@

                                                        Parameters:

                                                        Returns:

                                                          - true if e is in set, false + true if e is in set , otherwise false otherwise
                                                        @@ -322,23 +362,29 @@

                                                        Returns:

                                                      - - std.set:propersubset (s) + + std.set.proper_subset (set1, set2)
                                                      Find whether one set is a proper subset of another. +

                                                      Parameters:

                                                        -
                                                      • s - set +
                                                      • set1 + set + a set +
                                                      • +
                                                      • set2 + table or set + another set, or table

                                                      Returns:

                                                        - true if self is a proper subset of s, false otherwise + true if set1 is a proper subset of set2, false otherwise
                                                      @@ -346,23 +392,29 @@

                                                      Returns:

                                                      - - std.set:subset (s) + + std.set.subset (set1, set2)
                                                      Find whether one set is a subset of another. +

                                                      Parameters:

                                                        -
                                                      • s - set +
                                                      • set1 + set + a set +
                                                      • +
                                                      • set2 + table or set + another set, or table

                                                      Returns:

                                                        - true if self is a subset of s, false otherwise + true if set1 is a subset of set2, false otherwise
                                                      @@ -370,23 +422,29 @@

                                                      Returns:

                                                      - - std.set:symmetric_difference (s) + + std.set.symmetric_difference (set1, set2)
                                                      Find the symmetric difference of two sets. +

                                                      Parameters:

                                                        -
                                                      • s - set +
                                                      • set1 + set + a set +
                                                      • +
                                                      • set2 + table or set + another set, or table

                                                      Returns:

                                                        - elements of self and s that are in self or s but not both + elements of set1 and set2 that are in set1 or set2 but not both
                                                      @@ -394,23 +452,29 @@

                                                      Returns:

                                                      - - std.set:union (s) + + std.set.union (set1, set2)
                                                      Find the union of two sets. +

                                                      Parameters:

                                                        -
                                                      • s - set or set-like table +
                                                      • set1 + set + a set +
                                                      • +
                                                      • set2 + table or set + another set, or table

                                                      Returns:

                                                        - set union of self and s + set union of set1 and set2
                                                      @@ -418,210 +482,275 @@

                                                      Returns:

                                                      -

                                                      Metamethods

                                                      +

                                                      Tables

                                                      - - std.set:__add (set, table) + + std.set
                                                      - -

                                                      Union operator.

                                                      -
                                                       set + table = union
                                                      -
                                                      + Set prototype object. -

                                                      Parameters:

                                                      +

                                                      Fields:

                                                      -

                                                      See also:

                                                      -
                                                      +
                                                      +

                                                      Metamethods

                                                      +
                                                      - - std.set:__div (set, table) + + std.set.__add (set, table)
                                                      -

                                                      Symmetric difference operator.

                                                      -
                                                       set / table = symmetric difference
                                                      +

                                                      Union operator.

                                                      +
                                                       union = set + table
                                                       
                                                      +

                                                      Parameters:

                                                      • set + set set
                                                      • table - set or set-like table + table or set + another set or table
                                                      +

                                                      Returns:

                                                      +
                                                        + + set + union +

                                                      See also:

                                                      - - std.set:__le (set, table) + + std.set.__div (set, table)
                                                      -

                                                      Subset operator.

                                                      -
                                                       set <= table = subset
                                                      +

                                                      Symmetric difference operator.

                                                      +
                                                       symmetric_difference = set / table
                                                       
                                                      +

                                                      Parameters:

                                                      • set + set set
                                                      • table - set or set-like table + table or set + another set or table
                                                      +

                                                      Returns:

                                                      +
                                                        + + set + symmetric_difference +

                                                      See also:

                                                      - - std.set:__lt (set, table) + + std.set.__le (set, table)
                                                      -

                                                      Proper subset operator.

                                                      -
                                                       set < table = proper subset
                                                      +

                                                      Subset operator.

                                                      +
                                                       set = set <= table
                                                       
                                                      +

                                                      Parameters:

                                                      • set + set set
                                                      • table - set or set-like table + table or set + another set or table
                                                      +

                                                      Returns:

                                                      +
                                                        + + set + subset +

                                                      See also:

                                                      - - std.set:__mul (set, table) + + std.set.__lt (set, table)
                                                      -

                                                      Intersection operator.

                                                      -
                                                       set * table = intersection
                                                      +

                                                      Proper subset operator.

                                                      +
                                                       proper_subset = set < table
                                                       
                                                      +

                                                      Parameters:

                                                      • set + set set
                                                      • table - set or set-like table + table or set + another set or table
                                                      +

                                                      Returns:

                                                      +
                                                        + + set + proper_subset +

                                                      See also:

                                                      - - std.set:__sub (set, table) + + std.set.__mul (set, table)
                                                      -

                                                      Difference operator.

                                                      -
                                                       set - table = set difference
                                                      +

                                                      Intersection operator.

                                                      +
                                                       intersection = set * table
                                                       
                                                      +

                                                      Parameters:

                                                      • set + set set
                                                      • table - set or set-like table + table or set + another set or table
                                                      +

                                                      Returns:

                                                      +
                                                        + + set + intersection +

                                                      See also:

                                                      - - std.set:__totable (self) + + std.set.__sub (set, table)
                                                      -

                                                      Object to table conversion.

                                                      -
                                                       table = set:totable ()
                                                      +

                                                      Difference operator.

                                                      +
                                                       difference = set - table
                                                       
                                                      +

                                                      Parameters:

                                                        -
                                                      • self - - - +
                                                      • set + set + set +
                                                      • +
                                                      • table + table or set + another set or table
                                                      +

                                                      Returns:

                                                      +
                                                        + + set + difference +
                                                      +

                                                      See also:

                                                      +
                                                      diff --git a/classes/std.strbuf.html b/classes/std.strbuf.html index 3c15378..a5ec6be 100644 --- a/classes/std.strbuf.html +++ b/classes/std.strbuf.html @@ -32,17 +32,19 @@

                                                      stdlib

                                                      Contents

                                                      Classes

                                                      Modules

                                                      @@ -70,26 +71,26 @@

                                                      Class std.strbuf

                                                      -

                                                      Methods

                                                      +

                                                      Metamethods

                                                      - - + + - - + +
                                                      std.strbuf:concat (s)Add a string to a buffer.std.strbuf:__concat (buffer, str)Support concatenation of StrBuf objects.
                                                      std.strbuf:tostring (self)Convert a buffer to a string.std.strbuf:__tostring (buffer)Support fast conversion to Lua string.
                                                      -

                                                      Metamethods

                                                      +

                                                      Methods

                                                      - - + + - - + +
                                                      std.strbuf:__concat (buffer, str)Support concatenation of StrBuf objects.std.strbuf:concat (s)Add a string to a buffer.
                                                      std.strbuf:__tostring (buffer)Support fast conversion to Lua string.std.strbuf:tostring (self)Convert a buffer to a string.
                                                      @@ -97,20 +98,29 @@

                                                      Metamethods


                                                      -

                                                      Methods

                                                      +

                                                      Metamethods

                                                      - - std.strbuf:concat (s) + + std.strbuf:__concat (buffer, str)
                                                      - Add a string to a buffer. + +

                                                      Support concatenation of StrBuf objects.

                                                      +
                                                       buffer = buffer .. str
                                                      +
                                                      + +

                                                      Parameters:

                                                        -
                                                      • s +
                                                      • buffer + std.strbuf + StrBuf object +
                                                      • +
                                                      • str string - string to add + a string or string-like object
                                                      @@ -118,26 +128,34 @@

                                                      Returns:

                                                        std.strbuf - modified buffer + modified buffer
                                                      +

                                                      See also:

                                                      +
                                                      - - std.strbuf:tostring (self) + + std.strbuf:__tostring (buffer)
                                                      - Convert a buffer to a string. -

                                                      Parameters:

                                                      -
                                                        -
                                                      • self +

                                                        Support fast conversion to Lua string.

                                                        +
                                                         str = tostring (buffer)
                                                        +
                                                        +

                                                        Parameters:

                                                        + @@ -145,36 +163,33 @@

                                                        Returns:

                                                          string - stringified self + concatenation of buffer contents
                                                        +

                                                        See also:

                                                        +
                                                      -

                                                      Metamethods

                                                      +

                                                      Methods

                                                      - - std.strbuf:__concat (buffer, str) + + std.strbuf:concat (s)
                                                      - -

                                                      Support concatenation of StrBuf objects.

                                                      -
                                                       buffer = buffer .. str
                                                      -
                                                      + Add a string to a buffer.

                                                      Parameters:

                                                        -
                                                      • buffer - std.strbuf - StrBuf object -
                                                      • -
                                                      • str +
                                                      • s string - a string or string-like object + string to add
                                                      @@ -182,33 +197,27 @@

                                                      Returns:

                                                        std.strbuf - modified buffer + modified buffer
                                                      -

                                                      See also:

                                                      -
                                                      - - std.strbuf:__tostring (buffer) + + std.strbuf:tostring (self)
                                                      - -

                                                      Support fast conversion to Lua string.

                                                      -
                                                       str = tostring (buffer)
                                                      -
                                                      + Convert a buffer to a string.

                                                      Parameters:

                                                        -
                                                      • buffer - std.strbuf - Strbuf object +
                                                      • self + + +
                                                      @@ -216,14 +225,10 @@

                                                      Returns:

                                                        string - concatenation of buffer contents + stringified self
                                                      -

                                                      See also:

                                                      -
                                                      diff --git a/classes/std.tree.html b/classes/std.tree.html new file mode 100644 index 0000000..261ecad --- /dev/null +++ b/classes/std.tree.html @@ -0,0 +1,461 @@ + + + + + Reference + + + + +
                                                      + +
                                                      + +
                                                      +
                                                      +
                                                      + + +
                                                      + + + + + + +
                                                      + +

                                                      Class std.tree

                                                      +

                                                      Tree container.

                                                      +

                                                      Derived from std.container, and inherits Container's metamethods.

                                                      + +

                                                      Note that Functions listed below are only available from the Tree + prototype return by requiring this module, because Container objects + cannot have object methods.

                                                      + + +

                                                      Functions

                                                      + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                      std.tree.clone (t, nometa)Make a deep copy of a tree, including any metatables.
                                                      std.tree.ileaves (tr)Tree iterator which returns just numbered leaves, in order.
                                                      std.tree.inodes (tr)Tree iterator over numbered nodes, in order.
                                                      std.tree.leaves (tr)Tree iterator which returns just leaves.
                                                      std.tree.merge (t, u)Destructively deep-merge one tree into another.
                                                      std.tree.nodes (tr)Tree iterator over all nodes.
                                                      +

                                                      Tables

                                                      + + + + + +
                                                      std.treeTree prototype object.
                                                      +

                                                      Metamethods

                                                      + + + + + + + + + +
                                                      std.tree:__index (i)Tree __index metamethod.
                                                      std.tree:__newindex (i, v)Tree __newindex metamethod.
                                                      + +
                                                      +
                                                      + + +

                                                      Functions

                                                      +
                                                      +
                                                      + + std.tree.clone (t, nometa) +
                                                      +
                                                      + Make a deep copy of a tree, including any metatables.

                                                      + +

                                                      To make fast shallow copies, use std.table.clone. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • t + table or tree + table or tree to be cloned +
                                                      • +
                                                      • nometa + boolean + if non-nil don't copy metatables +
                                                      • +
                                                      + +

                                                      Returns:

                                                      +
                                                        + + table or tree + a deep copy of t +
                                                      + + + + +
                                                      +
                                                      + + std.tree.ileaves (tr) +
                                                      +
                                                      + Tree iterator which returns just numbered leaves, in order. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • tr + tree or table + tree or tree-like table +
                                                      • +
                                                      + +

                                                      Returns:

                                                      +
                                                        +
                                                      1. + function + iterator function
                                                      2. +
                                                      3. + tree or table + the tree tr
                                                      4. +
                                                      + + + + +
                                                      +
                                                      + + std.tree.inodes (tr) +
                                                      +
                                                      + Tree iterator over numbered nodes, in order.

                                                      + +

                                                      The iterator function behaves like nodes, but only traverses the + array part of the nodes of tr, ignoring any others. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • tr + tree or table + tree to iterate over +
                                                      • +
                                                      + +

                                                      Returns:

                                                      +
                                                        +
                                                      1. + function + iterator function
                                                      2. +
                                                      3. + tree or table + the tree, tr
                                                      4. +
                                                      + + +

                                                      See also:

                                                      + + + +
                                                      +
                                                      + + std.tree.leaves (tr) +
                                                      +
                                                      + Tree iterator which returns just leaves. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • tr + tree or table + tree or tree-like table +
                                                      • +
                                                      + +

                                                      Returns:

                                                      +
                                                        +
                                                      1. + function + iterator function
                                                      2. +
                                                      3. + tree or table + the tree, tr
                                                      4. +
                                                      + + + + +
                                                      +
                                                      + + std.tree.merge (t, u) +
                                                      +
                                                      + Destructively deep-merge one tree into another. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • t + tree or table + destination tree or table +
                                                      • +
                                                      • u + tree or table + tree or table with nodes to merge +
                                                      • +
                                                      + +

                                                      Returns:

                                                      +
                                                        + + tree or table + t with nodes from u merged in +
                                                      + + +

                                                      See also:

                                                      + + + +
                                                      +
                                                      + + std.tree.nodes (tr) +
                                                      +
                                                      + Tree iterator over all nodes.

                                                      + +

                                                      The returned iterator function performs a depth-first traversal of + tr, and at each node it returns {node-type, tree-path, tree-node} + where node-type is branch, join or leaf; tree-path is a + list of keys used to reach this node, and tree-node is the current + node.

                                                      + +

                                                      Given a tree to represent:

                                                      + +
                                                       + root
                                                      +    +-- node1
                                                      +    |    +-- leaf1
                                                      +    |    '-- leaf2
                                                      +    '-- leaf 3
                                                      +
                                                      + tree = std.tree { std.tree { "leaf1", "leaf2"}, "leaf3" }
                                                      +
                                                      + +

                                                      A series of calls to tree.nodes will return:

                                                      + +
                                                       "branch", {},    {{"leaf1", "leaf2"}, "leaf3"}
                                                      + "branch", {1},   {"leaf1", "leaf"2")
                                                      + "leaf",   {1,1}, "leaf1"
                                                      + "leaf",   {1,2}, "leaf2"
                                                      + "join",   {1},   {"leaf1", "leaf2"}
                                                      + "leaf",   {2},   "leaf3"
                                                      + "join",   {},    {{"leaf1", "leaf2"}, "leaf3"}
                                                      +
                                                      + +

                                                      Note that the tree-path reuses the same table on each iteration, so + you must table.clone a copy if you want to take a snap-shot of the + current state of the tree-path list before the next iteration + changes it. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • tr + tree or table + tree or tree-like table to iterate over +
                                                      • +
                                                      + +

                                                      Returns:

                                                      +
                                                        +
                                                      1. + function + iterator function
                                                      2. +
                                                      3. + tree or table + the tree, tr
                                                      4. +
                                                      + + +

                                                      See also:

                                                      + + + +
                                                      +
                                                      +

                                                      Tables

                                                      +
                                                      +
                                                      + + std.tree +
                                                      +
                                                      + Tree prototype object. + + +

                                                      Fields:

                                                      + + + + + + +
                                                      +
                                                      +

                                                      Metamethods

                                                      +
                                                      +
                                                      + + std.tree:__index (i) +
                                                      +
                                                      + Tree __index metamethod. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • i + non-table, or list of keys {i_1 ... i_n} +
                                                      • +
                                                      + +

                                                      Returns:

                                                      +
                                                        + + self[i]...[i_n] if i is a table, or self[i] otherwise +
                                                      + + + + +
                                                      +
                                                      + + std.tree:__newindex (i, v) +
                                                      +
                                                      + Tree __newindex metamethod.

                                                      + +

                                                      Sets self[i_1]...[i_n] = v if i is a table, or self[i] = v otherwise + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • i + non-table, or list of keys {i_1 ... i_n} +
                                                      • +
                                                      • v + value +
                                                      • +
                                                      + + + + + +
                                                      +
                                                      + + +
                                                      +
                                                      +
                                                      +generated by LDoc 1.4.0 +
                                                      +
                                                      + + diff --git a/index.html b/index.html index 7db6534..954c2bd 100644 --- a/index.html +++ b/index.html @@ -41,10 +41,11 @@

                                                      Modules

                                                    • std.strict
                                                    • std.string
                                                    • std.table
                                                    • -
                                                    • std.tree

                                                    Classes

                                                      +
                                                    • std.tree
                                                    • +
                                                    • std.container
                                                    • std.object
                                                    • std.list
                                                    • std.set
                                                    • @@ -100,13 +101,17 @@

                                                      Modules

                                                      std.table Extensions to the table module. - - std.tree - Tables as trees. -

                                                      Classes

                                                      + + + + + + + + @@ -117,7 +122,7 @@

                                                      Classes

                                                      - + diff --git a/modules/std.debug.html b/modules/std.debug.html index 4eff7d0..e919d11 100644 --- a/modules/std.debug.html +++ b/modules/std.debug.html @@ -49,10 +49,11 @@

                                                      Modules

                                                    • std.strict
                                                    • std.string
                                                    • std.table
                                                    • -
                                                    • std.tree
                                                    • Classes

                                                        +
                                                      • std.tree
                                                      • +
                                                      • std.container
                                                      • std.object
                                                      • std.list
                                                      • std.set
                                                      • @@ -110,6 +111,7 @@

                                                        Functions

                                                        +

                                                        See also:

                                                          say @@ -124,6 +126,7 @@

                                                          See also:

                                                          Print a debugging message. +

                                                          Parameters:

                                                          • n @@ -149,6 +152,7 @@

                                                            Parameters:

                                                            when _DEBUG.call is set. Based on test/trace-calls.lua from the Lua distribution. +

                                                            Parameters:

                                                            • event @@ -172,6 +176,7 @@

                                                              Tables

                                                              To activate debugging set _DEBUG either to any true value (equivalent to {level = 1}), or as documented below. +

                                                              Fields:

                                                              • level diff --git a/modules/std.functional.html b/modules/std.functional.html index e8dec33..c3bf40b 100644 --- a/modules/std.functional.html +++ b/modules/std.functional.html @@ -49,10 +49,11 @@

                                                                Modules

                                                              • std.strict
                                                              • std.string
                                                              • std.table
                                                              • -
                                                              • std.tree

                                                              Classes

                                                                +
                                                              • std.tree
                                                              • +
                                                              • std.container
                                                              • std.object
                                                              • std.list
                                                              • std.set
                                                              • @@ -138,6 +139,7 @@

                                                                Functions

                                                                Partially apply a function. +

                                                                Parameters:

                                                                • f @@ -165,6 +167,7 @@

                                                                  Returns:

                                                                  Collect the results of an iterator. +

                                                                  Parameters:

                                                                  • i @@ -190,6 +193,7 @@

                                                                    Returns:

                                                                    Compose functions. +

                                                                    Returns:

                                                                      @@ -207,6 +211,7 @@

                                                                      Returns:

                                                                      Curry a function. +

                                                                      Parameters:

                                                                      • f @@ -234,6 +239,7 @@

                                                                        Returns:

                                                                        Evaluate a string. +

                                                                        Parameters:

                                                                        • s @@ -258,6 +264,7 @@

                                                                          Returns:

                                                                          Filter an iterator with a predicate. +

                                                                          Parameters:

                                                                          • p @@ -285,6 +292,7 @@

                                                                            Returns:

                                                                            Fold a binary function into an iterator. +

                                                                            Parameters:

                                                                            • f @@ -315,6 +323,7 @@

                                                                              Returns:

                                                                              Identity function. +

                                                                              Parameters:

                                                                              • ... @@ -341,6 +350,7 @@

                                                                                Returns:

                                                                                Map a function over an iterator. +

                                                                                Parameters:

                                                                                • f @@ -368,6 +378,7 @@

                                                                                  Returns:

                                                                                  Memoize a function, by wrapping it in a functable. +

                                                                                  Parameters:

                                                                                  • fn @@ -392,6 +403,7 @@

                                                                                    Returns:

                                                                                    Return given metamethod, if any, or nil. +

                                                                                    Parameters:

                                                                                    • x @@ -424,6 +436,7 @@

                                                                                      Tables

                                                                                      Functional forms of infix operators. Defined here so that other modules can write to it. +

                                                                                      Fields:

                                                                                      • dereference diff --git a/modules/std.getopt.html b/modules/std.getopt.html index a24afc2..5a915a0 100644 --- a/modules/std.getopt.html +++ b/modules/std.getopt.html @@ -48,10 +48,11 @@

                                                                                        Modules

                                                                                      • std.strict
                                                                                      • std.string
                                                                                      • std.table
                                                                                      • -
                                                                                      • std.tree

                                                                                      Classes

                                                                                        +
                                                                                      • std.tree
                                                                                      • +
                                                                                      • std.container
                                                                                      • std.object
                                                                                      • std.list
                                                                                      • std.set
                                                                                      • @@ -128,6 +129,7 @@

                                                                                        Functions

                                                                                        Perform argument processing +

                                                                                        Parameters:

                                                                                        • argIn @@ -166,6 +168,7 @@

                                                                                          Returns:

                                                                                          stops program if there was an error, or if --help or --version was used. +

                                                                                          Parameters:

                                                                                          • prog @@ -188,6 +191,7 @@

                                                                                            Parameters:

                                                                                            Emit a usage message. +

                                                                                            Parameters:

                                                                                            • prog @@ -207,6 +211,7 @@

                                                                                              Parameters:

                                                                                              Produce usage info for the given options. +

                                                                                              Parameters:

                                                                                              • header diff --git a/modules/std.html b/modules/std.html index a5b9dea..1ab8ea2 100644 --- a/modules/std.html +++ b/modules/std.html @@ -49,10 +49,11 @@

                                                                                                Modules

                                                                                              • std.strict
                                                                                              • std.string
                                                                                              • std.table
                                                                                              • -
                                                                                              • std.tree

                                                                                              Classes

                                                                                                +
                                                                                              • std.tree
                                                                                              • +
                                                                                              • std.container
                                                                                              • std.object
                                                                                              • std.list
                                                                                              • std.set
                                                                                              • @@ -210,6 +211,7 @@

                                                                                                Functions

                                                                                                +

                                                                                                See also:

                                                                                                  std.string.assert @@ -227,6 +229,7 @@

                                                                                                  See also:

                                                                                                  +

                                                                                                  See also:

                                                                                                    std.functional.bind @@ -244,6 +247,7 @@

                                                                                                    See also:

                                                                                                    +

                                                                                                    See also:

                                                                                                      std.functional.collect @@ -261,6 +265,7 @@

                                                                                                      See also:

                                                                                                      +

                                                                                                      See also:

                                                                                                        std.functional.compose @@ -278,6 +283,7 @@

                                                                                                        See also:

                                                                                                        +

                                                                                                        See also:

                                                                                                          std.functional.curry @@ -295,6 +301,7 @@

                                                                                                          See also:

                                                                                                          +

                                                                                                          See also:

                                                                                                            std.io.die @@ -312,6 +319,7 @@

                                                                                                            See also:

                                                                                                            +

                                                                                                            See also:

                                                                                                              std.functional.eval @@ -329,6 +337,7 @@

                                                                                                              See also:

                                                                                                              +

                                                                                                              See also:

                                                                                                                std.functional.filter @@ -346,6 +355,7 @@

                                                                                                                See also:

                                                                                                                +

                                                                                                                See also:

                                                                                                                  std.functional.fold @@ -363,6 +373,7 @@

                                                                                                                  See also:

                                                                                                                  +

                                                                                                                  See also:

                                                                                                                    std.functional.id @@ -380,9 +391,10 @@

                                                                                                                    See also:

                                                                                                                    +

                                                                                                                    See also:

                                                                                                                    @@ -397,9 +409,10 @@

                                                                                                                    See also:

                                                                                                                    +

                                                                                                                    See also:

                                                                                                                    @@ -414,9 +427,10 @@

                                                                                                                    See also:

                                                                                                                    +

                                                                                                                    See also:

                                                                                                                    @@ -431,6 +445,7 @@

                                                                                                                    See also:

                                                                                                                    +

                                                                                                                    See also:

                                                                                                                      std.functional.map @@ -448,6 +463,7 @@

                                                                                                                      See also:

                                                                                                                      +

                                                                                                                      See also:

                                                                                                                        std.functional.memoize @@ -465,6 +481,7 @@

                                                                                                                        See also:

                                                                                                                        +

                                                                                                                        See also:

                                                                                                                          std.functional.metamethod @@ -482,9 +499,10 @@

                                                                                                                          See also:

                                                                                                                          +

                                                                                                                          See also:

                                                                                                                          @@ -499,6 +517,7 @@

                                                                                                                          See also:

                                                                                                                          +

                                                                                                                          See also:

                                                                                                                            std.table.pack @@ -516,6 +535,7 @@

                                                                                                                            See also:

                                                                                                                            +

                                                                                                                            See also:

                                                                                                                              std.string.pickle @@ -533,6 +553,7 @@

                                                                                                                              See also:

                                                                                                                              +

                                                                                                                              See also:

                                                                                                                                std.string.prettytostring @@ -550,6 +571,7 @@

                                                                                                                                See also:

                                                                                                                                +

                                                                                                                                See also:

                                                                                                                                  std.string.render @@ -567,6 +589,7 @@

                                                                                                                                  See also:

                                                                                                                                  +

                                                                                                                                  See also:

                                                                                                                                    std.string.require_version @@ -584,6 +607,7 @@

                                                                                                                                    See also:

                                                                                                                                    +

                                                                                                                                    See also:

                                                                                                                                      std.table.ripairs @@ -601,6 +625,7 @@

                                                                                                                                      See also:

                                                                                                                                      +

                                                                                                                                      See also:

                                                                                                                                        std.string.tostring @@ -618,6 +643,7 @@

                                                                                                                                        See also:

                                                                                                                                        +

                                                                                                                                        See also:

                                                                                                                                          std.table.totable @@ -635,6 +661,7 @@

                                                                                                                                          See also:

                                                                                                                                          +

                                                                                                                                          See also:

                                                                                                                                            std.io.warn @@ -655,6 +682,7 @@

                                                                                                                                            Tables

                                                                                                                                            +

                                                                                                                                            See also:

                                                                                                                                              std.functional.op @@ -669,6 +697,7 @@

                                                                                                                                              See also:

                                                                                                                                              Module table. +

                                                                                                                                              Fields:

                                                                                                                                              • version diff --git a/modules/std.io.html b/modules/std.io.html index 3aa4cb6..812381e 100644 --- a/modules/std.io.html +++ b/modules/std.io.html @@ -48,10 +48,11 @@

                                                                                                                                                Modules

                                                                                                                                              • std.strict
                                                                                                                                              • std.string
                                                                                                                                              • std.table
                                                                                                                                              • -
                                                                                                                                              • std.tree

                                                                                                                                              Classes

                                                                                                                                                +
                                                                                                                                              • std.tree
                                                                                                                                              • +
                                                                                                                                              • std.container
                                                                                                                                              • std.object
                                                                                                                                              • std.list
                                                                                                                                              • std.set
                                                                                                                                              • @@ -126,6 +127,7 @@

                                                                                                                                                Functions

                                                                                                                                                Concatenate two or more directories into a path, removing the trailing slash. +

                                                                                                                                                Parameters:

                                                                                                                                                • ... @@ -150,6 +152,7 @@

                                                                                                                                                  Returns:

                                                                                                                                                  Concatenate one or more directories and a filename into a path. +

                                                                                                                                                  Parameters:

                                                                                                                                                  • ... @@ -174,6 +177,7 @@

                                                                                                                                                    Returns:

                                                                                                                                                    Die with error. +

                                                                                                                                                    Parameters:

                                                                                                                                                    • ... @@ -195,6 +199,7 @@

                                                                                                                                                      Parameters:

                                                                                                                                                      If no files given, process io.stdin; in list of files, - means io.stdin. +

                                                                                                                                                      Parameters:

                                                                                                                                                      • f @@ -215,6 +220,7 @@

                                                                                                                                                        Parameters:

                                                                                                                                                        Read a file or file handle into a list of lines. +

                                                                                                                                                        Parameters:

                                                                                                                                                        • h @@ -240,6 +246,7 @@

                                                                                                                                                          Returns:

                                                                                                                                                          Perform a shell command and return its output. +

                                                                                                                                                          Parameters:

                                                                                                                                                          • c @@ -264,6 +271,7 @@

                                                                                                                                                            Returns:

                                                                                                                                                            Slurp a file handle. +

                                                                                                                                                            Parameters:

                                                                                                                                                            • h @@ -289,6 +297,7 @@

                                                                                                                                                              Returns:

                                                                                                                                                              Split a directory path into components. Empty components are retained: the root directory becomes {"", ""}. +

                                                                                                                                                              Parameters:

                                                                                                                                                              • path @@ -313,6 +322,7 @@

                                                                                                                                                                Returns:

                                                                                                                                                                Give warning with the name of program and file (if any). +

                                                                                                                                                                Parameters:

                                                                                                                                                                • ... @@ -332,6 +342,7 @@

                                                                                                                                                                  Parameters:

                                                                                                                                                                  Write values adding a newline after each. +

                                                                                                                                                                  Parameters:

                                                                                                                                                                  • h diff --git a/modules/std.math.html b/modules/std.math.html index c33efea..1d26c3b 100644 --- a/modules/std.math.html +++ b/modules/std.math.html @@ -48,10 +48,11 @@

                                                                                                                                                                    Modules

                                                                                                                                                                  • std.strict
                                                                                                                                                                  • std.string
                                                                                                                                                                  • std.table
                                                                                                                                                                  • -
                                                                                                                                                                  • std.tree

                                                                                                                                                                  Classes

                                                                                                                                                                    +
                                                                                                                                                                  • std.tree
                                                                                                                                                                  • +
                                                                                                                                                                  • std.container
                                                                                                                                                                  • std.object
                                                                                                                                                                  • std.list
                                                                                                                                                                  • std.set
                                                                                                                                                                  • @@ -94,6 +95,7 @@

                                                                                                                                                                    Functions

                                                                                                                                                                    Extend math.floor to take the number of decimal places. +

                                                                                                                                                                    Parameters:

                                                                                                                                                                    • n @@ -121,6 +123,7 @@

                                                                                                                                                                      Returns:

                                                                                                                                                                      Round a number to a given number of decimal places +

                                                                                                                                                                      Parameters:

                                                                                                                                                                      • n diff --git a/modules/std.package.html b/modules/std.package.html index f980b4c..3285807 100644 --- a/modules/std.package.html +++ b/modules/std.package.html @@ -48,10 +48,11 @@

                                                                                                                                                                        Modules

                                                                                                                                                                      • std.strict
                                                                                                                                                                      • std.string
                                                                                                                                                                      • std.table
                                                                                                                                                                      • -
                                                                                                                                                                      • std.tree

                                                                                                                                                                      Classes

                                                                                                                                                                      @@ -113,6 +115,7 @@

                                                                                                                                                                      Functions

                                                                                                                                                                      +
                                                                                                                                                                    diff --git a/modules/std.string.html b/modules/std.string.html index cd9b095..c3f1211 100644 --- a/modules/std.string.html +++ b/modules/std.string.html @@ -49,10 +49,11 @@

                                                                                                                                                                    Modules

                                                                                                                                                                  • std.strict
                                                                                                                                                                  • std.string
                                                                                                                                                                  • std.table
                                                                                                                                                                  • -
                                                                                                                                                                  • std.tree

                                                                                                                                                                  Classes

                                                                                                                                                                    +
                                                                                                                                                                  • std.tree
                                                                                                                                                                  • +
                                                                                                                                                                  • std.container
                                                                                                                                                                  • std.object
                                                                                                                                                                  • std.list
                                                                                                                                                                  • std.set
                                                                                                                                                                  • @@ -214,6 +215,7 @@

                                                                                                                                                                    Functions

                                                                                                                                                                    Extend to allow formatted arguments. +

                                                                                                                                                                    Parameters:

                                                                                                                                                                    • v @@ -244,6 +246,7 @@

                                                                                                                                                                      Returns:

                                                                                                                                                                      Capitalise each word in a string. +

                                                                                                                                                                      Parameters:

                                                                                                                                                                      • s @@ -268,6 +271,7 @@

                                                                                                                                                                        Returns:

                                                                                                                                                                        Remove any final newline from a string. +

                                                                                                                                                                        Parameters:

                                                                                                                                                                        • s @@ -292,6 +296,7 @@

                                                                                                                                                                          Returns:

                                                                                                                                                                          Escape a string to be used as a pattern. +

                                                                                                                                                                          Parameters:

                                                                                                                                                                          • s @@ -318,6 +323,7 @@

                                                                                                                                                                            Returns:

                                                                                                                                                                            Quotes spaces, parentheses, brackets, quotes, apostrophes and whitespace. +

                                                                                                                                                                            Parameters:

                                                                                                                                                                            • s @@ -342,6 +348,7 @@

                                                                                                                                                                              Returns:

                                                                                                                                                                              Do multiple finds on a string. +

                                                                                                                                                                              Parameters:

                                                                                                                                                                              • s @@ -376,6 +383,7 @@

                                                                                                                                                                                Returns:

                                                                                                                                                                                Extend to work better with one argument. If only one argument is passed, no formatting is attempted. +

                                                                                                                                                                                Parameters:

                                                                                                                                                                                • f @@ -406,6 +414,7 @@

                                                                                                                                                                                  Returns:

                                                                                                                                                                                  Remove leading matter from a string. +

                                                                                                                                                                                  Parameters:

                                                                                                                                                                                  • s @@ -434,6 +443,7 @@

                                                                                                                                                                                    Returns:

                                                                                                                                                                                    Write a number using SI suffixes. The number is always written to 3 s.f. +

                                                                                                                                                                                    Parameters:

                                                                                                                                                                                    • n @@ -458,6 +468,7 @@

                                                                                                                                                                                      Returns:

                                                                                                                                                                                      Return the English suffix for an ordinal. +

                                                                                                                                                                                      Parameters:

                                                                                                                                                                                      • n @@ -484,6 +495,7 @@

                                                                                                                                                                                        Returns:

                                                                                                                                                                                        When the string is longer than w, it is truncated (left or right according to the sign of w). +

                                                                                                                                                                                        Parameters:

                                                                                                                                                                                        • s @@ -516,6 +528,7 @@

                                                                                                                                                                                          Returns:

                                                                                                                                                                                          Convert a value to a string. The string can be passed to dostring to retrieve the value. +

                                                                                                                                                                                          Parameters:

                                                                                                                                                                                          • x @@ -540,6 +553,7 @@

                                                                                                                                                                                            Returns:

                                                                                                                                                                                            Pretty-print a table. +

                                                                                                                                                                                            Parameters:

                                                                                                                                                                                            • t @@ -572,6 +586,7 @@

                                                                                                                                                                                              Returns:

                                                                                                                                                                                              N.B. Functions calling render should not recurse, or recursion detection will not work. +

                                                                                                                                                                                              Parameters:

                                                                                                                                                                                              • x @@ -624,6 +639,7 @@

                                                                                                                                                                                                See also:

                                                                                                                                                                                                +

                                                                                                                                                                                                Parameters:

                                                                                                                                                                                                • t @@ -650,6 +666,7 @@

                                                                                                                                                                                                  Returns:

                                                                                                                                                                                                  +

                                                                                                                                                                                                  Parameters:

                                                                                                                                                                                                  • e @@ -674,6 +691,7 @@

                                                                                                                                                                                                    Returns:

                                                                                                                                                                                                    +

                                                                                                                                                                                                    Parameters:

                                                                                                                                                                                                    • t @@ -700,6 +718,7 @@

                                                                                                                                                                                                      Returns:

                                                                                                                                                                                                      NB. the function should not try to render i and v, or treat them recursively. +

                                                                                                                                                                                                      Parameters:

                                                                                                                                                                                                      • t @@ -738,6 +757,7 @@

                                                                                                                                                                                                        Returns:

                                                                                                                                                                                                        +

                                                                                                                                                                                                        Parameters:

                                                                                                                                                                                                        • t @@ -774,6 +794,7 @@

                                                                                                                                                                                                          Returns:

                                                                                                                                                                                                          Require a module with a particular version. +

                                                                                                                                                                                                          Parameters:

                                                                                                                                                                                                          • module @@ -803,6 +824,7 @@

                                                                                                                                                                                                            Parameters:

                                                                                                                                                                                                            Remove trailing matter from a string. +

                                                                                                                                                                                                            Parameters:

                                                                                                                                                                                                            • s @@ -830,6 +852,7 @@

                                                                                                                                                                                                              Returns:

                                                                                                                                                                                                              Split a string at a given separator. +

                                                                                                                                                                                                              Parameters:

                                                                                                                                                                                                              • s @@ -857,6 +880,7 @@

                                                                                                                                                                                                                Returns:

                                                                                                                                                                                                                Do find, returning captures as a list. +

                                                                                                                                                                                                                Parameters:

                                                                                                                                                                                                                • s @@ -890,6 +914,7 @@

                                                                                                                                                                                                                  Returns:

                                                                                                                                                                                                                  Extend tostring to work better on tables. +

                                                                                                                                                                                                                  Parameters:

                                                                                                                                                                                                                  • x @@ -914,6 +939,7 @@

                                                                                                                                                                                                                    Returns:

                                                                                                                                                                                                                    Remove leading and trailing matter from a string. +

                                                                                                                                                                                                                    Parameters:

                                                                                                                                                                                                                    • s @@ -941,6 +967,7 @@

                                                                                                                                                                                                                      Returns:

                                                                                                                                                                                                                      Wrap a string into a paragraph. +

                                                                                                                                                                                                                      Parameters:

                                                                                                                                                                                                                      • s @@ -977,6 +1004,7 @@

                                                                                                                                                                                                                        Fields

                                                                                                                                                                                                                        Give strings a subscription operator. +
                                                                                                                                                                                                                        • s string @@ -998,6 +1026,7 @@

                                                                                                                                                                                                                          Fields

                                                                                                                                                                                                                          Give strings an append metamethod. +
                                                                                                                                                                                                                          • s string @@ -1019,6 +1048,7 @@

                                                                                                                                                                                                                            Fields

                                                                                                                                                                                                                            Give strings a concat metamethod. +
                                                                                                                                                                                                                            • s string diff --git a/modules/std.table.html b/modules/std.table.html index 5104fc9..05cb962 100644 --- a/modules/std.table.html +++ b/modules/std.table.html @@ -48,10 +48,11 @@

                                                                                                                                                                                                                              Modules

                                                                                                                                                                                                                            • std.strict
                                                                                                                                                                                                                            • std.string
                                                                                                                                                                                                                            • std.table
                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                            • std.tree

                                                                                                                                                                                                                            Classes

                                                                                                                                                                                                                              +
                                                                                                                                                                                                                            • std.tree
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                            • std.container
                                                                                                                                                                                                                            • std.object
                                                                                                                                                                                                                            • std.list
                                                                                                                                                                                                                            • std.set
                                                                                                                                                                                                                            • @@ -138,7 +139,8 @@

                                                                                                                                                                                                                              Functions

                                                                                                                                                                                                                              Make a shallow copy of a table, including any metatable.

                                                                                                                                                                                                                              -

                                                                                                                                                                                                                              To make deep copies, use std.tree.clone. +

                                                                                                                                                                                                                              To make deep copies, use std.tree.clone. +

                                                                                                                                                                                                                              Parameters:

                                                                                                                                                                                                                                @@ -172,6 +174,7 @@

                                                                                                                                                                                                                                Returns:

                                                                                                                                                                                                                                Clone a table, renaming some keys. +

                                                                                                                                                                                                                                Parameters:

                                                                                                                                                                                                                                • t @@ -201,6 +204,7 @@

                                                                                                                                                                                                                                  Returns:

                                                                                                                                                                                                                                  Return whether table is empty. +

                                                                                                                                                                                                                                  Parameters:

                                                                                                                                                                                                                                  • t @@ -226,6 +230,7 @@

                                                                                                                                                                                                                                    Returns:

                                                                                                                                                                                                                                    Invert a table. +

                                                                                                                                                                                                                                    Parameters:

                                                                                                                                                                                                                                    • t @@ -252,6 +257,7 @@

                                                                                                                                                                                                                                      Returns:

                                                                                                                                                                                                                                      Make the list of keys in table. +

                                                                                                                                                                                                                                      Parameters:

                                                                                                                                                                                                                                      • t @@ -278,6 +284,7 @@

                                                                                                                                                                                                                                        Returns:

                                                                                                                                                                                                                                        Destructively merge another table's fields into table. +

                                                                                                                                                                                                                                        Parameters:

                                                                                                                                                                                                                                        • t @@ -307,6 +314,7 @@

                                                                                                                                                                                                                                          Returns:

                                                                                                                                                                                                                                          Make a table with a default value for unset keys. +

                                                                                                                                                                                                                                          Parameters:

                                                                                                                                                                                                                                          • x @@ -336,6 +344,7 @@

                                                                                                                                                                                                                                            Returns:

                                                                                                                                                                                                                                            Turn a tuple into a list. +

                                                                                                                                                                                                                                            Parameters:

                                                                                                                                                                                                                                            • ... @@ -360,6 +369,7 @@

                                                                                                                                                                                                                                              Returns:

                                                                                                                                                                                                                                              An iterator like ipairs, but in reverse. +

                                                                                                                                                                                                                                              Parameters:

                                                                                                                                                                                                                                              • t @@ -392,6 +402,7 @@

                                                                                                                                                                                                                                                Returns:

                                                                                                                                                                                                                                                Find the number of elements in a table. +

                                                                                                                                                                                                                                                Parameters:

                                                                                                                                                                                                                                                • t @@ -417,6 +428,7 @@

                                                                                                                                                                                                                                                  Returns:

                                                                                                                                                                                                                                                  Make table.sort return its result. +

                                                                                                                                                                                                                                                  Parameters:

                                                                                                                                                                                                                                                  • t @@ -446,6 +458,7 @@

                                                                                                                                                                                                                                                    Returns:

                                                                                                                                                                                                                                                    Turn an object into a table according to __totable metamethod. +

                                                                                                                                                                                                                                                    Parameters:

                                                      std.treeTree container.
                                                      std.containerContainer object.
                                                      std.object Prototype-based objects.
                                                      std.setSet object.Set container.
                                                      std.strbuf
                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                      __index (i)Tree __index metamethod.
                                                      __newindex (i, v)Tree __newindex metamethod.
                                                      clone (t, nometa)Make a deep copy of a tree, including any metatables.
                                                      ileaves (tr)Tree iterator which returns just numbered leaves, in order.
                                                      inodes (tr)Tree iterator over numbered nodes, in order.
                                                      leaves (tr)Tree iterator which returns just leaves.
                                                      merge (t, u)Destructively deep-merge one tree into another.
                                                      new (t)Make a table into a tree.
                                                      nodes (tr)Tree iterator over all nodes.
                                                      - -
                                                      -
                                                      - - -

                                                      Functions

                                                      -
                                                      -
                                                      - - __index (i) -
                                                      -
                                                      - Tree __index metamethod. - -

                                                      Parameters:

                                                      -
                                                        -
                                                      • i - non-table, or list of keys {i_1 ... i_n} -
                                                      • -
                                                      - -

                                                      Returns:

                                                      -
                                                        - - tr[i]...[i_n] if i is a table, or tr[i] otherwise -
                                                      - - - - -
                                                      -
                                                      - - __newindex (i, v) -
                                                      -
                                                      - Tree __newindex metamethod.

                                                      - -

                                                      Sets tr[i_1]...[i_n] = v if i is a table, or tr[i] = v otherwise - -

                                                      Parameters:

                                                      -
                                                        -
                                                      • i - non-table, or list of keys {i_1 ... i_n} -
                                                      • -
                                                      • v - value -
                                                      • -
                                                      - - - - - -
                                                      -
                                                      - - clone (t, nometa) -
                                                      -
                                                      - Make a deep copy of a tree, including any metatables.

                                                      - -

                                                      To make fast shallow copies, use std.table.clone. - -

                                                      Parameters:

                                                      -
                                                        -
                                                      • t - table - -
                                                          table to be cloned
                                                        -
                                                        - -
                                                      • -
                                                      • nometa - boolean - if non-nil don't copy metatables -
                                                      • -
                                                      - -

                                                      Returns:

                                                      -
                                                        - - table - a deep copy of t -
                                                      - - - - -
                                                      -
                                                      - - ileaves (tr) -
                                                      -
                                                      - Tree iterator which returns just numbered leaves, in order. - -

                                                      Parameters:

                                                      -
                                                        -
                                                      • tr - std.tree - tree table -
                                                      • -
                                                      - -

                                                      Returns:

                                                      -
                                                        -
                                                      1. - function - iterator function
                                                      2. -
                                                      3. - std.tree - the tree tr
                                                      4. -
                                                      - - - - -
                                                      -
                                                      - - inodes (tr) -
                                                      -
                                                      - Tree iterator over numbered nodes, in order. - -

                                                      Parameters:

                                                      -
                                                        -
                                                      • tr - std.tree - tree to iterate over -
                                                      • -
                                                      - -

                                                      Returns:

                                                      -
                                                        -
                                                      1. - function - iterator function
                                                      2. -
                                                      3. - std.tree - the tree, t
                                                      4. -
                                                      - - - - -
                                                      -
                                                      - - leaves (tr) -
                                                      -
                                                      - Tree iterator which returns just leaves. - -

                                                      Parameters:

                                                      -
                                                        -
                                                      • tr - std.tree - tree table -
                                                      • -
                                                      - -

                                                      Returns:

                                                      -
                                                        -
                                                      1. - function - iterator function
                                                      2. -
                                                      3. - std.tree - the tree, tr
                                                      4. -
                                                      - - - - -
                                                      -
                                                      - - merge (t, u) -
                                                      -
                                                      - Destructively deep-merge one tree into another. - -

                                                      Parameters:

                                                      -
                                                        -
                                                      • t - std.tree - destination tree -
                                                      • -
                                                      • u - std.tree - tree with nodes to merge -
                                                      • -
                                                      - -

                                                      Returns:

                                                      -
                                                        - - std.tree - t with nodes from u merged in -
                                                      - - -

                                                      See also:

                                                      - - - -
                                                      -
                                                      - - new (t) -
                                                      -
                                                      - Make a table into a tree. - -

                                                      Parameters:

                                                      -
                                                        -
                                                      • t - table - any table -
                                                      • -
                                                      - -

                                                      Returns:

                                                      -
                                                        - - std.tree - a new tree table -
                                                      - - - - -
                                                      -
                                                      - - nodes (tr) -
                                                      -
                                                      - Tree iterator over all nodes. - -

                                                      Parameters:

                                                      -
                                                        -
                                                      • tr - std.tree - tree to iterate over -
                                                      • -
                                                      - -

                                                      Returns:

                                                      -
                                                        -
                                                      1. - function - iterator function
                                                      2. -
                                                      3. - std.tree - the tree, tr
                                                      4. -
                                                      - - - - -
                                                      -
                                                      - - - - -
                                                      -generated by LDoc 1.4.0 -
                                                      - - - From 69d280f225d4c3c21f0812d069335b56c2b0d469 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Sat, 18 Jan 2014 12:19:47 +1300 Subject: [PATCH 06/15] gh-pages: update for v37. * modules/std.getopt.html: Remove. * classes/std.optparse.html: New file. * classes/std.container.html, classes/std.list.html, classes/std.object.html, classes/std.set.html, classes/std.strbuf.html, classes/std.tree.html, index.html, modules/std.debug.html, modules/std.functional.html, modules/std.html, modules/std.io.html, modules/std.math.html, modules/std.package.html, modules/std.strict.html, modules/std.string.html, modules/std.table.html: Update. Signed-off-by: Gary V. Vaughan --- classes/std.container.html | 4 +- classes/std.list.html | 4 +- classes/std.object.html | 4 +- classes/std.optparse.html | 742 ++++++++++++++++++++++++++++++++++++ classes/std.set.html | 4 +- classes/std.strbuf.html | 4 +- classes/std.tree.html | 4 +- index.html | 12 +- modules/std.debug.html | 4 +- modules/std.functional.html | 4 +- modules/std.getopt.html | 248 ------------ modules/std.html | 55 ++- modules/std.io.html | 4 +- modules/std.math.html | 4 +- modules/std.package.html | 4 +- modules/std.strict.html | 4 +- modules/std.string.html | 6 +- modules/std.table.html | 4 +- 18 files changed, 829 insertions(+), 286 deletions(-) create mode 100644 classes/std.optparse.html delete mode 100644 modules/std.getopt.html diff --git a/classes/std.container.html b/classes/std.container.html index 8fdd62f..07d98db 100644 --- a/classes/std.container.html +++ b/classes/std.container.html @@ -3,7 +3,7 @@ - Reference + stdlib 37 Reference @@ -42,6 +42,7 @@

                                                      Classes

                                                    • std.container
                                                    • std.list
                                                    • std.object
                                                    • +
                                                    • std.optparse
                                                    • std.set
                                                    • std.strbuf
                                                    • std.tree
                                                    • @@ -51,7 +52,6 @@

                                                      Modules

                                                    • std
                                                    • std.debug
                                                    • std.functional
                                                    • -
                                                    • std.getopt
                                                    • std.io
                                                    • std.math
                                                    • std.package
                                                    • diff --git a/classes/std.list.html b/classes/std.list.html index 561ad08..78f2dac 100644 --- a/classes/std.list.html +++ b/classes/std.list.html @@ -3,7 +3,7 @@ - Reference + stdlib 37 Reference @@ -43,6 +43,7 @@

                                                      Classes

                                                    • std.container
                                                    • std.list
                                                    • std.object
                                                    • +
                                                    • std.optparse
                                                    • std.set
                                                    • std.strbuf
                                                    • std.tree
                                                    • @@ -52,7 +53,6 @@

                                                      Modules

                                                    • std
                                                    • std.debug
                                                    • std.functional
                                                    • -
                                                    • std.getopt
                                                    • std.io
                                                    • std.math
                                                    • std.package
                                                    • diff --git a/classes/std.object.html b/classes/std.object.html index 82f840c..28373a2 100644 --- a/classes/std.object.html +++ b/classes/std.object.html @@ -3,7 +3,7 @@ - Reference + stdlib 37 Reference @@ -43,6 +43,7 @@

                                                      Classes

                                                    • std.container
                                                    • std.list
                                                    • std.object
                                                    • +
                                                    • std.optparse
                                                    • std.set
                                                    • std.strbuf
                                                    • std.tree
                                                    • @@ -52,7 +53,6 @@

                                                      Modules

                                                    • std
                                                    • std.debug
                                                    • std.functional
                                                    • -
                                                    • std.getopt
                                                    • std.io
                                                    • std.math
                                                    • std.package
                                                    • diff --git a/classes/std.optparse.html b/classes/std.optparse.html new file mode 100644 index 0000000..704bec4 --- /dev/null +++ b/classes/std.optparse.html @@ -0,0 +1,742 @@ + + + + + stdlib 37 Reference + + + + +
                                                      + +
                                                      + +
                                                      +
                                                      +
                                                      + + +
                                                      + + + + + + +
                                                      + +

                                                      Class std.optparse

                                                      +

                                                      Parse and process command line options.

                                                      +

                                                      + + +

                                                       local OptionParser = require "std.optparse"
                                                      + local parser = OptionParser (spec)
                                                      + _G.arg, opts = parser:parse (_G.arg)
                                                      +
                                                      + +

                                                      The string spec passed to OptionParser must be a specially formatted + help text, of the form:

                                                      + +
                                                       any text VERSION
                                                      + Additional lines of text to show when the --version
                                                      + option is passed.
                                                      +
                                                      + Several lines or paragraphs are permitted.
                                                      +
                                                      + Usage: PROGNAME
                                                      +
                                                      + Banner text.
                                                      +
                                                      + Optional long description text to show when the --help
                                                      + option is passed.
                                                      +
                                                      + Several lines or paragraphs of long description are permitted.
                                                      +
                                                      + Options:
                                                      +
                                                      +   -h, --help               display this help, then exit
                                                      +       --version            display version information, then exit
                                                      +   -b                       a short option with no long option
                                                      +       --long               a long option with no short option
                                                      +       --another-long       a long option with internal hypen
                                                      +       --true               a Lua keyword as an option name
                                                      +   -v, --verbose            a combined short and long option
                                                      +   -n, --dryrun, --dry-run  several spellings of the same option
                                                      +   -u, --name=USER          require an argument
                                                      +   -o, --output=[FILE]      accept an optional argument
                                                      +   --                       end of options
                                                      +
                                                      +Footer text.  Several lines or paragraphs are permitted.
                                                      +
                                                      +Please report bugs at bug-list@yourhost.com
                                                      +
                                                      + +

                                                      Most often, everything else is handled automatically. After calling + parser:parse as shown above, _G.arg will contain unparsed arguments, + usually filenames or similar, and opts will be a table of parsed + option values. The keys to the table are the long-options with leading + hyphens stripped, and non-word characters turned to _. For example + if --another-long had been found in _G.arg then opts would + have a key named another_long. If there is no long option name, then + the short option is used, e.g. opts.b will be set. The values saved + in those keys are controlled by the option handler, usually just true + or the option argument string as appropriate.

                                                      + +

                                                      On those occasions where more complex processing is required, handlers + can be replaced or added using parser:on.

                                                      + +

                                                      + + +

                                                      Functions

                                                      + + + + + +
                                                      std.optparse.OptionParser (spec)Instantiate a new parser.
                                                      +

                                                      Tables

                                                      + + + + + + + + + + + + + +
                                                      std.optparse.boolvalsMap various option strings to equivalent Lua boolean values.
                                                      std.optparse.optsParsed options table, with a key for each encountered option, each + with value set by that option's on_handler.
                                                      std.optparse.parserCustomized parser for your options.
                                                      +

                                                      Methods

                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                      std.optparse:boolean (opt[, optarg="1"])Return a Lua boolean equivalent of various optarg strings.
                                                      std.optparse:file (opt, optarg)Report an option parse error unless optarg names an + existing file.
                                                      std.optparse:finished (arglist, i)Finish option processing + Usually indicated by -- at arglist[i].
                                                      std.optparse:flag (arglist, i[, value])Option at arglist[i] is a boolean switch.
                                                      std.optparse:help ()Option should display help text, then exit.
                                                      std.optparse:normalise (arglist)Normalise an argument list.
                                                      std.optparse:on (name, handler, value)Add an option handler.
                                                      std.optparse:on_handler (arglist, i[, value=nil])Function signature of an option handler for on.
                                                      std.optparse:opterr (msg)Report an option parse error, then exit with status 2.
                                                      std.optparse:optional (arglist, i[, value=true])Option at arglist[i] can take an argument.
                                                      std.optparse:parse (arglist)Parse arglist.
                                                      std.optparse:required (arglist, i[, value])Option at arglist[i} requires an argument.
                                                      std.optparse:set (opt, value)Store value with opt.
                                                      std.optparse:version ()Option should display version text, then exit.
                                                      + +
                                                      +
                                                      + + +

                                                      Functions

                                                      +
                                                      +
                                                      + + std.optparse.OptionParser (spec) +
                                                      +
                                                      + Instantiate a new parser. + Read the documented options from spec and return a new parser that + can be passed to parse for parsing those options from an argument + list. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • spec + string + option parsing specification +
                                                      • +
                                                      + +

                                                      Returns:

                                                      +
                                                        + + parser + a parser for options described by spec +
                                                      + + + + +
                                                      +
                                                      +

                                                      Tables

                                                      +
                                                      +
                                                      + + std.optparse.boolvals +
                                                      +
                                                      + Map various option strings to equivalent Lua boolean values. + + +

                                                      Fields:

                                                      +
                                                        +
                                                      • false + false +
                                                      • +
                                                      • 0 + false +
                                                      • +
                                                      • no + false +
                                                      • +
                                                      • n + false +
                                                      • +
                                                      • true + true +
                                                      • +
                                                      • 1 + true +
                                                      • +
                                                      • yes + true +
                                                      • +
                                                      • y + true +
                                                      • +
                                                      + + + + + +
                                                      +
                                                      + + std.optparse.opts +
                                                      +
                                                      + Parsed options table, with a key for each encountered option, each + with value set by that option's on_handler. + + + + + + + +
                                                      +
                                                      + + std.optparse.parser +
                                                      +
                                                      + Customized parser for your options. + + + + + + + +
                                                      +
                                                      +

                                                      Methods

                                                      +
                                                      +
                                                      + + std.optparse:boolean (opt[, optarg="1"]) +
                                                      +
                                                      + Return a Lua boolean equivalent of various optarg strings. + Report an option parse error if optarg is not recognised. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • opt + string + option name +
                                                      • +
                                                      • optarg + string + option argument, must be a key in boolvals + (default "1") +
                                                      • +
                                                      + +

                                                      Returns:

                                                      +
                                                        + + bool + true or false +
                                                      + + + + +
                                                      +
                                                      + + std.optparse:file (opt, optarg) +
                                                      +
                                                      + Report an option parse error unless optarg names an + existing file. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • opt + string + option name +
                                                      • +
                                                      • optarg + string + option argument, must be an existing file +
                                                      • +
                                                      + +

                                                      Returns:

                                                      +
                                                        + + `optarg` + + + +
                                                      + + + + +
                                                      +
                                                      + + std.optparse:finished (arglist, i) +
                                                      +
                                                      + Finish option processing + Usually indicated by -- at arglist[i]. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • arglist + table + list of arguments +
                                                      • +
                                                      • i + int + index of last processed element of arglist +
                                                      • +
                                                      + +

                                                      Returns:

                                                      +
                                                        + + int + index of next element of arglist to process +
                                                      + + + + +
                                                      +
                                                      + + std.optparse:flag (arglist, i[, value]) +
                                                      +
                                                      + Option at arglist[i] is a boolean switch. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • arglist + table + list of arguments +
                                                      • +
                                                      • i + int + index of last processed element of arglist +
                                                      • +
                                                      • value + either a function to process the option argument, + or a value to store when this flag is encountered +
                                                      • +
                                                      + +

                                                      Returns:

                                                      +
                                                        + + int + index of next element of arglist to process +
                                                      + + + + +
                                                      +
                                                      + + std.optparse:help () +
                                                      +
                                                      + Option should display help text, then exit. + + + + + + + +
                                                      +
                                                      + + std.optparse:normalise (arglist) +
                                                      +
                                                      + Normalise an argument list. + Separate short options, remove = separators from + --long-option=optarg etc. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • arglist + table + list of arguments to normalise +
                                                      • +
                                                      + +

                                                      Returns:

                                                      +
                                                        + + table + normalised argument list +
                                                      + + + + +
                                                      +
                                                      + + std.optparse:on (name, handler, value) +
                                                      +
                                                      + Add an option handler. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • name + opts + of the option, or list of option names +
                                                      • +
                                                      • handler + on_handler + function to call when any of opts is + encountered +
                                                      • +
                                                      • value + additional value passed to on_handler +
                                                      • +
                                                      + + + + + +
                                                      +
                                                      + + std.optparse:on_handler (arglist, i[, value=nil]) +
                                                      +
                                                      + Function signature of an option handler for on. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • arglist + table + list of arguments +
                                                      • +
                                                      • i + int + index of last processed element of arglist +
                                                      • +
                                                      • value + additional value registered with on + (default nil) +
                                                      • +
                                                      + +

                                                      Returns:

                                                      +
                                                        + + int + index of next element of arglist to process +
                                                      + + + + +
                                                      +
                                                      + + std.optparse:opterr (msg) +
                                                      +
                                                      + Report an option parse error, then exit with status 2. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • msg + string + error message +
                                                      • +
                                                      + + + + + +
                                                      +
                                                      + + std.optparse:optional (arglist, i[, value=true]) +
                                                      +
                                                      + Option at arglist[i] can take an argument. + Argument is accepted only if there is a following entry that does not + begin with a '-'. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • arglist + table + list of arguments +
                                                      • +
                                                      • i + int + index of last processed element of arglist +
                                                      • +
                                                      • value + either a function to process the option + argument, or a default value if encountered without an optarg + (default true) +
                                                      • +
                                                      + +

                                                      Returns:

                                                      +
                                                        + + int + index of next element of arglist to process +
                                                      + + + + +
                                                      +
                                                      + + std.optparse:parse (arglist) +
                                                      +
                                                      + Parse arglist. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • arglist + table + list of arguments +
                                                      • +
                                                      + +

                                                      Returns:

                                                      +
                                                        +
                                                      1. + table + a list of unrecognised arglist elements
                                                      2. +
                                                      3. + opts + parsing results
                                                      4. +
                                                      + + + + +
                                                      +
                                                      + + std.optparse:required (arglist, i[, value]) +
                                                      +
                                                      + Option at arglist[i} requires an argument. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • arglist + table + list of arguments +
                                                      • +
                                                      • i + int + index of last processed element of arglist +
                                                      • +
                                                      • value + either a function to process the option argument, + or a forced value to replace the user's option argument. +
                                                      • +
                                                      + +

                                                      Returns:

                                                      +
                                                        + + int + index of next element of arglist to process +
                                                      + + + + +
                                                      +
                                                      + + std.optparse:set (opt, value) +
                                                      +
                                                      + Store value with opt. + + +

                                                      Parameters:

                                                      +
                                                        +
                                                      • opt + string + option name +
                                                      • +
                                                      • value + option argument value +
                                                      • +
                                                      + + + + + +
                                                      +
                                                      + + std.optparse:version () +
                                                      +
                                                      + Option should display version text, then exit. + + + + + + + +
                                                      +
                                                      + + +
                                                      +
                                                      +
                                                      +generated by LDoc 1.4.0 +
                                                      +
                                                      + + diff --git a/classes/std.set.html b/classes/std.set.html index b1b8754..b291a94 100644 --- a/classes/std.set.html +++ b/classes/std.set.html @@ -3,7 +3,7 @@ - Reference + stdlib 37 Reference @@ -43,6 +43,7 @@

                                                      Classes

                                                    • std.container
                                                    • std.list
                                                    • std.object
                                                    • +
                                                    • std.optparse
                                                    • std.set
                                                    • std.strbuf
                                                    • std.tree
                                                    • @@ -52,7 +53,6 @@

                                                      Modules

                                                    • std
                                                    • std.debug
                                                    • std.functional
                                                    • -
                                                    • std.getopt
                                                    • std.io
                                                    • std.math
                                                    • std.package
                                                    • diff --git a/classes/std.strbuf.html b/classes/std.strbuf.html index a5ec6be..cefb45c 100644 --- a/classes/std.strbuf.html +++ b/classes/std.strbuf.html @@ -3,7 +3,7 @@ - Reference + stdlib 37 Reference @@ -42,6 +42,7 @@

                                                      Classes

                                                    • std.container
                                                    • std.list
                                                    • std.object
                                                    • +
                                                    • std.optparse
                                                    • std.set
                                                    • std.strbuf
                                                    • std.tree
                                                    • @@ -51,7 +52,6 @@

                                                      Modules

                                                    • std
                                                    • std.debug
                                                    • std.functional
                                                    • -
                                                    • std.getopt
                                                    • std.io
                                                    • std.math
                                                    • std.package
                                                    • diff --git a/classes/std.tree.html b/classes/std.tree.html index 261ecad..f6ffff8 100644 --- a/classes/std.tree.html +++ b/classes/std.tree.html @@ -3,7 +3,7 @@ - Reference + stdlib 37 Reference @@ -43,6 +43,7 @@

                                                      Classes

                                                    • std.container
                                                    • std.list
                                                    • std.object
                                                    • +
                                                    • std.optparse
                                                    • std.set
                                                    • std.strbuf
                                                    • std.tree
                                                    • @@ -52,7 +53,6 @@

                                                      Modules

                                                    • std
                                                    • std.debug
                                                    • std.functional
                                                    • -
                                                    • std.getopt
                                                    • std.io
                                                    • std.math
                                                    • std.package
                                                    • diff --git a/index.html b/index.html index 954c2bd..12a01ee 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - Reference + stdlib 37 Reference @@ -34,7 +34,6 @@

                                                      Modules

                                                    • std
                                                    • std.debug
                                                    • std.functional
                                                    • -
                                                    • std.getopt
                                                    • std.io
                                                    • std.math
                                                    • std.package
                                                    • @@ -48,6 +47,7 @@

                                                      Classes

                                                    • std.container
                                                    • std.object
                                                    • std.list
                                                    • +
                                                    • std.optparse
                                                    • std.set
                                                    • std.strbuf
                                                    @@ -73,10 +73,6 @@

                                                    Modules

                                                    std.functional Functional programming. - - std.getopt - Simplified getopt, based on Svenne Panne's Haskell GetOpt. - std.io Additions to the io module. @@ -120,6 +116,10 @@

                                                    Classes

                                                    std.list Tables as lists. + + std.optparse + Parse and process command line options. + std.set Set container. diff --git a/modules/std.debug.html b/modules/std.debug.html index e919d11..615896c 100644 --- a/modules/std.debug.html +++ b/modules/std.debug.html @@ -3,7 +3,7 @@ - Reference + stdlib 37 Reference @@ -42,7 +42,6 @@

                                                    Modules

                                                  • std
                                                  • std.debug
                                                  • std.functional
                                                  • -
                                                  • std.getopt
                                                  • std.io
                                                  • std.math
                                                  • std.package
                                                  • @@ -56,6 +55,7 @@

                                                    Classes

                                                  • std.container
                                                  • std.object
                                                  • std.list
                                                  • +
                                                  • std.optparse
                                                  • std.set
                                                  • std.strbuf
                                                  diff --git a/modules/std.functional.html b/modules/std.functional.html index c3bf40b..b9730a2 100644 --- a/modules/std.functional.html +++ b/modules/std.functional.html @@ -3,7 +3,7 @@ - Reference + stdlib 37 Reference @@ -42,7 +42,6 @@

                                                  Modules

                                                • std
                                                • std.debug
                                                • std.functional
                                                • -
                                                • std.getopt
                                                • std.io
                                                • std.math
                                                • std.package
                                                • @@ -56,6 +55,7 @@

                                                  Classes

                                                • std.container
                                                • std.object
                                                • std.list
                                                • +
                                                • std.optparse
                                                • std.set
                                                • std.strbuf
                                                diff --git a/modules/std.getopt.html b/modules/std.getopt.html deleted file mode 100644 index 5a915a0..0000000 --- a/modules/std.getopt.html +++ /dev/null @@ -1,248 +0,0 @@ - - - - - Reference - - - - -
                                                - -
                                                - -
                                                -
                                                -
                                                - - -
                                                - - - - - - -
                                                - -

                                                Module std.getopt

                                                -

                                                Simplified getopt, based on Svenne Panne's Haskell GetOpt.

                                                -

                                                Usage:

                                                - -
                                                 prog = {<
                                                -   name = <progname>,
                                                -   [usage = <usage line>,]
                                                -   [options = {
                                                -     {{<name>[, ...]}, <desc>, [<type> [, <var>]]},
                                                -     ...
                                                -   },]
                                                -   [banner = <banner string>,]
                                                -   [purpose = <purpose string>,]
                                                -   [notes = <additional notes>]
                                                - }
                                                -
                                                - -
                                                  -
                                                • The type of option argument is one of Req(uired), - Opt(ional)
                                                • -
                                                • The varis a descriptive name for the option argument.
                                                • -
                                                • getopt.processargs (prog)
                                                • -
                                                • Options take a single dash, but may have a double dash.
                                                • -
                                                • Arguments may be given as -opt=arg or -opt arg.
                                                • -
                                                • If an option taking an argument is given multiple times, only the - last value is returned; missing arguments are returned as 1.
                                                • -
                                                - -

                                                getOpt, usageinfo and usage can be called directly (see - below, and the example at the end). Set _DEBUG.std to a non-nil - value to run the example.

                                                - - -

                                                Functions

                                                - - - - - - - - - - - - - - - - - -
                                                getopt (argIn, options, stop_at_nonopt)Perform argument processing
                                                processargs (prog, ...)Simple getopt wrapper.
                                                usage (prog)Emit a usage message.
                                                usageinfo (header, optDesc, pageWidth)Produce usage info for the given options.
                                                - -
                                                -
                                                - - -

                                                Functions

                                                -
                                                -
                                                - - getopt (argIn, options, stop_at_nonopt) -
                                                -
                                                - Perform argument processing - - -

                                                Parameters:

                                                -
                                                  -
                                                • argIn - list of command-line args -
                                                • -
                                                • options - options table -
                                                • -
                                                • stop_at_nonopt - if true, stop option processing at first non-option -
                                                • -
                                                - -

                                                Returns:

                                                -
                                                  -
                                                1. - table of remaining non-options
                                                2. -
                                                3. - table of option key-value list pairs
                                                4. -
                                                5. - table of error messages
                                                6. -
                                                - - - - -
                                                -
                                                - - processargs (prog, ...) -
                                                -
                                                - Simple getopt wrapper. - If the caller didn't supply their own already, adds --version/-V - and --help/-h options automatically; - stops program if there was an error, or if --help or --version was - used. - - -

                                                Parameters:

                                                -
                                                  -
                                                • prog - table of named parameters -
                                                • -
                                                • ... - extra arguments for getopt -
                                                • -
                                                - - - - - -
                                                -
                                                - - usage (prog) -
                                                -
                                                - Emit a usage message. - - -

                                                Parameters:

                                                -
                                                  -
                                                • prog - table of named parameters -
                                                • -
                                                - - - - - -
                                                -
                                                - - usageinfo (header, optDesc, pageWidth) -
                                                -
                                                - Produce usage info for the given options. - - -

                                                Parameters:

                                                -
                                                  -
                                                • header - header string -
                                                • -
                                                • optDesc - option descriptors -
                                                • -
                                                • pageWidth - width to format to [78] -
                                                • -
                                                - -

                                                Returns:

                                                -
                                                  - - formatted string -
                                                - - - - -
                                                -
                                                - - -
                                                -
                                                -
                                                -generated by LDoc 1.4.0 -
                                                -
                                                - - diff --git a/modules/std.html b/modules/std.html index 1ab8ea2..b5efcff 100644 --- a/modules/std.html +++ b/modules/std.html @@ -3,7 +3,7 @@ - Reference + stdlib 37 Reference @@ -34,6 +34,7 @@

                                                Contents

                                                @@ -42,7 +43,6 @@

                                                Modules

                                              • std
                                              • std.debug
                                              • std.functional
                                              • -
                                              • std.getopt
                                              • std.io
                                              • std.math
                                              • std.package
                                              • @@ -56,6 +56,7 @@

                                                Classes

                                              • std.container
                                              • std.object
                                              • std.list
                                              • +
                                              • std.optparse
                                              • std.set
                                              • std.strbuf
                                              @@ -194,6 +195,13 @@

                                              Tables

                                              Module table. +

                                              Metamethods

                                              + + + + + +
                                              __index (name)Lazy loading of stdlib modules.


                                              @@ -695,7 +703,16 @@

                                              See also:

                                              std
                                              - Module table. + +

                                              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:

                                              @@ -709,6 +726,38 @@

                                              Fields:

                                              +
                                              + +

                                              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 +
                                              + + + +
                                              diff --git a/modules/std.io.html b/modules/std.io.html index 812381e..c1109d9 100644 --- a/modules/std.io.html +++ b/modules/std.io.html @@ -3,7 +3,7 @@ - Reference + stdlib 37 Reference @@ -41,7 +41,6 @@

                                              Modules

                                            • std
                                            • std.debug
                                            • std.functional
                                            • -
                                            • std.getopt
                                            • std.io
                                            • std.math
                                            • std.package
                                            • @@ -55,6 +54,7 @@

                                              Classes

                                            • std.container
                                            • std.object
                                            • std.list
                                            • +
                                            • std.optparse
                                            • std.set
                                            • std.strbuf
                                            diff --git a/modules/std.math.html b/modules/std.math.html index 1d26c3b..eb857ed 100644 --- a/modules/std.math.html +++ b/modules/std.math.html @@ -3,7 +3,7 @@ - Reference + stdlib 37 Reference @@ -41,7 +41,6 @@

                                            Modules

                                          • std
                                          • std.debug
                                          • std.functional
                                          • -
                                          • std.getopt
                                          • std.io
                                          • std.math
                                          • std.package
                                          • @@ -55,6 +54,7 @@

                                            Classes

                                          • std.container
                                          • std.object
                                          • std.list
                                          • +
                                          • std.optparse
                                          • std.set
                                          • std.strbuf
                                          diff --git a/modules/std.package.html b/modules/std.package.html index 3285807..7c0b2eb 100644 --- a/modules/std.package.html +++ b/modules/std.package.html @@ -3,7 +3,7 @@ - Reference + stdlib 37 Reference @@ -41,7 +41,6 @@

                                          Modules

                                        • std
                                        • std.debug
                                        • std.functional
                                        • -
                                        • std.getopt
                                        • std.io
                                        • std.math
                                        • std.package
                                        • @@ -55,6 +54,7 @@

                                          Classes

                                        • std.container
                                        • std.object
                                        • std.list
                                        • +
                                        • std.optparse
                                        • std.set
                                        • std.strbuf
                                        diff --git a/modules/std.strict.html b/modules/std.strict.html index c0184a7..cfdc552 100644 --- a/modules/std.strict.html +++ b/modules/std.strict.html @@ -3,7 +3,7 @@ - Reference + stdlib 37 Reference @@ -41,7 +41,6 @@

                                        Modules

                                      • std
                                      • std.debug
                                      • std.functional
                                      • -
                                      • std.getopt
                                      • std.io
                                      • std.math
                                      • std.package
                                      • @@ -55,6 +54,7 @@

                                        Classes

                                      • std.container
                                      • std.object
                                      • std.list
                                      • +
                                      • std.optparse
                                      • std.set
                                      • std.strbuf
                                      diff --git a/modules/std.string.html b/modules/std.string.html index c3f1211..f99a396 100644 --- a/modules/std.string.html +++ b/modules/std.string.html @@ -3,7 +3,7 @@ - Reference + stdlib 37 Reference @@ -42,7 +42,6 @@

                                      Modules

                                    • std
                                    • std.debug
                                    • std.functional
                                    • -
                                    • std.getopt
                                    • std.io
                                    • std.math
                                    • std.package
                                    • @@ -56,6 +55,7 @@

                                      Classes

                                    • std.container
                                    • std.object
                                    • std.list
                                    • +
                                    • std.optparse
                                    • std.set
                                    • std.strbuf
                                    @@ -808,7 +808,7 @@

                                    Parameters:

                                  • pattern to match version in module.version or - module.VERSION (default: ".*[%.%d]+" + module.VERSION (default: ".*[%.%d]+")
                                  diff --git a/modules/std.table.html b/modules/std.table.html index 05cb962..96ebab2 100644 --- a/modules/std.table.html +++ b/modules/std.table.html @@ -3,7 +3,7 @@ - Reference + stdlib 37 Reference @@ -41,7 +41,6 @@

                                  Modules

                                • std
                                • std.debug
                                • std.functional
                                • -
                                • std.getopt
                                • std.io
                                • std.math
                                • std.package
                                • @@ -55,6 +54,7 @@

                                  Classes

                                • std.container
                                • std.object
                                • std.list
                                • +
                                • std.optparse
                                • std.set
                                • std.strbuf
                                From 433f38e3e69094f817f8633e0444085356eaa25a Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Sun, 19 Jan 2014 20:39:19 +1300 Subject: [PATCH 07/15] gh-pages: improved backwards compatible list documentation. * classes/std.list.html: Much improved with rerelease of v37. Signed-off-by: Gary V. Vaughan --- classes/std.list.html | 958 +++++++++++++++++++++++++++++++++++------- 1 file changed, 802 insertions(+), 156 deletions(-) diff --git a/classes/std.list.html b/classes/std.list.html index 78f2dac..47a0644 100644 --- a/classes/std.list.html +++ b/classes/std.list.html @@ -33,6 +33,7 @@

                                stdlib

                                Contents

                                @@ -83,7 +84,9 @@

                                Class std.list

                                => 1
                                -

                                ...they can also be called as module functions with an explicit argument:

                                +

                                ... some can also be called as module functions with an explicit list + argument in the first or last parameter, check the documentation for + details:

                                 local List = require "std.list"
                                  local l = List {1, 2, 3}
                                @@ -98,27 +101,95 @@ 

                                Class std.list

                                Functions

                                + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -127,6 +198,13 @@

                                Functions

                                std.list.append (l, x)Append an item to a list.
                                std.list.compare (l, m)Compare two lists element-by-element, from left-to-right.
                                std.list.concat (l, ...)Concatenate arguments into a list.
                                std.list.cons (l, x)Prepend an item to a list.
                                std.list.depair (ls) Turn a list of pairs into a table.
                                std.list.elems (l)An iterator over the elements of a list.
                                std.list.enpair (t) Turn a table into a list of pairs.
                                std.list.index_key (l, f)std.list.filter (p, l)Filter a list according to a predicate.
                                std.list.flatten (l)Flatten a list.
                                std.list.foldl (fn, e, l)Fold a binary function through a list left associatively.
                                std.list.foldr (fn, e, l)Fold a binary function through a list right associatively.
                                std.list.index_key (f, l) Make an index of a list of tables on a given field
                                std.list.index_value (l, f)std.list.index_value (f, l) Copy a list of tables, indexed on a given field
                                std.list.map_with (ls, f)std.list.map (fn, l)Map a function over a list.
                                std.list.map_with (fn, ls) Map a function over a list of lists.
                                std.list.project (f, l)Project a list of fields from a list of tables.
                                std.list.relems (l)An iterator over the elements of a list, in reverse.
                                std.list.rep (l, n)Repeat a list.
                                std.list.reverse (l)Reverse a list.
                                std.list.shape (s, l)Shape a list according to a list of dimensions.
                                std.list.sub (l, from, to)Return a sub-range of a list.
                                std.list.tail (l)Return a list with its first element removed.
                                std.list.transpose (ls) Transpose a list of lists.
                                Zip a list of lists together with a function.
                                +

                                Tables

                                + + + + + +
                                std.list.ListAn Object derived List.

                                Metamethods

                                @@ -173,11 +251,11 @@

                                Methods

                                - + - + @@ -185,7 +263,7 @@

                                Methods

                                - + @@ -193,7 +271,7 @@

                                Methods

                                - + @@ -201,7 +279,7 @@

                                Methods

                                - + @@ -213,103 +291,594 @@

                                Methods

                                - +
                                Filter a list according to a predicate.
                                std.list:flatten (self)std.list:flatten () Flatten a list.
                                std.list:foldl (f, e)std.list:foldl (fn, e) Fold a binary function through a list left associatively.
                                Fold a binary function through a list right associatively.
                                std.list:map (f)std.list:map (fn) Map a function over a list.
                                Project a list of fields from a list of tables.
                                std.list:relems (self)std.list:relems () An iterator over the elements of a list, in reverse.
                                Repeat a list.
                                std.list:reverse (self)std.list:reverse () Reverse a list.
                                Return a sub-range of a list.
                                std.list:tail (self)std.list:tail () Return a list with its first element removed.
                                -
                                -
                                +
                                +
                                + + +

                                Functions

                                +
                                +
                                + + std.list.append (l, x) +
                                +
                                + Append an item to a list. + + +

                                Parameters:

                                +
                                  +
                                • l + List + a list +
                                • +
                                • x + item +
                                • +
                                + +

                                Returns:

                                +
                                  + + List + new list containing {l[1], ..., l[#l], x} +
                                + + + + +
                                +
                                + + std.list.compare (l, m) +
                                +
                                + +

                                Compare two lists element-by-element, from left-to-right.

                                + +
                                 if a_list:compare (another_list) == 0 then print "same" end
                                +
                                + + + +

                                Parameters:

                                +
                                  +
                                • l + List + a list +
                                • +
                                • m + table + another list +
                                • +
                                + +

                                Returns:

                                +
                                  + + -1 if l is less than m, 0 if they are the same, and 1 + if l is greater than m +
                                + + + + +
                                +
                                + + std.list.concat (l, ...) +
                                +
                                + Concatenate arguments into a list. + + +

                                Parameters:

                                +
                                  +
                                • l + List + a list +
                                • +
                                • ... + tuple of lists +
                                • +
                                + +

                                Returns:

                                +
                                  + + List + new list containing + {l[1], ..., l[#l], l_1[1], ..., l_1[#l_1], ..., l_n[1], ..., l_n[#l_n]} +
                                + + + + +
                                +
                                + + std.list.cons (l, x) +
                                +
                                + Prepend an item to a list. + + +

                                Parameters:

                                +
                                  +
                                • l + List + a list +
                                • +
                                • x + item +
                                • +
                                + +

                                Returns:

                                +
                                  + + List + new list containing {x, unpack (l)} +
                                + + + + +
                                +
                                + + std.list.depair (ls) +
                                +
                                + Turn a list of pairs into a table. + + +

                                Parameters:

                                +
                                  +
                                • ls + table + list of lists {{i1, v1}, ..., {in, vn}} +
                                • +
                                + +

                                Returns:

                                +
                                  + + table + a new list containing table {i1=v1, ..., in=vn} +
                                + + +

                                See also:

                                + + + +
                                +
                                + + std.list.elems (l) +
                                +
                                + An iterator over the elements of a list. + + +

                                Parameters:

                                +
                                  +
                                • l + List + a list +
                                • +
                                + +

                                Returns:

                                +
                                  +
                                1. + function + iterator function which returns successive elements + of l
                                2. +
                                3. + List + l
                                4. +
                                5. + true
                                6. +
                                + + + + +
                                +
                                + + std.list.enpair (t) +
                                +
                                + Turn a table into a list of pairs. + + +

                                Parameters:

                                +
                                  +
                                • t + table + a table {i1=v1, ..., in=vn} +
                                • +
                                + +

                                Returns:

                                +
                                  + + List + a new list containing {{i1, v1}, ..., {in, vn}} +
                                + + +

                                See also:

                                + + + +
                                +
                                + + std.list.filter (p, l) +
                                +
                                + Filter a list according to a predicate. + + +

                                Parameters:

                                +
                                  +
                                • p + func + predicate function, of one argument returning a boolean +
                                • +
                                • l + List + a list +
                                • +
                                + +

                                Returns:

                                +
                                  + + List + new list containing elements e of l for which + p (e) is true +
                                + + +

                                See also:

                                + + + +
                                +
                                + + std.list.flatten (l) +
                                +
                                + Flatten a list. + + +

                                Parameters:

                                +
                                  +
                                • l + List + a list +
                                • +
                                + +

                                Returns:

                                +
                                  + + List + flattened list +
                                + + + + +
                                +
                                + + std.list.foldl (fn, e, l) +
                                +
                                + Fold a binary function through a list left associatively. + + +

                                Parameters:

                                +
                                  +
                                • fn + func + binary function +
                                • +
                                • e + element to place in left-most position +
                                • +
                                • l + List + a list +
                                • +
                                + +

                                Returns:

                                +
                                  + + result +
                                + + +

                                See also:

                                + + + +
                                +
                                + + std.list.foldr (fn, e, l) +
                                +
                                + Fold a binary function through a list right associatively. + + +

                                Parameters:

                                +
                                  +
                                • fn + func + binary function +
                                • +
                                • e + element to place in right-most position +
                                • +
                                • l + List + a list +
                                • +
                                + +

                                Returns:

                                +
                                  + + result +
                                + + +

                                See also:

                                + + + +
                                +
                                + + std.list.index_key (f, l) +
                                +
                                + Make an index of a list of tables on a given field + + +

                                Parameters:

                                +
                                  +
                                • f + field +
                                • +
                                • l + List + list of tables {t1, ..., tn} +
                                • +
                                + +

                                Returns:

                                +
                                  + + List + index {t1[f]=1, ..., tn[f]=n} +
                                + + + + +
                                +
                                + + std.list.index_value (f, l) +
                                +
                                + Copy a list of tables, indexed on a given field + + +

                                Parameters:

                                +
                                  +
                                • f + field whose value should be used as index +
                                • +
                                • l + List + list of tables {i1=t1, ..., in=tn} +
                                • +
                                + +

                                Returns:

                                +
                                  + + List + index {t1[f]=t1, ..., tn[f]=tn} +
                                + + + + +
                                +
                                + + std.list.map (fn, l) +
                                +
                                + Map a function over a list. + + +

                                Parameters:

                                +
                                  +
                                • fn + func + map function +
                                • +
                                • l + List + a list +
                                • +
                                +

                                Returns:

                                +
                                  -

                                  Functions

                                  -
                                  + List + new list containing {fn (l[1]), ..., fn (l[#l])} +
                                + + +

                                See also:

                                + + + +
                                - - std.list.depair (ls) + + std.list.map_with (fn, ls)
                                - Turn a list of pairs into a table. + Map a function over a list of lists.

                                Parameters:

                                  +
                                • fn + func + map function +
                                • ls - table - list of lists {{i1, v1}, ..., {in, vn}} + List + a list of lists

                                Returns:

                                  - table - a new list containing table {i1=v1, ..., in=vn} + List + new list {fn (unpack (ls[1]))), ..., fn (unpack (ls[#ls]))}
                                -

                                See also:

                                -
                                - - std.list.enpair (t) + + std.list.project (f, l)
                                - Turn a table into a list of pairs. + Project a list of fields from a list of tables.

                                Parameters:

                                  -
                                • t - table - a table {i1=v1, ..., in=vn} +
                                • f + field to project +
                                • +
                                • l + List + a list

                                Returns:

                                  - std.list - a new list containing {{i1, v1}, ..., {in, vn}} + List + list of f fields

                                See also:

                                - - std.list.index_key (l, f) + + std.list.relems (l)
                                - Make an index of a list of tables on a given field + An iterator over the elements of a list, in reverse.

                                Parameters:

                                • l - table - list of tables {t1, ..., tn} + List + a list
                                • -
                                • f - field +
                                + +

                                Returns:

                                +
                                  +
                                1. + function + iterator function which returns precessive elements + of the l
                                2. +
                                3. + List + l
                                4. +
                                5. + true
                                6. +
                                + + + + +
                                +
                                + + std.list.rep (l, n) +
                                +
                                + Repeat a list. + + +

                                Parameters:

                                +
                                  +
                                • l + List + a list +
                                • +
                                • n + int + number of times to repeat

                                Returns:

                                  - std.list - index {t1[f]=1, ..., tn[f]=n} + List + n copies of l appended together
                                @@ -317,60 +886,136 @@

                                Returns:

                                - - std.list.index_value (l, f) + + std.list.reverse (l)
                                - Copy a list of tables, indexed on a given field + Reverse a list.

                                Parameters:

                                • l + List + a list +
                                • +
                                + +

                                Returns:

                                +
                                  + + List + new list containing {l[#l], ..., l[1]} +
                                + + + + +
                                +
                                + + std.list.shape (s, l) +
                                +
                                + Shape a list according to a list of dimensions.

                                + +

                                Dimensions are given outermost first and items from the original + list are distributed breadth first; there may be one 0 indicating + an indefinite number. Hence, {0} is a flat list, + {1} is a singleton, {2, 0} is a list of + two lists, and {0, 2} is a list of pairs.

                                + +

                                Algorithm: turn shape into all positive numbers, calculating + the zero if necessary and making sure there is at most one; + recursively walk the shape, adding empty tables until the bottom + level is reached at which point add table items instead, using a + counter to walk the flattened original list. + + +

                                Parameters:

                                +
                                  +
                                • s table - list of tables {i1=t1, ..., in=tn} + {d1, ..., dn}
                                • -
                                • f - field whose value should be used as index +
                                • l + List + a list

                                Returns:

                                  - std.list - index {t1[f]=t1, ..., tn[f]=tn} + reshaped list
                                +

                                See also:

                                +
                                - - std.list.map_with (ls, f) + + std.list.sub (l, from, to)
                                - Map a function over a list of lists. + Return a sub-range of a list. + (The equivalent of string.sub on strings; negative list indices + count from the end of the list.)

                                Parameters:

                                  -
                                • ls - table - a list of lists +
                                • l + List + a list
                                • -
                                • f - function - map function +
                                • from + int + start of range (default: 1) +
                                • +
                                • to + int + end of range (default: #l) +
                                • +
                                + +

                                Returns:

                                +
                                  + + List + new list containing {l[from], ..., l[to]} +
                                + + + + +
                                +
                                + + std.list.tail (l) +
                                +
                                + Return a list with its first element removed. + + +

                                Parameters:

                                +
                                  +
                                • l + List + a list

                                Returns:

                                  - std.list - new list {f (unpack (ls[1]))), ..., f (unpack (ls[#ls]))} + List + new list containing {l[2], ..., l[#l]}
                                @@ -398,7 +1043,7 @@

                                Parameters:

                                Returns:

                                  - std.list + List new list containing {{ls<1,1>, ..., ls<r,1>}, ..., {ls<1,c>, ..., ls<r,c>}}
                                @@ -430,7 +1075,7 @@

                                Parameters:

                                Returns:

                                  - std.list + List
                                  a new list containing
                                   
                                  @@ -442,6 +1087,23 @@

                                  Returns:

                                  +
                                +
                                +

                                Tables

                                +
                                +
                                + + std.list.List +
                                +
                                + An Object derived List. + + + + + + +

                                Metamethods

                                @@ -461,7 +1123,7 @@

                                Metamethods

                                Parameters:

                                • list - std.list + List a list
                                • element @@ -493,7 +1155,7 @@

                                  See also:

                                  Parameters:

                                  • list - std.list + List a list
                                  • table @@ -526,11 +1188,11 @@

                                    See also:

                                    Parameters:

                                    @@ -559,11 +1221,11 @@

                                    See also:

                                    Parameters:

                                    @@ -591,14 +1253,14 @@

                                    Methods

                                    Parameters:

                                    • x - item + item

                                    Returns:

                                      - std.list + List new list containing {self[1], ..., self[#self], x}
                                    @@ -623,7 +1285,7 @@

                                    Parameters:

                                    • l table - another list + a list
                                    @@ -656,7 +1318,7 @@

                                    Parameters:

                                    Returns:

                                      - std.list + List new list containing {self[1], ..., self[#self], l_1[1], ..., l_1[#l_1], ..., l_n[1], ..., l_n[#l_n]}
                                    @@ -676,14 +1338,14 @@

                                    Returns:

                                    Parameters:

                                    • x - item + item

                                    Returns:

                                      - std.list + List new list containing {x, unpack (self)}
                                    @@ -704,10 +1366,11 @@

                                    Returns:

                                    1. function - iterator function which returns successive elements of self
                                    2. + iterator function which returns successive + elements of self
                                    3. - table - list
                                    4. + List + self
                                    5. true
                                    @@ -727,7 +1390,7 @@

                                    Returns:

                                    Parameters:

                                    • p - function + func predicate function, of one argument returning a boolean
                                    @@ -735,35 +1398,32 @@

                                    Parameters:

                                    Returns:

                                      - std.list - new list containing elements e of self for which p (e) is true + List + new list containing elements e of self for which + p (e) is true
                                    +

                                    See also:

                                    +
                                - std.list:flatten (self) + std.list:flatten ()
                                Flatten a list. -

                                Parameters:

                                -
                                  -
                                • self - - - -
                                • -

                                Returns:

                                  - std.list + List flattened list
                                @@ -773,7 +1433,7 @@

                                Returns:

                                - std.list:foldl (f, e) + std.list:foldl (fn, e)
                                Fold a binary function through a list left associatively. @@ -781,12 +1441,12 @@

                                Returns:

                                Parameters:

                                  -
                                • f - function - binary function +
                                • fn + func + binary function
                                • e - element to place in left-most position + element to place in left-most position
                                @@ -797,6 +1457,10 @@

                                Returns:

                              +

                              See also:

                              +
                            @@ -811,8 +1475,8 @@

                            Returns:

                            Parameters:

                            • f - function - binary function + func + binary function
                            • e element to place in right-most position @@ -826,12 +1490,16 @@

                              Returns:

                              +

                              See also:

                              +
                          - std.list:map (f) + std.list:map (fn)
                          Map a function over a list. @@ -839,8 +1507,8 @@

                          Returns:

                          Parameters:

                            -
                          • f - function +
                          • fn + func map function
                          @@ -848,11 +1516,16 @@

                          Parameters:

                          Returns:

                            - std.list - new list containing {f (self[1]), ..., f (self[#self])} + List + new list containing + {fn (self[1]), ..., fn (self[#self])}
                          +

                          See also:

                          +
                          @@ -867,45 +1540,42 @@

                          Returns:

                          Parameters:

                          • f - field to project + field to project

                          Returns:

                            - std.list + List list of f fields
                          +

                          See also:

                          +
                      - std.list:relems (self) + std.list:relems ()
                      An iterator over the elements of a list, in reverse. -

                      Parameters:

                      -
                        -
                      • self - - - -
                      • -

                      Returns:

                      1. function - iterator function which returns precessive elements of the self
                      2. + iterator function which returns precessive elements + of the self
                      3. - std.list + List self
                      4. true
                      5. @@ -926,7 +1596,7 @@

                        Returns:

                        Parameters:

                        • n - number + int number of times to repeat
                        @@ -934,7 +1604,7 @@

                        Parameters:

                        Returns:

                          - std.list + List n copies of self appended together
                        @@ -944,25 +1614,17 @@

                        Returns:

                      - std.list:reverse (self) + std.list:reverse ()
                      Reverse a list. -

                      Parameters:

                      -
                        -
                      • self - - - -
                      • -

                      Returns:

                        - std.list + List new list containing {self[#self], ..., self[1]}
                      @@ -975,19 +1637,7 @@

                      Returns:

                      std.list:shape (s)
                      - Shape a list according to a list of dimensions.

                      - -

                      Dimensions are given outermost first and items from the original - list are distributed breadth first; there may be one 0 indicating - an indefinite number. Hence, {0} is a flat list, - {1} is a singleton, {2, 0} is a list of - two lists, and {0, 2} is a list of pairs.

                      - -

                      Algorithm: turn shape into all positive numbers, calculating - the zero if necessary and making sure there is at most one; - recursively walk the shape, adding empty tables until the bottom - level is reached at which point add table items instead, using a - counter to walk the flattened original list. + Shape a list according to a list of dimensions.

                      Parameters:

                      @@ -1005,6 +1655,10 @@

                      Returns:

                      +

                      See also:

                      +
                      @@ -1021,19 +1675,19 @@

                      Returns:

                      Parameters:

                      • from - number + int start of range (default: 1)
                      • to - number - end of range (default: #self) + int + end of range (default: #self)

                      Returns:

                        - std.list + List new list containing {self[from], ..., self[to]}
                      @@ -1043,25 +1697,17 @@

                      Returns:

                  - std.list:tail (self) + std.list:tail ()
                  Return a list with its first element removed. -

                  Parameters:

                  -
                    -
                  • self - - - -
                  • -

                  Returns:

                    - std.list + List new list containing {self[2], ..., self[#self]}
                  From a9311e5009ffecbfeb91493c9b05559a1b245399 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Thu, 30 Jan 2014 21:27:00 +1300 Subject: [PATCH 08/15] gh-pages: update for v38. Signed-off-by: Gary V. Vaughan --- classes/std.container.html | 28 +- classes/std.list.html | 32 +- classes/std.object.html | 82 ++++- classes/std.optparse.html | 642 +++++++++++++++++++++--------------- classes/std.set.html | 36 +- classes/std.strbuf.html | 12 +- classes/std.tree.html | 36 +- index.html | 4 +- modules/std.debug.html | 4 +- modules/std.functional.html | 4 +- modules/std.html | 6 +- modules/std.io.html | 33 +- modules/std.math.html | 4 +- modules/std.package.html | 4 +- modules/std.strict.html | 4 +- modules/std.string.html | 21 +- modules/std.table.html | 42 +-- 17 files changed, 598 insertions(+), 396 deletions(-) diff --git a/classes/std.container.html b/classes/std.container.html index 07d98db..613f274 100644 --- a/classes/std.container.html +++ b/classes/std.container.html @@ -3,7 +3,7 @@ - stdlib 37 Reference + stdlib 38 Reference @@ -80,9 +80,9 @@

                  Class std.container

                  std.object module functions, or anywhere else a std.object is expected.

                  -

                  Container derived objects returned directly from a require statement +

                  Container derived objects returned directly from a require statement may also provide module functions, which can be called only from the - initial prototype object returned by require , but are not passed + initial prototype object returned by require , but are not passed on to derived objects during cloning:

                    > Container = require "std.container"
                  @@ -132,7 +132,7 @@ 

                  Tables

                  Metamethods

                  - + @@ -162,17 +162,17 @@

                  Tables

                  Fields:

                  • _init - table or function + table or function a table of field names, or initialisation function, used by __call
                  • _functions - nil or table + nil or table a table of module functions not copied by std.object.__call
                  • _type - string + string type of Container, returned by std.object.prototype (default "Container") @@ -189,7 +189,7 @@

                    Metamethods

                    - std.container:__call (...) + std.container:__call (x, ...)
                    Return a clone of this container. @@ -197,8 +197,12 @@

                    Metamethods

                    Parameters:

                      +
                    • x + a table if prototype _init is a table, otherwise first + argument for a function type _init +
                    • ... - arguments for _init + any additional arguments for _init
                    @@ -229,7 +233,7 @@

                    See also:

                    Returns:

                      - string + string stringified container representation
                    @@ -253,7 +257,7 @@

                    See also:

                    Returns:

                      - table + table a shallow copy of non-private container fields
                    @@ -271,7 +275,7 @@

                    See also:

                    -generated by LDoc 1.4.0 +generated by LDoc 1.4.2
                    diff --git a/classes/std.list.html b/classes/std.list.html index 47a0644..5422e25 100644 --- a/classes/std.list.html +++ b/classes/std.list.html @@ -3,7 +3,7 @@ - stdlib 37 Reference + stdlib 38 Reference @@ -352,7 +352,7 @@

                    Parameters:

                    a list
                  • m - table + table another list
                  @@ -440,7 +440,7 @@

                  Returns:

                  Parameters:

                  • ls - table + table list of lists {{i1, v1}, ..., {in, vn}}
                  @@ -448,7 +448,7 @@

                  Parameters:

                  Returns:

                    - table + table a new list containing table {i1=v1, ..., in=vn}
                  @@ -504,7 +504,7 @@

                  Returns:

                  Parameters:

                  @@ -935,7 +935,7 @@

                  Returns:

                  Parameters:

                  • s - table + table {d1, ..., dn}
                  • l @@ -964,7 +964,7 @@

                    See also:

                    Return a sub-range of a list. - (The equivalent of string.sub on strings; negative list indices + (The equivalent of string.sub on strings; negative list indices count from the end of the list.) @@ -1035,7 +1035,7 @@

                    Returns:

                    Parameters:

                    • ls - table + table {{ls<1,1>, ..., ls<1,c>}, ..., {ls<r,1>, ..., ls<r,c>}}
                    @@ -1063,7 +1063,7 @@

                    Returns:

                    Parameters:

                    • ls - table + table list of lists
                    • f @@ -1135,7 +1135,7 @@

                      Parameters:

                      See also:

                      @@ -1159,7 +1159,7 @@

                      Parameters:

                      a list
                    • table - table + table another list, hash part is ignored
                    @@ -1168,7 +1168,7 @@

                    Parameters:

                    See also:

                    @@ -1284,7 +1284,7 @@

                    Returns:

                    Parameters:

                    @@ -1643,7 +1643,7 @@

                    Returns:

                    Parameters:

                    @@ -1668,7 +1668,7 @@

                    See also:

                    Return a sub-range of a list. - (The equivalent of string.sub on strings; negative list indices + (The equivalent of string.sub on strings; negative list indices count from the end of the list.) @@ -1721,7 +1721,7 @@

                    Returns:

                    -generated by LDoc 1.4.0 +generated by LDoc 1.4.2
                    diff --git a/classes/std.object.html b/classes/std.object.html index 28373a2..fd6c8a7 100644 --- a/classes/std.object.html +++ b/classes/std.object.html @@ -3,7 +3,7 @@ - stdlib 37 Reference + stdlib 38 Reference @@ -149,10 +149,14 @@

                    Metamethods

                    Methods

                  std.container:__call (...)std.container:__call (x, ...) Return a clone of this container.
                  - + + + + + @@ -178,17 +182,17 @@

                  Tables

                  Fields:

                  • _init - table or function + table or function a table of field names, or initialisation function, used by clone
                  • _functions - nil or table + nil or table a table of module functions not copied by std.object.__call
                  • _type - string + string type of Object, returned by prototype (default "Object")
                  • @@ -253,14 +257,14 @@

                    See also:

                    Returns:

                      - string + string stringified container representation

                    See also:

                    @@ -281,7 +285,7 @@

                    See also:

                    Returns:

                      - table + table a shallow copy of non-private object fields
                    @@ -298,7 +302,7 @@

                    Methods

                    - std.object:clone (o, ...) + std.object:clone (obj, ...)
                    Clone this Object. @@ -306,7 +310,7 @@

                    Methods

                    Parameters:

                      -
                    • o +
                    • obj std.object an object
                    • @@ -330,6 +334,60 @@

                      See also:

                    +
                    +
                    + + std.object:mapfields (obj, src[, map={}]) +
                    +
                    + Return obj with references to the fields of src merged in.

                    + +

                    More importantly, split the fields in src between obj and its + metatable. If any field names begin with _, attach a metatable + to obj if it doesn't have one yet, and copy the "private" _ + prefixed fields there.

                    + +

                    You might want to use this function to instantiate your derived + objct clones when the prototype's _init is a function -- when + _init is a table, the default (inherited unless you overwrite + it) clone method calls mapfields automatically. When you're + using a function _init setting, clone doesn't know what to + copy into a new object from the _init function's arguments... + so you're on your own. Except that calling mapfields inside + _init is safer than manually splitting src into obj and + its metatable, because you'll pick up fixes and changes when you + upgrade stdlib. + + +

                    Parameters:

                    +
                      +
                    • obj + table + destination object +
                    • +
                    • src + table + fields to copy int clone +
                    • +
                    • map + table + {oldkey=newkey, ...} + (default {}) +
                    • +
                    + +

                    Returns:

                    +
                      + + table + obj with non-private fields from src merged, + and a metatable with private fields (if any) merged, both sets + of keys renamed according to map +
                    + + + +
                    @@ -371,7 +429,7 @@

                    Parameters:

                    Returns:

                      - string + string type of x
                    @@ -385,7 +443,7 @@

                    Returns:

                    -generated by LDoc 1.4.0 +generated by LDoc 1.4.2
                    diff --git a/classes/std.optparse.html b/classes/std.optparse.html index 704bec4..2a0ac2a 100644 --- a/classes/std.optparse.html +++ b/classes/std.optparse.html @@ -3,7 +3,7 @@ - stdlib 37 Reference + stdlib 38 Reference @@ -71,14 +71,9 @@

                    Class std.optparse

                     local OptionParser = require "std.optparse"
                    - local parser = OptionParser (spec)
                    - _G.arg, opts = parser:parse (_G.arg)
                    -
                    - -

                    The string spec passed to OptionParser must be a specially formatted - help text, of the form:

                    -
                     any text VERSION
                    + local parser = OptionParser [[
                    + any text VERSION
                      Additional lines of text to show when the --version
                      option is passed.
                     
                    @@ -95,36 +90,56 @@ 

                    Class std.optparse

                    Options: - -h, --help display this help, then exit - --version display version information, then exit -b a short option with no long option --long a long option with no short option --another-long a long option with internal hypen - --true a Lua keyword as an option name -v, --verbose a combined short and long option -n, --dryrun, --dry-run several spellings of the same option -u, --name=USER require an argument -o, --output=[FILE] accept an optional argument - -- end of options + --version display version information, then exit + --help display this help, then exit Footer text. Several lines or paragraphs are permitted. Please report bugs at bug-list@yourhost.com +]] + +_G.arg, _G.opts = parser:parse (_G.arg)

                    Most often, everything else is handled automatically. After calling parser:parse as shown above, _G.arg will contain unparsed arguments, - usually filenames or similar, and opts will be a table of parsed + usually filenames or similar, and _G.opts will be a table of parsed option values. The keys to the table are the long-options with leading hyphens stripped, and non-word characters turned to _. For example - if --another-long had been found in _G.arg then opts would + if --another-long had been found in _G.arg then _G.opts would have a key named another_long. If there is no long option name, then - the short option is used, e.g. opts.b will be set. The values saved - in those keys are controlled by the option handler, usually just true - or the option argument string as appropriate.

                    + the short option is used, e.g. _G.opts.b will be set. The values + saved in those keys are controlled by the option handler, usually just + true or the option argument string as appropriate.

                    On those occasions where more complex processing is required, handlers - can be replaced or added using parser:on.

                    + can be replaced or added using parser:on. A good option to always + add, is to make -- signal the end of processed options, so that any + options following -- on the command line, even if they begin with a + hyphen and look like options otherwise, are not processed but instead + left in the modified _G.arg returned by parser:parse:

                    + +
                     parser:on ('--', parser.finished)
                    +
                    + +

                    See the documentation for std.optparse:on for more details of how to + use this powerful method.

                    + +

                    When writing your own handlers for std.optparse:on, you only need + to deal with normalised arguments, because combined short arguments + (-xyz), equals separators to long options (--long=ARG) are fully + expanded before any handler is called.

                    + +

                    Note that std.io.die and std.io.warn will only prefix messages + with parser.program if the parser options are assigned back to + _G.opts as shown in the example above.

                    @@ -135,82 +150,76 @@

                    Functions

                  -
                  std.object:clone (o, ...)std.object:clone (obj, ...) Clone this Object.
                  std.object:mapfields (obj, src[, map={}])Return obj with references to the fields of src merged in.
                  std.object:prototype (x) Type of an object, or primitive.
                  std.optparse.OptionParser (spec) Instantiate a new parser.
                  -

                  Tables

                  - - - - - - - - - - - - -
                  std.optparse.boolvalsMap various option strings to equivalent Lua boolean values.
                  std.optparse.optsParsed options table, with a key for each encountered option, each - with value set by that option's on_handler.
                  std.optparse.parserCustomized parser for your options.
                  -

                  Methods

                  - - - + - + - - + + - + - + - - + + - - + + - - + + - - + + +
                  std.optparse:boolean (opt[, optarg="1"])std.optparse.boolean (opt[, optarg="1"]) Return a Lua boolean equivalent of various optarg strings.
                  std.optparse:file (opt, optarg)std.optparse.file (opt, optarg) Report an option parse error unless optarg names an existing file.
                  std.optparse:finished (arglist, i)Finish option processing - Usually indicated by -- at arglist[i].std.optparse.finished (arglist, i)Finish option processing

                  + +

                  This is the handler automatically assigned to the option written as + -- in the OptionParser spec argument.

                  std.optparse:flag (arglist, i[, value])std.optparse.flag (arglist, i[, value]) Option at arglist[i] is a boolean switch.
                  std.optparse:help ()std.optparse.help () Option should display help text, then exit.
                  std.optparse:normalise (arglist)Normalise an argument list.std.optparse.opterr (msg)Report an option parse error, then exit with status 2.
                  std.optparse:on (name, handler, value)Add an option handler.std.optparse.optional (arglist, i[, value=true])Option at arglist[i] can take an argument.
                  std.optparse:on_handler (arglist, i[, value=nil])Function signature of an option handler for on.std.optparse.required (arglist, i[, value])Option at arglist[i} requires an argument.
                  std.optparse:opterr (msg)Report an option parse error, then exit with status 2.std.optparse.version ()Option should display version text, then exit.
                  +

                  Tables

                  + - - + + - - + + - - + + + +
                  std.optparse:optional (arglist, i[, value=true])Option at arglist[i] can take an argument.std.optparse.boolvalsMap various option strings to equivalent Lua boolean values.
                  std.optparse:parse (arglist)Parse arglist.std.optparse.optsParsed options table, with a key for each encountered option, each + with value set by that option's on_handler.
                  std.optparse:required (arglist, i[, value])Option at arglist[i} requires an argument.std.optparse.parserCustomized parser for your options.
                  +

                  Methods

                  + + + + - - + + - - + +
                  std.optparse:on (name, handler, value)Add an option handler.
                  std.optparse:set (opt, value)Store value with opt.std.optparse:on_handler (arglist, i[, value=nil])Function signature of an option handler for on.
                  std.optparse:version ()Option should display version text, then exit.std.optparse:parse (arglist)Parse arglist.
                  @@ -228,13 +237,14 @@

                  Functions

                  Instantiate a new parser. Read the documented options from spec and return a new parser that can be passed to parse for parsing those options from an argument - list. + list. Options are recognised as lines that begin with at least two + spaces, followed by a hyphen.

                  Parameters:

                  @@ -250,99 +260,27 @@

                  Returns:

                  - -

                  Tables

                  -
                  - - std.optparse.boolvals -
                  -
                  - Map various option strings to equivalent Lua boolean values. - - -

                  Fields:

                  -
                    -
                  • false - false -
                  • -
                  • 0 - false -
                  • -
                  • no - false -
                  • -
                  • n - false -
                  • -
                  • true - true -
                  • -
                  • 1 - true -
                  • -
                  • yes - true -
                  • -
                  • y - true -
                  • -
                  - - - - - -
                  -
                  - - std.optparse.opts -
                  -
                  - Parsed options table, with a key for each encountered option, each - with value set by that option's on_handler. - - - - - - - -
                  -
                  - - std.optparse.parser -
                  -
                  - Customized parser for your options. - - - - - - - -
                  -
                  -

                  Methods

                  -
                  -
                  - - std.optparse:boolean (opt[, optarg="1"]) + + std.optparse.boolean (opt[, optarg="1"])
                  Return a Lua boolean equivalent of various optarg strings. - Report an option parse error if optarg is not recognised. + Report an option parse error if optarg is not recognised.

                  + +

                  Pass this as the value function to on when you want various + truthy or falsey option arguments to be coerced to a Lua true + or false respectively in the options table.

                  Parameters:

                  - - std.optparse:file (opt, optarg) + + std.optparse.file (opt, optarg)
                  Report an option parse error unless optarg names an - existing file. + existing file.

                  + +

                  Pass this as the value function to on when you want to accept + only option arguments that name an existing file.

                  Parameters:

                  @@ -394,18 +335,26 @@

                  Returns:

                  - - std.optparse:finished (arglist, i) + + std.optparse.finished (arglist, i)
                  - Finish option processing - Usually indicated by -- at arglist[i]. + Finish option processing

                  + +

                  This is the handler automatically assigned to the option written as + -- in the OptionParser spec argument. You can also pass it as + the handler argument to on if you want to manually add an end + of options marker without writing it in the OptionParser spec.

                  + +

                  This handler tells the parser to stop processing arguments, so that + anything after it will be an argument even if it otherwise looks + like an option.

                  Parameters:

                  • arglist - table + table list of arguments
                  • i @@ -426,17 +375,29 @@

                    Returns:

                  - - std.optparse:flag (arglist, i[, value]) + + std.optparse.flag (arglist, i[, value])
                  - Option at arglist[i] is a boolean switch. + Option at arglist[i] is a boolean switch.

                  + +

                  This is the handler automatically assigned to options that have + --long-opt or -x style specifications in the OptionParser spec + argument. You can also pass it as the handler argument to on for + options you want to add manually without putting them in the + OptionParser spec.

                  + +

                  Beware that, unlike required, this handler will store multiple + occurrences of a command-line option as a table only when given a + value function. Automatically assigned handlers do not do this, so + the option will simply be true if the option was given one or more + times on the command-line.

                  Parameters:

                  • arglist - table + table list of arguments
                  • i @@ -461,11 +422,14 @@

                    Returns:

                  - - std.optparse:help () + + std.optparse.help ()
                  - Option should display help text, then exit. + Option should display help text, then exit.

                  + +

                  This is the handler automatically assigned tooptions that have + --help in the specification, e.g. -h, -?, --help. @@ -475,75 +439,112 @@

                  Returns:

                  - - std.optparse:normalise (arglist) + + std.optparse.opterr (msg)
                  - Normalise an argument list. - Separate short options, remove = separators from - --long-option=optarg etc. + Report an option parse error, then exit with status 2.

                  + +

                  Use this in your custom option handlers for consistency with the + error output from built-in optparse error messages.

                  Parameters:

                    -
                  • arglist - table - list of arguments to normalise +
                  • msg + string + error message
                  -

                  Returns:

                  -
                    - - table - normalised argument list -
                  - - std.optparse:on (name, handler, value) + + std.optparse.optional (arglist, i[, value=true])
                  - Add an option handler. + Option at arglist[i] can take an argument. + Argument is accepted only if there is a following entry that does not + begin with a '-'.

                  + +

                  This is the handler automatically assigned to options that have + --opt=[ARG] style specifications in the OptionParser spec + argument. You can also pass it as the handler argument to on for + options you want to add manually without putting them in the + OptionParser spec.

                  + +

                  Like required, this handler will store multiple occurrences of a + command-line option.

                  Parameters:

                    -
                  • name - opts - of the option, or list of option names +
                  • arglist + table + list of arguments
                  • -
                  • handler - on_handler - function to call when any of opts is - encountered +
                  • i + int + index of last processed element of arglist
                  • value - additional value passed to on_handler + either a function to process the option + argument, or a default value if encountered without an optarg + (default true)
                  +

                  Returns:

                  +
                    + + int + index of next element of arglist to process +
                  - - std.optparse:on_handler (arglist, i[, value=nil]) + + std.optparse.required (arglist, i[, value])
                  - Function signature of an option handler for on. + +

                  Option at arglist[i} requires an argument.

                  + +

                  This is the handler automatically assigned to options that have + --opt=ARG style specifications in the OptionParser spec argument. + You can also pass it as the handler argument to on for options + you want to add manually without putting them in the OptionParser + spec.

                  + +

                  Normally the value stored in the opt table by this handler will be + the string given as the argument to that option on the command line. + However, if the option is given on the command-line multiple times, + opt["name"] will end up with all those arguments stored in the + array part of a table:

                  + +
                   $ cat ./prog
                  + ...
                  + parser:on ({"-e", "-exec"}, required)
                  + _G.arg, _G.opt = parser:parse (_G.arg)
                  + print std.string.tostring (_G.opt.exec)
                  + ...
                  + $ ./prog -e '(foo bar)' -e '(foo baz)' -- qux
                  + {1=(foo bar),2=(foo baz)}
                  +
                  +

                  Parameters:

                  • arglist - table + table list of arguments
                  • i @@ -551,8 +552,8 @@

                    Parameters:

                    index of last processed element of arglist
                  • value - additional value registered with on - (default nil) + either a function to process the option argument, + or a forced value to replace the user's option argument.
                  @@ -568,162 +569,267 @@

                  Returns:

                  - - std.optparse:opterr (msg) + + std.optparse.version ()
                  - Report an option parse error, then exit with status 2. + Option should display version text, then exit.

                  + +

                  This is the handler automatically assigned tooptions that have + --version in the specification, e.g. -V, --version. -

                  Parameters:

                  -
                    -
                  • msg - string - error message -
                  • -
                  +
                  +

                  Tables

                  +
                  - - std.optparse:optional (arglist, i[, value=true]) + + std.optparse.boolvals
                  - Option at arglist[i] can take an argument. - Argument is accepted only if there is a following entry that does not - begin with a '-'. + Map various option strings to equivalent Lua boolean values. -

                  Parameters:

                  +

                  Fields:

                    -
                  • arglist - table - list of arguments +
                  • false + false
                  • -
                  • i - int - index of last processed element of arglist +
                  • 0 + false
                  • -
                  • value - either a function to process the option - argument, or a default value if encountered without an optarg - (default true) +
                  • no + false +
                  • +
                  • n + false +
                  • +
                  • true + true +
                  • +
                  • 1 + true +
                  • +
                  • yes + true +
                  • +
                  • y + true
                  -

                  Returns:

                  -
                    - int - index of next element of arglist to process -
                  + + + +
                  +
                  + + std.optparse.opts +
                  +
                  + Parsed options table, with a key for each encountered option, each + with value set by that option's on_handler. Where an option + has one or more long-options specified, the key will be the first + one of those with leading hyphens stripped and non-alphanumeric + characters replaced with underscores. For options that can only be + specified by a short option, the key will be the letter of the first + of the specified short options:

                  + +
                   {"-e", "--eval-file"} => opts.eval_file
                  + {"-n", "--dryrun", "--dry-run"} => opts.dryrun
                  + {"-t", "-T"} => opts.t
                  +
                  + +

                  Generally there will be one key for each previously specified + option (either automatically assigned by OptionParser or + added manually with on) containing the value(s) assigned by the + associated on_handler. For automatically assigned handlers, + that means true for straight-forward flags and + optional-argument options for which no argument was given; or else + the string value of the argument passed with an option given only + once; or a table of string values of the same for arguments given + multiple times.

                  + +
                   ./prog -x -n -x => opts = { x = true, dryrun = true }
                  + ./prog -e '(foo bar)' -e '(foo baz)'
                  +     => opts = {eval_file = {"(foo bar)", "(foo baz)"} }
                  +
                  + +

                  If you write your own handlers, or otherwise specify custom + handling of options with on, then whatever value those handlers + return will be assigned to the respective keys in opts . + + +

                  - - std.optparse:parse (arglist) + + std.optparse.parser
                  - Parse arglist. + Customized parser for your options.

                  +

                  This table is returned by OptionParser, and most importantly has + the parse method you call to fill the opts table according to + what command-line options were passed to your program. -

                  Parameters:

                  + +

                  Fields:

                    -
                  • arglist - table - list of arguments +
                  • program + string + the first word following Usage: in OptionParser + spec string +
                  • +
                  • version + string + the last white-space delimited word on the first line + of text in the spec string +
                  • +
                  • versiontext + string + everything preceding Usage: in the spec string, + and which will be displayed by the version on_handler +
                  • +
                  • helptext + string + everything including and following Usage: in the + spec string and which will be displayed by the help + on_handler +
                  • +
                  • parse + func + see parse +
                  • +
                  • on + func + see on
                  -

                  Returns:

                  -
                    -
                  1. - table - a list of unrecognised arglist elements
                  2. -
                  3. - opts - parsing results
                  4. -
                  +
                  +

                  Methods

                  +
                  - - std.optparse:required (arglist, i[, value]) + + std.optparse:on (name, handler, value)
                  - Option at arglist[i} requires an argument. + +

                  Add an option handler.

                  + +

                  When the automatically assigned option handlers don't do everything + you require, or when you don't want to put an option into the + OptionParser spec argument, use this function to specify custom + behaviour. If you write the option into the spec argument anyway, + calling this function will replace the automatically assigned handler + with your own.

                  + +
                   parser:on ("--", parser.finished)
                  + parser:on ("-V", parser.version)
                  + parser:on ("--config-file", parser.required, parser.file)
                  + parser:on ("--enable-nls", parser.optional, parser.boolean)
                  +
                  +

                  Parameters:

                    -
                  • arglist - table - list of arguments +
                  • name + opts + of the option, or list of option names
                  • -
                  • i - int - index of last processed element of arglist +
                  • handler + on_handler + function to call when any of opts is + encountered
                  • value - either a function to process the option argument, - or a forced value to replace the user's option argument. + additional value passed to on_handler
                  -

                  Returns:

                  -
                    - - int - index of next element of arglist to process -
                  - - std.optparse:set (opt, value) + + std.optparse:on_handler (arglist, i[, value=nil])
                  - Store value with opt. + Function signature of an option handler for on.

                  Parameters:

                    -
                  • opt - string - option name +
                  • arglist + table + list of arguments +
                  • +
                  • i + int + index of last processed element of arglist
                  • value - option argument value + additional value registered with on + (default nil)
                  +

                  Returns:

                  +
                    + + int + index of next element of arglist to process +
                  - - std.optparse:version () + + std.optparse:parse (arglist)
                  - Option should display version text, then exit. + Parse arglist. +

                  Parameters:

                  +
                    +
                  • arglist + table + list of arguments +
                  • +
                  +

                  Returns:

                  +
                    +
                  1. + table + a list of unrecognised arglist elements
                  2. +
                  3. + opts + parsing results
                  4. +
                  @@ -735,7 +841,7 @@

                  Parameters:

                  -generated by LDoc 1.4.0 +generated by LDoc 1.4.2
                  diff --git a/classes/std.set.html b/classes/std.set.html index b291a94..035f68e 100644 --- a/classes/std.set.html +++ b/classes/std.set.html @@ -3,7 +3,7 @@ - stdlib 37 Reference + stdlib 38 Reference @@ -206,7 +206,7 @@

                  Parameters:

                  a set
                • set2 - table or set + table or set another set, or table
                @@ -257,7 +257,7 @@

                Parameters:

                a set
              • set2 - table or set + table or set another set, or table
              @@ -316,7 +316,7 @@

              Parameters:

              a set
            • set2 - table or set + table or set another set, or table
            @@ -376,7 +376,7 @@

            Parameters:

            a set
          • set2 - table or set + table or set another set, or table
          @@ -406,7 +406,7 @@

          Parameters:

          a set
        • set2 - table or set + table or set another set, or table
        @@ -436,7 +436,7 @@

        Parameters:

        a set
      • set2 - table or set + table or set another set, or table
      @@ -466,7 +466,7 @@

      Parameters:

      a set
    • set2 - table or set + table or set another set, or table
    @@ -495,17 +495,17 @@

    Tables

    Fields:

    @@ -578,7 +578,7 @@

    Parameters:

    set
  • table - table or set + table or set another set or table
  • @@ -617,7 +617,7 @@

    Parameters:

    set
  • table - table or set + table or set another set or table
  • @@ -656,7 +656,7 @@

    Parameters:

    set
  • table - table or set + table or set another set or table
  • @@ -695,7 +695,7 @@

    Parameters:

    set
  • table - table or set + table or set another set or table
  • @@ -734,7 +734,7 @@

    Parameters:

    set
  • table - table or set + table or set another set or table
  • @@ -760,7 +760,7 @@

    See also:

    -generated by LDoc 1.4.0 +generated by LDoc 1.4.2
    diff --git a/classes/std.strbuf.html b/classes/std.strbuf.html index cefb45c..5b9e82f 100644 --- a/classes/std.strbuf.html +++ b/classes/std.strbuf.html @@ -3,7 +3,7 @@ - stdlib 37 Reference + stdlib 38 Reference @@ -119,7 +119,7 @@

    Parameters:

    StrBuf object
  • str - string + string a string or string-like object
  • @@ -162,7 +162,7 @@

    Parameters:

    Returns:

      - string + string concatenation of buffer contents
    @@ -188,7 +188,7 @@

    Methods

    Parameters:

    @@ -224,7 +224,7 @@

    Parameters:

    Returns:

      - string + string stringified self
    @@ -238,7 +238,7 @@

    Returns:

    -generated by LDoc 1.4.0 +generated by LDoc 1.4.2
    diff --git a/classes/std.tree.html b/classes/std.tree.html index f6ffff8..a8f9e36 100644 --- a/classes/std.tree.html +++ b/classes/std.tree.html @@ -3,7 +3,7 @@ - stdlib 37 Reference + stdlib 38 Reference @@ -139,7 +139,7 @@

    Functions

    Parameters:

    • t - table or tree + table or tree table or tree to be cloned
    • nometa @@ -151,7 +151,7 @@

      Parameters:

      Returns:

        - table or tree + table or tree a deep copy of t
      @@ -170,7 +170,7 @@

      Returns:

      Parameters:

      @@ -181,7 +181,7 @@

      Returns:

      function iterator function
    • - tree or table + tree or table the tree tr
    • @@ -203,7 +203,7 @@

      Returns:

      Parameters:

      @@ -214,7 +214,7 @@

      Returns:

      function iterator function
    • - tree or table + tree or table the tree, tr
    • @@ -237,7 +237,7 @@

      See also:

      Parameters:

      @@ -248,7 +248,7 @@

      Returns:

      function iterator function
    • - tree or table + tree or table the tree, tr
    • @@ -267,11 +267,11 @@

      Returns:

      Parameters:

      @@ -279,7 +279,7 @@

      Parameters:

      Returns:

        - tree or table + tree or table t with nodes from u merged in
      @@ -335,7 +335,7 @@

      See also:

      Parameters:

      @@ -346,7 +346,7 @@

      Returns:

      function iterator function
    • - tree or table + tree or table the tree, tr
    • @@ -372,18 +372,18 @@

      Tables

      Fields:

      • _init - table or function + table or function a table of field names, or initialisation function, see std.object.__call (default {})
      • _functions - nil or table + nil or table a table of module functions not copied by std.object.__call
      • _type - string + string type of Tree, returned by std.object.prototype (default "Tree") @@ -454,7 +454,7 @@

        Parameters:

        -generated by LDoc 1.4.0 +generated by LDoc 1.4.2
        diff --git a/index.html b/index.html index 12a01ee..d422ffa 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - stdlib 37 Reference + stdlib 38 Reference @@ -133,7 +133,7 @@

        Classes

        -generated by LDoc 1.4.0 +generated by LDoc 1.4.2
        diff --git a/modules/std.debug.html b/modules/std.debug.html index 615896c..a6f797d 100644 --- a/modules/std.debug.html +++ b/modules/std.debug.html @@ -3,7 +3,7 @@ - stdlib 37 Reference + stdlib 38 Reference @@ -201,7 +201,7 @@

        Fields:

        -generated by LDoc 1.4.0 +generated by LDoc 1.4.2
        diff --git a/modules/std.functional.html b/modules/std.functional.html index b9730a2..51d6393 100644 --- a/modules/std.functional.html +++ b/modules/std.functional.html @@ -3,7 +3,7 @@ - stdlib 37 Reference + stdlib 38 Reference @@ -494,7 +494,7 @@

        Fields:

        -generated by LDoc 1.4.0 +generated by LDoc 1.4.2
        diff --git a/modules/std.html b/modules/std.html index b5efcff..717aa6f 100644 --- a/modules/std.html +++ b/modules/std.html @@ -3,7 +3,7 @@ - stdlib 37 Reference + stdlib 38 Reference @@ -744,7 +744,7 @@

        Metamethods

        Parameters:

        @@ -765,7 +765,7 @@

        Returns:

        -generated by LDoc 1.4.0 +generated by LDoc 1.4.2
        diff --git a/modules/std.io.html b/modules/std.io.html index c1109d9..fc955af 100644 --- a/modules/std.io.html +++ b/modules/std.io.html @@ -3,7 +3,7 @@ - stdlib 37 Reference + stdlib 38 Reference @@ -176,6 +176,8 @@

        Returns:

        Die with error. + This function uses the same rules to build a message prefix + as std.io.warn.

        Parameters:

        @@ -187,6 +189,10 @@

        Parameters:

        +

        See also:

        +
        @@ -320,7 +326,24 @@

        Returns:

        warn (...)
        - Give warning with the name of program and file (if any). + +

        Give warning with the name of program and file (if any). + If there is a global prog table, prefix the message with + prog.name or prog.file, and prog.line if any. Otherwise + if there is a global opts table, prefix the message with + opts.program and opts.line if any. std.optparse:parse + returns an opts table that provides the required program + field, as long as you assign it back to _G.opts:

        + +
         local OptionParser = require "std.optparse"
        + local parser = OptionParser "eg 0\nUsage: eg\n"
        + _G.arg, _G.opts = parser:parse (_G.arg)
        + if not _G.opts.keep_going then
        +   require "std.io".warn "oh noes!"
        + end
        +
        + +

        Parameters:

        @@ -332,6 +355,10 @@

        Parameters:

        +

        See also:

        +
        @@ -364,7 +391,7 @@

        Parameters:

        -generated by LDoc 1.4.0 +generated by LDoc 1.4.2
        diff --git a/modules/std.math.html b/modules/std.math.html index eb857ed..1455e3b 100644 --- a/modules/std.math.html +++ b/modules/std.math.html @@ -3,7 +3,7 @@ - stdlib 37 Reference + stdlib 38 Reference @@ -150,7 +150,7 @@

        Returns:

        -generated by LDoc 1.4.0 +generated by LDoc 1.4.2
        diff --git a/modules/std.package.html b/modules/std.package.html index 7c0b2eb..63712df 100644 --- a/modules/std.package.html +++ b/modules/std.package.html @@ -3,7 +3,7 @@ - stdlib 37 Reference + stdlib 38 Reference @@ -124,7 +124,7 @@

        Fields:

        -generated by LDoc 1.4.0 +generated by LDoc 1.4.2
        diff --git a/modules/std.strict.html b/modules/std.strict.html index cfdc552..a595470 100644 --- a/modules/std.strict.html +++ b/modules/std.strict.html @@ -3,7 +3,7 @@ - stdlib 37 Reference + stdlib 38 Reference @@ -123,7 +123,7 @@

        Functions

        -generated by LDoc 1.4.0 +generated by LDoc 1.4.2
        diff --git a/modules/std.string.html b/modules/std.string.html index f99a396..c734fd0 100644 --- a/modules/std.string.html +++ b/modules/std.string.html @@ -3,7 +3,7 @@ - stdlib 37 Reference + stdlib 38 Reference @@ -166,7 +166,7 @@

        Functions

        Remove trailing matter from a string. - split (s, sep) + split (s[, sep="%s*"]) Split a string at a given separator. @@ -847,26 +847,33 @@

        Returns:

        - split (s, sep) + split (s[, sep="%s*"])
        Split a string at a given separator. + Separator is a Lua pattern, so you have to escape active characters, + ^$()%.[]*+-? with a % prefix to match a literal character in s .

        Parameters:

        • s - string to split + string + to split
        • sep + string separator pattern + (default "%s*")

        Returns:

          - - list of strings +
        1. + list of strings
        2. +
        3. + list of strings
        @@ -1069,7 +1076,7 @@

        Fields

        -generated by LDoc 1.4.0 +generated by LDoc 1.4.2
        diff --git a/modules/std.table.html b/modules/std.table.html index 96ebab2..d992c03 100644 --- a/modules/std.table.html +++ b/modules/std.table.html @@ -3,7 +3,7 @@ - stdlib 37 Reference + stdlib 38 Reference @@ -145,7 +145,7 @@

        Functions

        Parameters:

        • t - table + table
            source table
           
          @@ -178,11 +178,11 @@

          Returns:

          Parameters:

          @@ -208,7 +208,7 @@

          Returns:

          Parameters:

          @@ -234,7 +234,7 @@

          Returns:

          Parameters:

          @@ -242,7 +242,7 @@

          Parameters:

          Returns:

            - table + table inverted table {v=k, ...}
          @@ -261,7 +261,7 @@

          Returns:

          Parameters:

          @@ -269,7 +269,7 @@

          Parameters:

          Returns:

            - table + table list of keys
          @@ -288,11 +288,11 @@

          Returns:

          Parameters:

          @@ -321,7 +321,7 @@

          Parameters:

          default entry value (default: nil)
        • t - table + table initial table (default: {})
        @@ -329,7 +329,7 @@

        Parameters:

        Returns:

          - table + table table whose unset elements are x
        @@ -373,7 +373,7 @@

        Returns:

        Parameters:

        @@ -384,7 +384,7 @@

        Returns:

        function iterator function
      • - table + table the table, t
      • number @@ -406,7 +406,7 @@

        Returns:

        Parameters:

        @@ -432,7 +432,7 @@

        Returns:

        Parameters:

        • t - table + table unsorted table
        • c @@ -470,7 +470,7 @@

          Parameters:

          Returns:

            - table + table resulting table or nil
          @@ -489,7 +489,7 @@

          Returns:

          Parameters:

          @@ -497,7 +497,7 @@

          Parameters:

          Returns:

            - table + table list of values
          @@ -511,7 +511,7 @@

          Returns:

          -generated by LDoc 1.4.0 +generated by LDoc 1.4.2
          From f51ff3a142abbea1cd758f1ea49c5376399c37ea Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Wed, 23 Apr 2014 18:05:05 +0700 Subject: [PATCH 09/15] gh-pages: update for v39. Signed-off-by: Gary V. Vaughan --- classes/std.container.html | 2 +- classes/std.list.html | 6 +- classes/std.object.html | 2 +- classes/std.optparse.html | 10 +- classes/std.set.html | 6 +- classes/std.strbuf.html | 2 +- classes/std.tree.html | 2 +- index.html | 2 +- modules/std.debug.html | 2 +- modules/std.functional.html | 68 ++++++++-- modules/std.html | 2 +- modules/std.io.html | 4 +- modules/std.math.html | 2 +- modules/std.package.html | 241 +++++++++++++++++++++++++++++++++++- modules/std.strict.html | 2 +- modules/std.string.html | 120 +++++------------- modules/std.table.html | 41 +++--- 17 files changed, 382 insertions(+), 132 deletions(-) diff --git a/classes/std.container.html b/classes/std.container.html index 613f274..92391de 100644 --- a/classes/std.container.html +++ b/classes/std.container.html @@ -3,7 +3,7 @@ - stdlib 38 Reference + stdlib 39 Reference diff --git a/classes/std.list.html b/classes/std.list.html index 5422e25..3d37b6f 100644 --- a/classes/std.list.html +++ b/classes/std.list.html @@ -3,7 +3,7 @@ - stdlib 38 Reference + stdlib 39 Reference @@ -1135,7 +1135,7 @@

          Parameters:

          See also:

          @@ -1168,7 +1168,7 @@

          Parameters:

          See also:

          diff --git a/classes/std.object.html b/classes/std.object.html index fd6c8a7..05bbeab 100644 --- a/classes/std.object.html +++ b/classes/std.object.html @@ -3,7 +3,7 @@ - stdlib 38 Reference + stdlib 39 Reference diff --git a/classes/std.optparse.html b/classes/std.optparse.html index 2a0ac2a..05f451d 100644 --- a/classes/std.optparse.html +++ b/classes/std.optparse.html @@ -3,7 +3,7 @@ - stdlib 38 Reference + stdlib 39 Reference @@ -218,7 +218,7 @@

          Methods

          Function signature of an option handler for on. - std.optparse:parse (arglist) + std.optparse:parse (arglist[, defaults]) Parse arglist. @@ -807,7 +807,7 @@

          Returns:

          - std.optparse:parse (arglist) + std.optparse:parse (arglist[, defaults])
          Parse arglist. @@ -819,6 +819,10 @@

          Parameters:

          table list of arguments
        • +
        • defaults + table + table of default option values +

        Returns:

        diff --git a/classes/std.set.html b/classes/std.set.html index 035f68e..a6de351 100644 --- a/classes/std.set.html +++ b/classes/std.set.html @@ -3,7 +3,7 @@ - stdlib 38 Reference + stdlib 39 Reference @@ -69,8 +69,8 @@

        Class std.set

        Set container.

        Derived from std.container, and inherits Container's metamethods.

        -

        Note that Functions listed below are available only available from the - Set prototype returned by requiring this module, because Container +

        Note that Functions listed below are only available from the Set + prototype returned by requiring this module, because Container objects cannot have object methods.

        diff --git a/classes/std.strbuf.html b/classes/std.strbuf.html index 5b9e82f..5ff78cf 100644 --- a/classes/std.strbuf.html +++ b/classes/std.strbuf.html @@ -3,7 +3,7 @@ - stdlib 38 Reference + stdlib 39 Reference diff --git a/classes/std.tree.html b/classes/std.tree.html index a8f9e36..1f56bde 100644 --- a/classes/std.tree.html +++ b/classes/std.tree.html @@ -3,7 +3,7 @@ - stdlib 38 Reference + stdlib 39 Reference diff --git a/index.html b/index.html index d422ffa..31e52fc 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - stdlib 38 Reference + stdlib 39 Reference diff --git a/modules/std.debug.html b/modules/std.debug.html index a6f797d..3802b07 100644 --- a/modules/std.debug.html +++ b/modules/std.debug.html @@ -3,7 +3,7 @@ - stdlib 38 Reference + stdlib 39 Reference diff --git a/modules/std.functional.html b/modules/std.functional.html index 51d6393..1ccfd60 100644 --- a/modules/std.functional.html +++ b/modules/std.functional.html @@ -3,7 +3,7 @@ - stdlib 38 Reference + stdlib 39 Reference @@ -74,10 +74,14 @@

        Module std.functional

        Functions

        - + + + + + @@ -134,7 +138,7 @@

        Functions

        - bind (f, ...) + bind (f, p1)
        Partially apply a function. @@ -145,15 +149,58 @@

        Parameters:

      • f function to apply partially
      • -
      • ... - arguments to bind +
      • p1 + table + =a1, ..., pn=an} table of parameters to bind to given arguments
      • Returns:

          - function with ai already bound + function with pi already bound +
        + + + + +
        +
        + + case (with, branches) +
        +
        + +

        A rudimentary case statement. + Match with against keys in branches table, and return the result + of running the function in the table value for the matching key, or + the first non-key value function if no key matches.

        + +
         return case (type (object), {
        +   table  = function ()  return something end,
        +   string = function ()  return something else end,
        +            function (s) error ("unhandled type: "..s) end,
        + })
        +
        + + + + +

        Parameters:

        +
          +
        • with + expression to match +
        • +
        • branches + table + map possible matches to functions +
        • +
        + +

        Returns:

        +
          + + the return value from function with a matching key, or nil.
        @@ -197,7 +244,14 @@

        Returns:

        Returns:

          - composition of f1 ... fn + composition of fn (... (f1) ...): note that this is the reverse + of what you might expect, but means that code like:

          + +
           functional.compose (function (x) return f (x) end,
          +                     function (x) return g (x) end))
          +
          + +

          can be read from top to bottom.

        diff --git a/modules/std.html b/modules/std.html index 717aa6f..9f51b5f 100644 --- a/modules/std.html +++ b/modules/std.html @@ -3,7 +3,7 @@ - stdlib 38 Reference + stdlib 39 Reference diff --git a/modules/std.io.html b/modules/std.io.html index fc955af..129f739 100644 --- a/modules/std.io.html +++ b/modules/std.io.html @@ -3,7 +3,7 @@ - stdlib 38 Reference + stdlib 39 Reference @@ -373,7 +373,7 @@

        See also:

        Parameters:

        • h - file handle (default: io.output () + file handle (default: io.output ())
        • ... values to write (as for write) diff --git a/modules/std.math.html b/modules/std.math.html index 1455e3b..534ce7e 100644 --- a/modules/std.math.html +++ b/modules/std.math.html @@ -3,7 +3,7 @@ - stdlib 38 Reference + stdlib 39 Reference diff --git a/modules/std.package.html b/modules/std.package.html index 63712df..620b004 100644 --- a/modules/std.package.html +++ b/modules/std.package.html @@ -3,7 +3,7 @@ - stdlib 38 Reference + stdlib 39 Reference @@ -32,6 +32,7 @@

          stdlib

          Contents

          @@ -70,6 +71,33 @@

          Module std.package

          +

          Functions

          +
        bind (f, ...)bind (f, p1) Partially apply a function.
        case (with, branches)A rudimentary case statement.
        collect (i) Collect the results of an iterator.
        + + + + + + + + + + + + + + + + + + + + + + + + +
        find (pathstrings, patt[, init=1[, plain=false]])Look for a path segment match of patt in pathstrings.
        insert (pathstrings[, pos=n+1], value)Insert a new element into a package.path like string of paths.
        mappath (pathstrings, callback, ...)Call a function with each element of a path string.
        mappath_callback (element, ...)Function signature of a callback for mappath.
        normalize (...)Normalize a path list.
        remove (pathstrings[, pos=n])Remove any element from a package.path like string of paths.

        Tables

        @@ -83,6 +111,217 @@

        Tables


        +

        Functions

        +
        +
        + + find (pathstrings, patt[, init=1[, plain=false]]) +
        +
        + Look for a path segment match of patt in pathstrings. + + +

        Parameters:

        +
          +
        • pathstrings + string + pathsep delimited path elements +
        • +
        • patt + string + a Lua pattern to search for in pathstrings +
        • +
        • init + int + element (not byte index!) to start search at. + Negative numbers begin counting backwards from the last element + (default 1) +
        • +
        • plain + bool + unless false, treat patt as a plain + string, not a pattern. Note that if plain is given, then init + must be given as well. + (default false) +
        • +
        + +

        Returns:

        +
          + + the matching element number (not byte index!) and full text + of the matching element, if any; otherwise nil +
        + + + + +
        +
        + + insert (pathstrings[, pos=n+1], value) +
        +
        + Insert a new element into a package.path like string of paths. + + +

        Parameters:

        +
          +
        • pathstrings + string + a package.path like string +
        • +
        • pos + int + element index at which to insert value, where n is + the number of elements prior to insertion + (default n+1) +
        • +
        • value + string + new path element to insert +
        • +
        + +

        Returns:

        +
          + + string + a new string with the new element inserted +
        + + + + +
        +
        + + mappath (pathstrings, callback, ...) +
        +
        + Call a function with each element of a path string. + + +

        Parameters:

        +
          +
        • pathstrings + string + a package.path like string +
        • +
        • callback + mappath_callback + function to call for each element +
        • +
        • ... + additional arguments passed to callback +
        • +
        + +

        Returns:

        +
          + + nil, or first non-nil returned by callback +
        + + + + +
        +
        + + mappath_callback (element, ...) +
        +
        + Function signature of a callback for mappath. + + +

        Parameters:

        +
          +
        • element + string + an element from a pathsep delimited string of + paths +
        • +
        • ... + additional arguments propagated from mappath +
        • +
        + +

        Returns:

        +
          + + non-nil to break, otherwise continue with the next element +
        + + + + +
        +
        + + normalize (...) +
        +
        + Normalize a path list. + Removing redundant . and .. directories, and keep only the first + instance of duplicate elements. Each argument can contain any number + of pathsep delimited elements; wherein characters are subject to + / and ? normalization, converting / to dirsep and ? to + path_mark (unless immediately preceded by a % character). + + +

        Parameters:

        +
          +
        • ... + path elements +
        • +
        + +

        Returns:

        +
          + + string + a single normalized pathsep delimited paths string +
        + + + + +
        +
        + + remove (pathstrings[, pos=n]) +
        +
        + Remove any element from a package.path like string of paths. + + +

        Parameters:

        +
          +
        • pathstrings + string + a package.path like string +
        • +
        • pos + int + element index from which to remove an item, where n + is the number of elements prior to removal + (default n) +
        • +
        + +

        Returns:

        +
          + + string + a new string with given element removed +
        + + + + +
        +

        Tables

        diff --git a/modules/std.strict.html b/modules/std.strict.html index a595470..c68fd7e 100644 --- a/modules/std.strict.html +++ b/modules/std.strict.html @@ -3,7 +3,7 @@ - stdlib 38 Reference + stdlib 39 Reference diff --git a/modules/std.string.html b/modules/std.string.html index c734fd0..8af1ec3 100644 --- a/modules/std.string.html +++ b/modules/std.string.html @@ -3,7 +3,7 @@ - stdlib 38 Reference + stdlib 39 Reference @@ -33,7 +33,6 @@

        stdlib

        Contents

        @@ -68,6 +67,37 @@

        Module std.string

        Additions to the string module.

        + +

        If you require "std", the contents of this module are all available + in the std.string table.

        + +

        However, this module also contains references to the Lua core string + table entries, so it's safe to load it like this:

        + +
         local string = require "std.string"
        +
        + +

        Of course, if you do that you'll lose references to any core string + functions overwritten by std.string , so you might want to save any + that you want access to before you overwrite them.

        + +

        If your code does not require "std" anywhere, then you'll also need + to manually overwrite string functions in the global namespace if you + want to use them from there:

        + +
         local assert, tostring = string.assert, string.tostring
        +
        + +

        And finally, to use the string metatable improvements with all core + strings, you'll need to merge this module's metatable into the core + string metatable (again, require "std" does this automatically):

        + +
         local string_metatable = getmetatable ""
        + string_metatable.__append = string.__append
        + string_metatable.__concat = string.__concat
        + string_metatable.__index = string.__index
        +
        +

        @@ -186,21 +216,6 @@

        Functions

        Wrap a string into a paragraph.
        -

        Fields

        - - - - - - - - - - - - - -
        sGive strings a subscription operator.
        sGive strings an append metamethod.
        sGive strings a concat metamethod.


        @@ -852,7 +867,7 @@

        Returns:

        Split a string at a given separator. Separator is a Lua pattern, so you have to escape active characters, - ^$()%.[]*+-? with a % prefix to match a literal character in s . + ^$()%.[]*+-? with a % prefix to match a literal character in s.

        Parameters:

        @@ -1000,75 +1015,6 @@

        Returns:

        -
        - -

        Fields

        -
        -
        - - s -
        -
        - Give strings a subscription operator. - - -
          -
        • s - string -
        • -
        • i - index -
        • -
        - - - - - -
        -
        - - s -
        -
        - Give strings an append metamethod. - - -
          -
        • s - string -
        • -
        • c - character (1-character string) -
        • -
        - - - - - -
        -
        - - s -
        -
        - Give strings a concat metamethod. - - -
          -
        • s - string -
        • -
        • o - object -
        • -
        - - - - -
        diff --git a/modules/std.table.html b/modules/std.table.html index d992c03..bd3fad9 100644 --- a/modules/std.table.html +++ b/modules/std.table.html @@ -3,7 +3,7 @@ - stdlib 38 Reference + stdlib 39 Reference @@ -73,12 +73,12 @@

        Module std.table

        Functions

        - + - - + + @@ -134,7 +134,7 @@

        Functions

        - clone (t, nometa) + clone (t[, map={}], nometa)
        Make a shallow copy of a table, including any metatable.

        @@ -146,10 +146,12 @@

        Parameters:

        • t table - -
            source table
          -
          - + source table +
        • +
        • map + table + table of {oldkey=newkey, ...} + (default {})
        • nometa boolean @@ -160,7 +162,8 @@

          Parameters:

          Returns:

            - copy of table + copy of t, also sharing t's metatable unless nometa + is true, and with keys renamed according to map
          @@ -168,29 +171,33 @@

          Returns:

        - - clone_rename (t, map) + + clone_select (t[, selection={}])
        - Clone a table, renaming some keys. + Make a partial clone of a table.

        + +

        Like clone , but does not copy any fields by default.

        Parameters:

        • t table - source table + source table
        • -
        • map +
        • selection table - table {oldkey=newkey, ...} + list of keys to copy + (default {})

        Returns:

          - copy of table + copy of fields in selection from t, also sharing t's + metatable unless nometa
        From 5e21ffe856fcd07bdfafe9c01e1116d58104ff31 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Thu, 1 May 2014 17:40:51 +0700 Subject: [PATCH 10/15] gh-pages: update for v40. Signed-off-by: Gary V. Vaughan --- classes/std.container.html | 2 +- classes/std.list.html | 6 +- classes/std.object.html | 2 +- classes/std.optparse.html | 2 +- classes/std.set.html | 2 +- classes/std.strbuf.html | 2 +- classes/std.tree.html | 2 +- index.html | 4 +- modules/std.debug.html | 2 +- modules/std.functional.html | 37 ++- modules/std.html | 624 +++--------------------------------- modules/std.io.html | 36 ++- modules/std.math.html | 2 +- modules/std.package.html | 2 +- modules/std.strict.html | 2 +- modules/std.string.html | 40 ++- modules/std.table.html | 138 +++++++- 17 files changed, 293 insertions(+), 612 deletions(-) diff --git a/classes/std.container.html b/classes/std.container.html index 92391de..35ce67d 100644 --- a/classes/std.container.html +++ b/classes/std.container.html @@ -3,7 +3,7 @@ - stdlib 39 Reference + stdlib 40 Reference diff --git a/classes/std.list.html b/classes/std.list.html index 3d37b6f..6996a2f 100644 --- a/classes/std.list.html +++ b/classes/std.list.html @@ -3,7 +3,7 @@ - stdlib 39 Reference + stdlib 40 Reference @@ -1135,7 +1135,7 @@

        Parameters:

        See also:

        @@ -1168,7 +1168,7 @@

        Parameters:

        See also:

        diff --git a/classes/std.object.html b/classes/std.object.html index 05bbeab..c30d9a5 100644 --- a/classes/std.object.html +++ b/classes/std.object.html @@ -3,7 +3,7 @@ - stdlib 39 Reference + stdlib 40 Reference diff --git a/classes/std.optparse.html b/classes/std.optparse.html index 05f451d..1ad8ebd 100644 --- a/classes/std.optparse.html +++ b/classes/std.optparse.html @@ -3,7 +3,7 @@ - stdlib 39 Reference + stdlib 40 Reference diff --git a/classes/std.set.html b/classes/std.set.html index a6de351..3b6fd70 100644 --- a/classes/std.set.html +++ b/classes/std.set.html @@ -3,7 +3,7 @@ - stdlib 39 Reference + stdlib 40 Reference diff --git a/classes/std.strbuf.html b/classes/std.strbuf.html index 5ff78cf..0fd26f0 100644 --- a/classes/std.strbuf.html +++ b/classes/std.strbuf.html @@ -3,7 +3,7 @@ - stdlib 39 Reference + stdlib 40 Reference diff --git a/classes/std.tree.html b/classes/std.tree.html index 1f56bde..6e33ccc 100644 --- a/classes/std.tree.html +++ b/classes/std.tree.html @@ -3,7 +3,7 @@ - stdlib 39 Reference + stdlib 40 Reference diff --git a/index.html b/index.html index 31e52fc..b9bac87 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - stdlib 39 Reference + stdlib 40 Reference @@ -63,7 +63,7 @@

        Modules

        clone (t, nometa)clone (t[, map={}], nometa) Make a shallow copy of a table, including any metatable.
        clone_rename (t, map)Clone a table, renaming some keys.clone_select (t[, selection={}])Make a partial clone of a table.
        empty (t)
        - + diff --git a/modules/std.debug.html b/modules/std.debug.html index 3802b07..08aa6a1 100644 --- a/modules/std.debug.html +++ b/modules/std.debug.html @@ -3,7 +3,7 @@ - stdlib 39 Reference + stdlib 40 Reference diff --git a/modules/std.functional.html b/modules/std.functional.html index 1ccfd60..918f20a 100644 --- a/modules/std.functional.html +++ b/modules/std.functional.html @@ -3,7 +3,7 @@ - stdlib 39 Reference + stdlib 40 Reference @@ -114,12 +114,12 @@

        Functions

        - + - - + +
        stdGlobal namespace scribbler.Submodule lazy loader.
        std.debug Map a function over an iterator.
        memoize (fn)memoize (fn, normalize) Memoize a function, by wrapping it in a functable.
        metamethod (x, n)Return given metamethod, if any, or nil.memoize_normalize (...)Signature of memoize normalize functions.

        Tables

        @@ -427,10 +427,15 @@

        Returns:

        - memoize (fn) + memoize (fn, normalize)
        - Memoize a function, by wrapping it in a functable. + Memoize a function, by wrapping it in a functable.

        + +

        To ensure that memoize always returns the same object for the same + arguments, it passes arguments to normalize (std.string.tostring + by default). You may need a more sophisticated function if memoize + should handle complicated argument equivalencies.

        Parameters:

        @@ -438,6 +443,9 @@

        Parameters:

      • fn function that returns a single result
      • +
      • normalize + [opt] function to normalize arguments +

      Returns:

      @@ -451,28 +459,25 @@

      Returns:

      - - metamethod (x, n) + + memoize_normalize (...)
      - Return given metamethod, if any, or nil. + Signature of memoize normalize functions.

      Parameters:

        -
      • x - object to get metamethod of -
      • -
      • n - name of metamethod to get +
      • ... + arguments

      Returns:

        - metamethod function or nil if no metamethod or not a - function + string + normalized arguments
      diff --git a/modules/std.html b/modules/std.html index 9f51b5f..e3dac79 100644 --- a/modules/std.html +++ b/modules/std.html @@ -3,7 +3,7 @@ - stdlib 39 Reference + stdlib 40 Reference @@ -66,130 +66,35 @@

      Classes

      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.

      +

      Submodule lazy loader.

      +

      After requiring this module, simply referencing symbols in the submodule + hierarchy will load the necessary modules on demand.

      -

      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.

      +

      Clients of older releases might be surprised by this new-found hygiene, + expecting the various changes that used to be automatically installed as + global symbols, or monkey patched into the core module tables and + metatables. Sometimes, it's still convenient to do that... when using + stdlib from the REPL, or in a prototype where you want to throw caution + to the wind and compatibility with other modules be damned, for example. + In that case, you can give stdlib permission to scribble all over your + namespaces with:

      + +

      local std = require "std".monkey_patch ()

      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.barrel ([namespace=_G])A barrel of monkey_patches.
      _G.warn ()Give a warning with the name of program and file (if any).monkey_patch ([namespace=_G])Overwrite core methods and metamethods with std enhanced versions.

      Tables

      - - - - @@ -210,502 +115,79 @@

      Metamethods

      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 () + + barrel ([namespace=_G])
      - Identity function. + A barrel of monkey_patches.

      +

      Scribble all over the given namespace, and apply all available + monkey_patch functions. - - -

      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:

      +

      Parameters:

      +

      Returns:

      +
        -
      -
      - - _G.tostring () -
      -
      - Extend tostring to work better on tables. - - - + table + module table + -

      See also:

      -
      - - _G.totable () + + monkey_patch ([namespace=_G])
      - Turn an object into a table, according to __totable metamethod. - + Overwrite core methods and metamethods with std enhanced versions.

      +

      Loads all std submodules with a monkey_patch method, and runs + them. - -

      See also:

      +

      Parameters:

      +

      Returns:

      +
        -
      -
      - - _G.warn () -
      -
      - Give a warning with the name of program and file (if any). - - - + table + the module table + -

      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 +

      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:

      diff --git a/modules/std.io.html b/modules/std.io.html index 129f739..450acb3 100644 --- a/modules/std.io.html +++ b/modules/std.io.html @@ -3,7 +3,7 @@ - stdlib 39 Reference + stdlib 40 Reference @@ -85,6 +85,10 @@

      Functions

      + + + + @@ -195,6 +199,36 @@

      See also:

      + +
      + + monkey_patch ([namespace=_G]) +
      +
      + Overwrite core methods and metamethods with std enhanced versions.

      + +

      Adds readlines and writelines metamethods to core file objects. + + +

      Parameters:

      +
        +
      • namespace + table + where to install global functions + (default _G) +
      • +
      + +

      Returns:

      +
        + + table + the module table +
      + + + +
      diff --git a/modules/std.math.html b/modules/std.math.html index 534ce7e..50408e6 100644 --- a/modules/std.math.html +++ b/modules/std.math.html @@ -3,7 +3,7 @@ - stdlib 39 Reference + stdlib 40 Reference diff --git a/modules/std.package.html b/modules/std.package.html index 620b004..1378d42 100644 --- a/modules/std.package.html +++ b/modules/std.package.html @@ -3,7 +3,7 @@ - stdlib 39 Reference + stdlib 40 Reference diff --git a/modules/std.strict.html b/modules/std.strict.html index c68fd7e..a2a8444 100644 --- a/modules/std.strict.html +++ b/modules/std.strict.html @@ -3,7 +3,7 @@ - stdlib 39 Reference + stdlib 40 Reference diff --git a/modules/std.string.html b/modules/std.string.html index 8af1ec3..d41ef7b 100644 --- a/modules/std.string.html +++ b/modules/std.string.html @@ -3,7 +3,7 @@ - stdlib 39 Reference + stdlib 40 Reference @@ -136,6 +136,10 @@

      Functions

      + + + + @@ -449,6 +453,40 @@

      Returns:

      + +
      + + monkey_patch ([namespace=_G]) +
      +
      + Overwrite core methods and metamethods with std enhanced versions.

      + +

      Adds auto-stringification to .. operator on core strings, and + integer indexing of strings with [] dereferencing.

      + +

      Also replaces core assert and tostring functions with + std.string versions. + + +

      Parameters:

      +
        +
      • namespace + table + where to install global functions + (default _G) +
      • +
      + +

      Returns:

      +
        + + table + the module table +
      + + + +
      diff --git a/modules/std.table.html b/modules/std.table.html index bd3fad9..e565d06 100644 --- a/modules/std.table.html +++ b/modules/std.table.html @@ -3,7 +3,7 @@ - stdlib 39 Reference + stdlib 40 Reference @@ -77,7 +77,7 @@

      Functions

      - + @@ -93,8 +93,20 @@

      Functions

      - - + + + + + + + + + + + + + + @@ -172,7 +184,7 @@

      Returns:

      - clone_select (t[, selection={}]) + clone_select (t[, keys={}])
      Make a partial clone of a table.

      @@ -186,7 +198,7 @@

      Parameters:

      table source table -
    • selection +
    • keys table list of keys to copy (default {}) @@ -286,10 +298,10 @@

      Returns:

    • - merge (t, u) + merge (t, u[, map={}], nometa)
      - Destructively merge another table's fields into table. + Destructively merge another table's fields into another.

      Parameters:

      @@ -302,6 +314,15 @@

      Parameters:

      table table with fields to merge +
    • map + table + table of {oldkey=newkey, ...} + (default {}) +
    • +
    • nometa + boolean + if non-nil don't copy metatable +
    • Returns:

      @@ -313,6 +334,107 @@

      Returns:

      +
      +
      + + merge_select (t, u[, keys={}], nometa) +
      +
      + Destructively merge another table's named fields into table.

      + +

      Like merge , but does not merge any fields by default. + + +

      Parameters:

      +
        +
      • t + table + destination table +
      • +
      • u + table + table with fields to merge +
      • +
      • keys + table + list of keys to copy + (default {}) +
      • +
      • nometa + boolean + if non-nil don't copy metatable +
      • +
      + +

      Returns:

      +
        + + copy of fields in selection from t, also sharing t's + metatable unless nometa +
      + + + + +
      +
      + + metamethod (x, n) +
      +
      + Return given metamethod, if any, or nil. + + +

      Parameters:

      +
        +
      • x + object to get metamethod of +
      • +
      • n + name of metamethod to get +
      • +
      + +

      Returns:

      +
        + + metamethod function or nil if no metamethod or not a + function +
      + + + + +
      +
      + + monkey_patch ([namespace=_G]) +
      +
      + Overwrite core methods with std enhanced versions.

      + +

      Replaces core table.sort with std.table version. + + +

      Parameters:

      +
        +
      • namespace + table + where to install global functions + (default _G) +
      • +
      + +

      Returns:

      +
        + + table + the module table +
      + + + +
      From 6731628a824fdca48c1f80b48965d8b848fed034 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Sat, 3 Jan 2015 20:28:26 +0000 Subject: [PATCH 11/15] gh-pages: update for v41.0.0 Signed-off-by: Gary V. Vaughan --- classes/std.container.html | 221 ++---- classes/std.list.html | 1500 ++++------------------------------- classes/std.object.html | 443 ++++++----- classes/std.optparse.html | 407 +++++----- classes/std.set.html | 497 +++++++----- classes/std.strbuf.html | 199 +++-- classes/std.tree.html | 318 +++++--- index.html | 32 +- ldoc.css | 15 +- modules/std.debug.html | 438 +++++++++- modules/std.functional.html | 720 ++++++++++++++--- modules/std.html | 576 +++++++++++++- modules/std.io.html | 296 +++++-- modules/std.math.html | 89 ++- modules/std.operator.html | 755 ++++++++++++++++++ modules/std.package.html | 156 ++-- modules/std.strict.html | 53 +- modules/std.string.html | 821 +++++++++++-------- modules/std.table.html | 729 ++++++++++++++--- 19 files changed, 5222 insertions(+), 3043 deletions(-) create mode 100644 modules/std.operator.html diff --git a/classes/std.container.html b/classes/std.container.html index 35ce67d..7add14c 100644 --- a/classes/std.container.html +++ b/classes/std.container.html @@ -3,7 +3,7 @@ - stdlib 40 Reference + stdlib 41.0.0 Reference @@ -24,7 +24,7 @@
      _G.opFunctional forms of infix operators.
      std Module table. Die with error.
      monkey_patch ([namespace=_G])Overwrite core methods and metamethods with std enhanced versions.
      process_files (f) Process files specified on the command-line.
      Remove leading matter from a string.
      monkey_patch ([namespace=_G])Overwrite core methods and metamethods with std enhanced versions.
      numbertosi (n) Write a number using SI suffixes.
      Make a shallow copy of a table, including any metatable.
      clone_select (t[, selection={}])clone_select (t[, keys={}]) Make a partial clone of a table.
      Make the list of keys in table.
      merge (t, u)Destructively merge another table's fields into table.merge (t, u[, map={}], nometa)Destructively merge another table's fields into another.
      merge_select (t, u[, keys={}], nometa)Destructively merge another table's named fields into table.
      metamethod (x, n)Return given metamethod, if any, or nil.
      monkey_patch ([namespace=_G])Overwrite core methods with std enhanced versions.
      new (x, t)
      - +
      std.containerstd.container.Container Container prototype.
      -

      Metamethods

      - - - - - - - - - - - - - -
      std.container:__call (x, ...)Return a clone of this container.
      std.container:__tostring ()Return a string representation of this container.
      std.container:__totable ()Return a table representation of this container.


      -

      Tables

      +

      Objects

      +
      - - std.container + + std.container.Container
      - Container prototype. + Container prototype.

      + +

      Container also inherits all the fields and methods from + std.object.Object.

      Fields:

      - - -
      -
      -

      Metamethods

      -
      -
      - - std.container:__call (x, ...) -
      -
      - Return a clone of this container. - - -

      Parameters:

      -
        -
      • x - a table if prototype _init is a table, otherwise first - argument for a function type _init -
      • -
      • ... - any additional arguments for _init -
      • -
      - -

      Returns:

      -
        - - std.container - a clone of the called container. -
      - -

      See also:

      - -
      -
      - - std.container:__tostring () -
      -
      - Return a string representation of this container. - - - -

      Returns:

      -
        - - string - stringified container representation -
      - - -

      See also:

      +

      Usage:

        - std.object.__tostring +
        + local std = require "std"
        + local Container = std.container {}
        +
        + local Graph = Container {
        +   _type = "Graph",
        +   _functions = {
        +     nodes = function (graph)
        +       local n = 0
        +       for _ in std.pairs (graph) do n = n + 1 end
        +       return n
        +     end,
        +   },
        + }
        + local g = Graph { "node1", "node2" }
        + --> 2
        + print (Graph.nodes (g))
      - -
      -
      - - std.container:__totable () -
      -
      - Return a table representation of this container. - - - -

      Returns:

      -
        - - table - a shallow copy of non-private container fields -
      - - -

      See also:

      - - -
      @@ -275,7 +171,8 @@

      See also:

      -generated by LDoc 1.4.2 +generated by LDoc 1.4.3 +Last updated 2015-01-03 20:26:44
      diff --git a/classes/std.list.html b/classes/std.list.html index 6996a2f..1547cf4 100644 --- a/classes/std.list.html +++ b/classes/std.list.html @@ -3,7 +3,7 @@ - stdlib 40 Reference + stdlib 41.0.0 Reference @@ -24,7 +24,7 @@
      @@ -337,12 +205,7 @@

      Returns:

      std.list.compare (l, m)
      - -

      Compare two lists element-by-element, from left-to-right.

      - -
       if a_list:compare (another_list) == 0 then print "same" end
      -
      - + Compare two lists element-by-element, from left-to-right.

      Parameters:

      @@ -352,20 +215,24 @@

      Parameters:

      a list
    • m - table - another list + List or table + another list, or table

    Returns:

      - -1 if l is less than m, 0 if they are the same, and 1 - if l is greater than m + -1 if l is less than m, 0 if they are the same, and 1 + if l is greater than m
    +

    Usage:

    +
      +
      if a_list:compare (another_list) == 0 then print "same" end
      +
    @@ -373,7 +240,7 @@

    Returns:

    std.list.concat (l, ...)
    - Concatenate arguments into a list. + Concatenate the elements from any number of lists.

    Parameters:

    @@ -391,12 +258,17 @@

    Returns:

      List - new list containing - {l[1], ..., l[#l], l_1[1], ..., l_1[#l_1], ..., l_n[1], ..., l_n[#l_n]} + new list with elements from arguments
    +

    Usage:

    +
      +
      + --> {1, 2, 3, {4, 5}, 6, 7}
      + list.concat ({1, 2, 3}, {{4, 5}, 6, 7})
      +
    @@ -422,50 +294,25 @@

    Returns:

      List - new list containing {x, unpack (l)} + new list with x followed by elements of l
    - - -
    - - std.list.depair (ls) -
    -
    - Turn a list of pairs into a table. - - -

    Parameters:

    -
      -
    • ls - table - list of lists {{i1, v1}, ..., {in, vn}} -
    • -
    - -

    Returns:

    -
      - - table - a new list containing table {i1=v1, ..., in=vn} -
    - - -

    See also:

    +

    Usage:

      - enpair +
      + --> {"x", 1, 2, 3}
      + list.cons ({1, 2, 3}, "x")
    -
    - - std.list.elems (l) + + std.list.rep (l, n)
    - An iterator over the elements of a list. + Repeat a list.

    Parameters:

    @@ -474,38 +321,9 @@

    Parameters:

    List a list - - -

    Returns:

    -
      -
    1. - function - iterator function which returns successive elements - of l
    2. -
    3. - List - l
    4. -
    5. - true
    6. -
    - - - - -
    -
    - - std.list.enpair (t) -
    -
    - Turn a table into a list of pairs. - - -

    Parameters:

    -
      -
    • t - table - a table {i1=v1, ..., in=vn} +
    • n + int + number of times to repeat
    @@ -513,59 +331,71 @@

    Returns:

      List - a new list containing {{i1, v1}, ..., {in, vn}} + n copies of l appended together
    -

    See also:

    + +

    Usage:

      - depair +
      + --> {1, 2, 3, 1, 2, 3, 1, 2, 3}
      + list.rep ({1, 2, 3}, 3)
    -
    - - std.list.filter (p, l) + + std.list.sub (l[, from=1[, to=#l]])
    - Filter a list according to a predicate. + Return a sub-range of a list. + (The equivalent of ??? on strings; negative list indices + count from the end of the list.)

    Parameters:

      -
    • p - func - predicate function, of one argument returning a boolean -
    • l List a list
    • +
    • from + int + start of range + (default 1) +
    • +
    • to + int + end of range + (default #l) +

    Returns:

      List - new list containing elements e of l for which - p (e) is true + new list containing elements between from and to + inclusive
    -

    See also:

    + +

    Usage:

      - std.list:filter +
      + --> {3, 4, 5}
      + list.sub ({1, 2, 3, 4, 5, 6}, 3, 5)
    -
    - - std.list.flatten (l) + + std.list.tail (l)
    - Flatten a list. + Return a list with its first element removed.

    Parameters:

    @@ -580,1140 +410,153 @@

    Returns:

      List - flattened list + new list with all but the first element of l
    +

    Usage:

    +
      +
      + --> {3, {4, 5}, 6, 7}
      + list.tail {{1, 2}, 3, {4, 5}, 6, 7}
      +
    + +

    Metamethods

    + +
    - - std.list.foldl (fn, e, l) + + std.list:__add (l, e)
    - Fold a binary function through a list left associatively. + Append element to list.

    Parameters:

      -
    • fn - func - binary function -
    • -
    • e - element to place in left-most position -
    • l List a list
    • +
    • e + element to append +
    -

    Returns:

    -
      - - result -

    See also:

    +

    Usage:

    +
      +
      list = list + "element"
      +
    - - std.list.foldr (fn, e, l) + + std.list:__concat (l, m)
    - Fold a binary function through a list right associatively. + Concatenate lists.

    Parameters:

      -
    • fn - func - binary function -
    • -
    • e - element to place in right-most position -
    • l List a list
    • +
    • m + List or table + another list, or table (hash part is ignored) +
    -

    Returns:

    -
      - - result -

    See also:

    +

    Usage:

    +
      +
      new = alist .. {"append", "these", "elements"}
      +
    - - std.list.index_key (f, l) + + std.list:__le (l, m)
    - Make an index of a list of tables on a given field + List equality or order operator.

    Parameters:

      -
    • f - field -
    • l List - list of tables {t1, ..., tn} + a list +
    • +
    • m + List + another list
    -

    Returns:

    -
      - - List - index {t1[f]=1, ..., tn[f]=n} -
    +

    See also:

    + +

    Usage:

    +
      +
      min = list1 <= list2 and list1 or list2
      +
    - - std.list.index_value (f, l) + + std.list:__lt (l, m)
    - Copy a list of tables, indexed on a given field + List order operator.

    Parameters:

      -
    • f - field whose value should be used as index -
    • l List - list of tables {i1=t1, ..., in=tn} + a list +
    • +
    • m + List + another list
    -

    Returns:

    -
      - - List - index {t1[f]=t1, ..., tn[f]=tn} -
    - - -
    -
    - - std.list.map (fn, l) -
    -
    - Map a function over a list. - +

    See also:

    + -

    Parameters:

    +

    Usage:

      -
    • fn - func - map function -
    • -
    • l - List - a list -
    • -
    - -

    Returns:

    -
      - - List - new list containing {fn (l[1]), ..., fn (l[#l])} -
    - - -

    See also:

    - - - -
    -
    - - std.list.map_with (fn, ls) -
    -
    - Map a function over a list of lists. - - -

    Parameters:

    -
      -
    • fn - func - map function -
    • -
    • ls - List - a list of lists -
    • -
    - -

    Returns:

    -
      - - List - new list {fn (unpack (ls[1]))), ..., fn (unpack (ls[#ls]))} -
    - - - - -
    -
    - - std.list.project (f, l) -
    -
    - Project a list of fields from a list of tables. - - -

    Parameters:

    -
      -
    • f - field to project -
    • -
    • l - List - a list -
    • -
    - -

    Returns:

    -
      - - List - list of f fields -
    - - -

    See also:

    - - - -
    -
    - - std.list.relems (l) -
    -
    - An iterator over the elements of a list, in reverse. - - -

    Parameters:

    -
      -
    • l - List - a list -
    • -
    - -

    Returns:

    -
      -
    1. - function - iterator function which returns precessive elements - of the l
    2. -
    3. - List - l
    4. -
    5. - true
    6. -
    - - - - -
    -
    - - std.list.rep (l, n) -
    -
    - Repeat a list. - - -

    Parameters:

    -
      -
    • l - List - a list -
    • -
    • n - int - number of times to repeat -
    • -
    - -

    Returns:

    -
      - - List - n copies of l appended together -
    - - - - -
    -
    - - std.list.reverse (l) -
    -
    - Reverse a list. - - -

    Parameters:

    -
      -
    • l - List - a list -
    • -
    - -

    Returns:

    -
      - - List - new list containing {l[#l], ..., l[1]} -
    - - - - -
    -
    - - std.list.shape (s, l) -
    -
    - Shape a list according to a list of dimensions.

    - -

    Dimensions are given outermost first and items from the original - list are distributed breadth first; there may be one 0 indicating - an indefinite number. Hence, {0} is a flat list, - {1} is a singleton, {2, 0} is a list of - two lists, and {0, 2} is a list of pairs.

    - -

    Algorithm: turn shape into all positive numbers, calculating - the zero if necessary and making sure there is at most one; - recursively walk the shape, adding empty tables until the bottom - level is reached at which point add table items instead, using a - counter to walk the flattened original list. - - -

    Parameters:

    -
      -
    • s - table - {d1, ..., dn} -
    • -
    • l - List - a list -
    • -
    - -

    Returns:

    -
      - - reshaped list -
    - - -

    See also:

    - - - -
    -
    - - std.list.sub (l, from, to) -
    -
    - Return a sub-range of a list. - (The equivalent of string.sub on strings; negative list indices - count from the end of the list.) - - -

    Parameters:

    -
      -
    • l - List - a list -
    • -
    • from - int - start of range (default: 1) -
    • -
    • to - int - end of range (default: #l) -
    • -
    - -

    Returns:

    -
      - - List - new list containing {l[from], ..., l[to]} -
    - - - - -
    -
    - - std.list.tail (l) -
    -
    - Return a list with its first element removed. - - -

    Parameters:

    -
      -
    • l - List - a list -
    • -
    - -

    Returns:

    -
      - - List - new list containing {l[2], ..., l[#l]} -
    - - - - -
    -
    - - std.list.transpose (ls) -
    -
    - Transpose a list of lists. - This function in Lua is equivalent to zip and unzip in more strongly - typed languages. - - -

    Parameters:

    -
      -
    • ls - table - {{ls<1,1>, ..., ls<1,c>}, ..., {ls<r,1>, ..., ls<r,c>}} -
    • -
    - -

    Returns:

    -
      - - List - new list containing - {{ls<1,1>, ..., ls<r,1>}, ..., {ls<1,c>, ..., ls<r,c>}} -
    - - - - -
    -
    - - std.list.zip_with (ls, f) -
    -
    - Zip a list of lists together with a function. - - -

    Parameters:

    -
      -
    • ls - table - list of lists -
    • -
    • f - function - function -
    • -
    - -

    Returns:

    -
      - - List - -
      a new list containing
      -
      -

      {f (ls[1][1], ..., ls[#ls][1]), ..., f (ls[1][N], ..., ls[#ls][N]) - where N = max {map (function (l) return #l end, ls)}

      - -
    - - - - -
    -
    -

    Tables

    -
    -
    - - std.list.List -
    -
    - An Object derived List. - - - - - - - -
    -
    -

    Metamethods

    -
    -
    - - std.list:__add (list, element) -
    -
    - -

    Append element to list.

    -
     list = list + element
    -
    - - - -

    Parameters:

    -
      -
    • list - List - a list -
    • -
    • element - element to append -
    • -
    - - - -

    See also:

    - - - -
    -
    - - std.list:__concat (list, table) -
    -
    - -

    Concatenate lists.

    -
     new = list .. table
    -
    - - - -

    Parameters:

    -
      -
    • list - List - a list -
    • -
    • table - table - another list, hash part is ignored -
    • -
    - - - -

    See also:

    - - - -
    -
    - - std.list:__le (list1, list2) -
    -
    - -

    List equality or order operator.

    -
     min = list1 <= list2 and list1 or list2
    -
    - - - -

    Parameters:

    -
      -
    • list1 - List - a list -
    • -
    • list2 - List - another list -
    • -
    - - - -

    See also:

    - - - -
    -
    - - std.list:__lt (list1, list2) -
    -
    - -

    List order operator.

    -
     max = list1 > list2 and list1 or list2
    -
    - - - -

    Parameters:

    -
      -
    • list1 - List - a list -
    • -
    • list2 - List - another list -
    • -
    - - - -

    See also:

    - - - -
    -
    -

    Methods

    -
    -
    - - std.list:append (x) -
    -
    - Append an item to a list. - - -

    Parameters:

    -
      -
    • x - item -
    • -
    - -

    Returns:

    -
      - - List - new list containing {self[1], ..., self[#self], x} -
    - - - - -
    -
    - - std.list:compare (l) -
    -
    - -

    Compare two lists element-by-element, from left-to-right.

    - -
     if a_list:compare (another_list) == 0 then print "same" end
    -
    - - - -

    Parameters:

    -
      -
    • l - table - a list -
    • -
    - -

    Returns:

    -
      - - -1 if self is less than l, 0 if they are the same, and 1 - if self is greater than l -
    - - - - -
    -
    - - std.list:concat (...) -
    -
    - Concatenate arguments into a list. - - -

    Parameters:

    -
      -
    • ... - tuple of lists -
    • -
    - -

    Returns:

    -
      - - List - new list containing - {self[1], ..., self[#self], l_1[1], ..., l_1[#l_1], ..., l_n[1], ..., l_n[#l_n]} -
    - - - - -
    -
    - - std.list:cons (x) -
    -
    - Prepend an item to a list. - - -

    Parameters:

    -
      -
    • x - item -
    • -
    - -

    Returns:

    -
      - - List - new list containing {x, unpack (self)} -
    - - - - -
    -
    - - std.list:elems () -
    -
    - An iterator over the elements of a list. - - - -

    Returns:

    -
      -
    1. - function - iterator function which returns successive - elements of self
    2. -
    3. - List - self
    4. -
    5. - true
    6. -
    - - - - -
    -
    - - std.list:filter (p) -
    -
    - Filter a list according to a predicate. - - -

    Parameters:

    -
      -
    • p - func - predicate function, of one argument returning a boolean -
    • -
    - -

    Returns:

    -
      - - List - new list containing elements e of self for which - p (e) is true -
    - - -

    See also:

    - - - -
    -
    - - std.list:flatten () -
    -
    - Flatten a list. - - - -

    Returns:

    -
      - - List - flattened list -
    - - - - -
    -
    - - std.list:foldl (fn, e) -
    -
    - Fold a binary function through a list left associatively. - - -

    Parameters:

    -
      -
    • fn - func - binary function -
    • -
    • e - element to place in left-most position -
    • -
    - -

    Returns:

    -
      - - result -
    - - -

    See also:

    - - - -
    -
    - - std.list:foldr (f, e) -
    -
    - Fold a binary function through a list right associatively. - - -

    Parameters:

    -
      -
    • f - func - binary function -
    • -
    • e - element to place in right-most position -
    • -
    - -

    Returns:

    -
      - - result -
    - - -

    See also:

    - - - -
    -
    - - std.list:map (fn) -
    -
    - Map a function over a list. - - -

    Parameters:

    -
      -
    • fn - func - map function -
    • -
    - -

    Returns:

    -
      - - List - new list containing - {fn (self[1]), ..., fn (self[#self])} -
    - - -

    See also:

    - - - -
    -
    - - std.list:project (f) -
    -
    - Project a list of fields from a list of tables. - - -

    Parameters:

    -
      -
    • f - field to project -
    • -
    - -

    Returns:

    -
      - - List - list of f fields -
    - - -

    See also:

    - - - -
    -
    - - std.list:relems () -
    -
    - An iterator over the elements of a list, in reverse. - - - -

    Returns:

    -
      -
    1. - function - iterator function which returns precessive elements - of the self
    2. -
    3. - List - self
    4. -
    5. - true
    6. -
    - - - - -
    -
    - - std.list:rep (n) -
    -
    - Repeat a list. - - -

    Parameters:

    -
      -
    • n - int - number of times to repeat -
    • -
    - -

    Returns:

    -
      - - List - n copies of self appended together -
    - - - - -
    -
    - - std.list:reverse () -
    -
    - Reverse a list. - - - -

    Returns:

    -
      - - List - new list containing {self[#self], ..., self[1]} -
    - - - - -
    -
    - - std.list:shape (s) -
    -
    - Shape a list according to a list of dimensions. - - -

    Parameters:

    -
      -
    • s - table - {d1, ..., dn} -
    • -
    - -

    Returns:

    -
      - - reshaped list -
    - - -

    See also:

    - - - -
    -
    - - std.list:sub (from, to) -
    -
    - Return a sub-range of a list. - (The equivalent of string.sub on strings; negative list indices - count from the end of the list.) - - -

    Parameters:

    -
      -
    • from - int - start of range (default: 1) -
    • -
    • to - int - end of range (default: #self) -
    • +
      max = list1 > list2 and list1 or list2
    -

    Returns:

    -
      - - List - new list containing {self[from], ..., self[to]} -
    - - - - -
    -
    - - std.list:tail () -
    -
    - Return a list with its first element removed. - - - -

    Returns:

    -
      - - List - new list containing {self[2], ..., self[#self]} -
    - - - -
    @@ -1721,7 +564,8 @@

    Returns:

    -generated by LDoc 1.4.2 +generated by LDoc 1.4.3 +Last updated 2015-01-03 20:26:44
    diff --git a/classes/std.object.html b/classes/std.object.html index c30d9a5..6594a88 100644 --- a/classes/std.object.html +++ b/classes/std.object.html @@ -3,7 +3,7 @@ - stdlib 40 Reference + stdlib 41.0.0 Reference @@ -24,7 +24,7 @@
    -generated by LDoc 1.4.2 +generated by LDoc 1.4.3 +Last updated 2015-01-03 20:26:44
    diff --git a/classes/std.optparse.html b/classes/std.optparse.html index 1ad8ebd..4b31f4f 100644 --- a/classes/std.optparse.html +++ b/classes/std.optparse.html @@ -3,7 +3,7 @@ - stdlib 40 Reference + stdlib 41.0.0 Reference @@ -24,7 +24,7 @@
    -generated by LDoc 1.4.2 +generated by LDoc 1.4.3 +Last updated 2015-01-03 20:26:44
    diff --git a/classes/std.set.html b/classes/std.set.html index 3b6fd70..3379de8 100644 --- a/classes/std.set.html +++ b/classes/std.set.html @@ -3,7 +3,7 @@ - stdlib 40 Reference + stdlib 41.0.0 Reference @@ -24,7 +24,7 @@
    -generated by LDoc 1.4.2 +generated by LDoc 1.4.3 +Last updated 2015-01-03 20:26:44
    diff --git a/classes/std.strbuf.html b/classes/std.strbuf.html index 0fd26f0..0dd6444 100644 --- a/classes/std.strbuf.html +++ b/classes/std.strbuf.html @@ -3,7 +3,7 @@ - stdlib 40 Reference + stdlib 41.0.0 Reference @@ -24,7 +24,7 @@
    -generated by LDoc 1.4.2 +generated by LDoc 1.4.3 +Last updated 2015-01-03 20:26:44
    diff --git a/classes/std.tree.html b/classes/std.tree.html index 6e33ccc..6f57725 100644 --- a/classes/std.tree.html +++ b/classes/std.tree.html @@ -3,7 +3,7 @@ - stdlib 40 Reference + stdlib 41.0.0 Reference @@ -24,7 +24,7 @@
    -generated by LDoc 1.4.2 +generated by LDoc 1.4.3 +Last updated 2015-01-03 20:26:44
    diff --git a/index.html b/index.html index b9bac87..53db0be 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - stdlib 40 Reference + stdlib 41.0.0 Reference @@ -24,7 +24,7 @@
    -generated by LDoc 1.4.2 +generated by LDoc 1.4.3 +Last updated 2015-01-03 20:26:44
    diff --git a/modules/std.functional.html b/modules/std.functional.html index 918f20a..60a1a0e 100644 --- a/modules/std.functional.html +++ b/modules/std.functional.html @@ -3,7 +3,7 @@ - stdlib 40 Reference + stdlib 41.0.0 Reference @@ -24,7 +24,7 @@
    -generated by LDoc 1.4.2 +generated by LDoc 1.4.3 +Last updated 2015-01-03 20:26:44
    diff --git a/modules/std.html b/modules/std.html index e3dac79..c625901 100644 --- a/modules/std.html +++ b/modules/std.html @@ -3,7 +3,7 @@ - stdlib 40 Reference + stdlib 41.0.0 Reference @@ -24,7 +24,7 @@
    -generated by LDoc 1.4.2 +generated by LDoc 1.4.3 +Last updated 2015-01-03 20:26:44
    diff --git a/modules/std.io.html b/modules/std.io.html index 450acb3..cd79013 100644 --- a/modules/std.io.html +++ b/modules/std.io.html @@ -3,7 +3,7 @@ - stdlib 40 Reference + stdlib 41.0.0 Reference @@ -24,7 +24,7 @@
    -generated by LDoc 1.4.2 +generated by LDoc 1.4.3 +Last updated 2015-01-03 20:26:44
    diff --git a/modules/std.math.html b/modules/std.math.html index 50408e6..13f05d2 100644 --- a/modules/std.math.html +++ b/modules/std.math.html @@ -3,7 +3,7 @@ - stdlib 40 Reference + stdlib 41.0.0 Reference @@ -24,7 +24,7 @@
    -generated by LDoc 1.4.2 +generated by LDoc 1.4.3 +Last updated 2015-01-03 20:26:44
    diff --git a/modules/std.operator.html b/modules/std.operator.html new file mode 100644 index 0000000..b682c1e --- /dev/null +++ b/modules/std.operator.html @@ -0,0 +1,755 @@ + + + + + stdlib 41.0.0 Reference + + + + +
    + +
    + +
    +
    +
    + + +
    + + + + + + +
    + +

    Module std.operator

    +

    Functional forms of Lua operators.

    +

    + +

    + + +

    Functions

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    concat (a, b)Stringify and concatenate arguments.
    conj (a, b)Return the logical conjunction of the arguments.
    diff (a, b)Return the difference of the arguments.
    disj (a, b)Return the logical disjunction of the arguments.
    eq (a, b)Return the equality of the arguments.
    get (t, k)Dereference a table.
    gt (a, b)Return whether the arguments are in descending order.
    gte (a, b)Return whether the arguments are not in ascending order.
    lt (a, b)Return whether the arguments are in ascending order.
    lte (a, b)Return whether the arguments are not in descending order.
    mod (a, b)Return the modulus of the arguments.
    neg (a)Return the logical negation of the arguments.
    neq (a, b)Return the inequality of the arguments.
    pow (a, b)Return the exponent of the arguments.
    prod (a, b)Return the product of the arguments.
    quot (a, b)Return the quotient of the arguments.
    set (t, k, v)Set a table element, honoring metamethods.
    sum (a, b)Return the sum of the arguments.
    + +
    +
    + + +

    Functions

    + Methods +
    +
    + + concat (a, b) +
    +
    + Stringify and concatenate arguments. + + +

    Parameters:

    +
      +
    • a + an argument +
    • +
    • b + another argument +
    • +
    + +

    Returns:

    +
      + + concatenation of stringified arguments. +
    + + + +

    Usage:

    +
      +
      + --> "=> 1000010010"
      + functional.foldl (concat, "=> ", {10000, 100, 10})
      +
    + +
    +
    + + conj (a, b) +
    +
    + Return the logical conjunction of the arguments. + + +

    Parameters:

    +
      +
    • a + an argument +
    • +
    • b + another argument +
    • +
    + +

    Returns:

    +
      + + logical a and b +
    + + + +

    Usage:

    +
      +
      + --> true
      + functional.foldl (conj, {true, 1, "false"})
      +
    + +
    +
    + + diff (a, b) +
    +
    + Return the difference of the arguments. + + +

    Parameters:

    +
      +
    • a + an argument +
    • +
    • b + another argument +
    • +
    + +

    Returns:

    +
      + + the difference between a and b +
    + + + +

    Usage:

    +
      +
      + --> 890
      + functional.foldl (diff, {10000, 100, 10})
      +
    + +
    +
    + + disj (a, b) +
    +
    + Return the logical disjunction of the arguments. + + +

    Parameters:

    +
      +
    • a + an argument +
    • +
    • b + another argument +
    • +
    + +

    Returns:

    +
      + + logical a or b +
    + + + +

    Usage:

    +
      +
      + --> true
      + functional.foldl (disj, {true, 1, false})
      +
    + +
    +
    + + eq (a, b) +
    +
    + Return the equality of the arguments. + + +

    Parameters:

    +
      +
    • a + an argument +
    • +
    • b + another argument +
    • +
    + +

    Returns:

    +
      + + true if a is b, otherwise false +
    + + + + +
    +
    + + get (t, k) +
    +
    + Dereference a table. + + +

    Parameters:

    +
      +
    • t + table + a table +
    • +
    • k + a key to lookup in t +
    • +
    + +

    Returns:

    +
      + + value stored at t[k] if any, otherwise nil +
    + + + +

    Usage:

    +
      +
      + --> 4
      + functional.foldl (get, {1, {{2, 3, 4}, 5}}, {2, 1, 3})
      +
    + +
    +
    + + gt (a, b) +
    +
    + Return whether the arguments are in descending order. + + +

    Parameters:

    +
      +
    • a + an argument +
    • +
    • b + another argument +
    • +
    + +

    Returns:

    +
      + + true if a is greater then b, otherwise false +
    + + + + +
    +
    + + gte (a, b) +
    +
    + Return whether the arguments are not in ascending order. + + +

    Parameters:

    +
      +
    • a + an argument +
    • +
    • b + another argument +
    • +
    + +

    Returns:

    +
      + + true if a is not greater then b, otherwise false +
    + + + + +
    +
    + + lt (a, b) +
    +
    + Return whether the arguments are in ascending order. + + +

    Parameters:

    +
      +
    • a + an argument +
    • +
    • b + another argument +
    • +
    + +

    Returns:

    +
      + + true if a is less then b, otherwise false +
    + + + + +
    +
    + + lte (a, b) +
    +
    + Return whether the arguments are not in descending order. + + +

    Parameters:

    +
      +
    • a + an argument +
    • +
    • b + another argument +
    • +
    + +

    Returns:

    +
      + + true if a is not greater then b, otherwise false +
    + + + + +
    +
    + + mod (a, b) +
    +
    + Return the modulus of the arguments. + + +

    Parameters:

    +
      +
    • a + an argument +
    • +
    • b + another argument +
    • +
    + +

    Returns:

    +
      + + the modulus of a and b +
    + + + +

    Usage:

    +
      +
      + --> 3
      + functional.foldl (mod, {65536, 100, 11})
      +
    + +
    +
    + + neg (a) +
    +
    + Return the logical negation of the arguments. + + +

    Parameters:

    +
      +
    • a + an argument +
    • +
    + +

    Returns:

    +
      + + not a +
    + + + +

    Usage:

    +
      +
      + --> {true, false, false, false}
      + functional.bind (functional.map, {std.ielems, neg}) {false, true, 1, 0}
      +
    + +
    +
    + + neq (a, b) +
    +
    + Return the inequality of the arguments. + + +

    Parameters:

    +
      +
    • a + an argument +
    • +
    • b + another argument +
    • +
    + +

    Returns:

    +
      + + false if a is b, otherwise true +
    + + + +

    Usage:

    +
      +
      + --> true
      + local f = require "std.functional"
      + table.empty (f.filter (f.bind (neq, {6}), std.ielems, {6, 6, 6})
      +
    + +
    +
    + + pow (a, b) +
    +
    + Return the exponent of the arguments. + + +

    Parameters:

    +
      +
    • a + an argument +
    • +
    • b + another argument +
    • +
    + +

    Returns:

    +
      + + the a to the power of b +
    + + + +

    Usage:

    +
      +
      + --> 4096
      + functional.foldl (pow, {2, 3, 4})
      +
    + +
    +
    + + prod (a, b) +
    +
    + Return the product of the arguments. + + +

    Parameters:

    +
      +
    • a + an argument +
    • +
    • b + another argument +
    • +
    + +

    Returns:

    +
      + + the product of a and b +
    + + + +

    Usage:

    +
      +
      + --> 10000000
      + functional.foldl (prod, {10000, 100, 10})
      +
    + +
    +
    + + quot (a, b) +
    +
    + Return the quotient of the arguments. + + +

    Parameters:

    +
      +
    • a + an argument +
    • +
    • b + another argument +
    • +
    + +

    Returns:

    +
      + + the quotient a and b +
    + + + +

    Usage:

    +
      +
      + --> 1000
      + functional.foldr (quot, {10000, 100, 10})
      +
    + +
    +
    + + set (t, k, v) +
    +
    + Set a table element, honoring metamethods. + + +

    Parameters:

    +
      +
    • t + table + a table +
    • +
    • k + a key to lookup in t +
    • +
    • v + a value to set for k +
    • +
    + +

    Returns:

    +
      + + table + t +
    + + + +

    Usage:

    +
      +
      + -- destructive table merge:
      + --> {"one", bar="baz", two=5}
      + functional.reduce (set, {"foo", bar="baz"}, {"one", two=5})
      +
    + +
    +
    + + sum (a, b) +
    +
    + Return the sum of the arguments. + + +

    Parameters:

    +
      +
    • a + an argument +
    • +
    • b + another argument +
    • +
    + +

    Returns:

    +
      + + the sum of the a and b +
    + + + +

    Usage:

    +
      +
      + --> 10110
      + functional.foldl (sum, {10000, 100, 10})
      +
    + +
    +
    + + +
    +
    +
    +generated by LDoc 1.4.3 +Last updated 2015-01-03 20:26:44 +
    +
    + + diff --git a/modules/std.package.html b/modules/std.package.html index 1378d42..e4ff729 100644 --- a/modules/std.package.html +++ b/modules/std.package.html @@ -3,7 +3,7 @@ - stdlib 40 Reference + stdlib 41.0.0 Reference @@ -24,7 +24,7 @@
    -generated by LDoc 1.4.2 +generated by LDoc 1.4.3 +Last updated 2015-01-03 20:26:44
    diff --git a/modules/std.strict.html b/modules/std.strict.html index a2a8444..c14f826 100644 --- a/modules/std.strict.html +++ b/modules/std.strict.html @@ -3,7 +3,7 @@ - stdlib 40 Reference + stdlib 41.0.0 Reference @@ -24,7 +24,7 @@
    -generated by LDoc 1.4.2 +generated by LDoc 1.4.3 +Last updated 2015-01-03 20:26:44
    diff --git a/modules/std.string.html b/modules/std.string.html index d41ef7b..5f29c3b 100644 --- a/modules/std.string.html +++ b/modules/std.string.html @@ -3,7 +3,7 @@ - stdlib 40 Reference + stdlib 41.0.0 Reference @@ -24,7 +24,7 @@
    -generated by LDoc 1.4.2 +generated by LDoc 1.4.3 +Last updated 2015-01-03 20:26:44
    diff --git a/modules/std.table.html b/modules/std.table.html index e565d06..0bd3188 100644 --- a/modules/std.table.html +++ b/modules/std.table.html @@ -3,7 +3,7 @@ - stdlib 40 Reference + stdlib 41.0.0 Reference @@ -24,7 +24,7 @@
    -generated by LDoc 1.4.2 +generated by LDoc 1.4.3 +Last updated 2015-01-03 20:26:44
    From d37f728f9ba063086a10a09c240e3a308f84f8a7 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Thu, 1 May 2014 17:40:51 +0700 Subject: [PATCH 12/15] gh-pages: update for v41.1.0. Signed-off-by: Gary V. Vaughan --- classes/std.container.html | 8 +-- classes/std.list.html | 10 +-- classes/std.object.html | 28 ++++---- classes/std.optparse.html | 44 ++++++------ classes/std.set.html | 8 +-- classes/std.strbuf.html | 90 +++++++++++------------- classes/std.tree.html | 34 ++++----- index.html | 6 +- modules/std.debug.html | 78 ++++++++++++++------- modules/std.functional.html | 36 +++++----- modules/std.html | 60 ++++++++-------- modules/std.io.html | 38 +++++----- modules/std.math.html | 10 +-- modules/std.operator.html | 12 ++-- modules/std.package.html | 36 +++++----- modules/std.strict.html | 14 ++-- modules/std.string.html | 114 +++++++++++++++--------------- modules/std.table.html | 136 ++++++++++++++++++++++++------------ 18 files changed, 411 insertions(+), 351 deletions(-) diff --git a/classes/std.container.html b/classes/std.container.html index 7add14c..9b66d95 100644 --- a/classes/std.container.html +++ b/classes/std.container.html @@ -3,7 +3,7 @@ - stdlib 41.0.0 Reference + stdlib 41.1.0 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-01-03 20:26:44 +Last updated 2015-01-30 17:57:09
    diff --git a/classes/std.list.html b/classes/std.list.html index 1547cf4..7018850 100644 --- a/classes/std.list.html +++ b/classes/std.list.html @@ -3,7 +3,7 @@ - stdlib 41.0.0 Reference + stdlib 41.1.0 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-01-03 20:26:44 +Last updated 2015-01-30 17:57:09
    diff --git a/classes/std.object.html b/classes/std.object.html index 6594a88..4960517 100644 --- a/classes/std.object.html +++ b/classes/std.object.html @@ -3,7 +3,7 @@ - stdlib 41.0.0 Reference + stdlib 41.1.0 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-01-03 20:26:44 +Last updated 2015-01-30 17:57:09
    diff --git a/classes/std.optparse.html b/classes/std.optparse.html index 4b31f4f..e910610 100644 --- a/classes/std.optparse.html +++ b/classes/std.optparse.html @@ -3,7 +3,7 @@ - stdlib 41.0.0 Reference + stdlib 41.1.0 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-01-03 20:26:44 +Last updated 2015-01-30 17:57:09
    diff --git a/classes/std.set.html b/classes/std.set.html index 3379de8..f213df5 100644 --- a/classes/std.set.html +++ b/classes/std.set.html @@ -3,7 +3,7 @@ - stdlib 41.0.0 Reference + stdlib 41.1.0 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-01-03 20:26:44 +Last updated 2015-01-30 17:57:09
    diff --git a/classes/std.strbuf.html b/classes/std.strbuf.html index 0dd6444..9ed5da5 100644 --- a/classes/std.strbuf.html +++ b/classes/std.strbuf.html @@ -3,7 +3,7 @@ - stdlib 41.0.0 Reference + stdlib 41.1.0 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-01-31 12:47:39 +Last updated 2015-03-08 20:42:58
    diff --git a/modules/std.functional.html b/modules/std.functional.html index 2975322..a1a6bde 100644 --- a/modules/std.functional.html +++ b/modules/std.functional.html @@ -3,7 +3,7 @@ - stdlib 41.1.1 Reference + stdlib 41.2.0 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-01-31 12:47:39 +Last updated 2015-03-08 20:42:58
    diff --git a/modules/std.html b/modules/std.html index 75cf55c..6b4d078 100644 --- a/modules/std.html +++ b/modules/std.html @@ -3,7 +3,7 @@ - stdlib 41.1.1 Reference + stdlib 41.2.0 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-01-31 12:47:39 +Last updated 2015-03-08 20:42:58
    diff --git a/modules/std.io.html b/modules/std.io.html index 3d7a493..8294c56 100644 --- a/modules/std.io.html +++ b/modules/std.io.html @@ -3,7 +3,7 @@ - stdlib 41.1.1 Reference + stdlib 41.2.0 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-01-31 12:47:39 +Last updated 2015-03-08 20:42:58
    diff --git a/modules/std.math.html b/modules/std.math.html index f24de2e..1564650 100644 --- a/modules/std.math.html +++ b/modules/std.math.html @@ -3,7 +3,7 @@ - stdlib 41.1.1 Reference + stdlib 41.2.0 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-01-31 12:47:39 +Last updated 2015-03-08 20:42:58
    diff --git a/modules/std.operator.html b/modules/std.operator.html index 3f93a7f..3920271 100644 --- a/modules/std.operator.html +++ b/modules/std.operator.html @@ -3,7 +3,7 @@ - stdlib 41.1.1 Reference + stdlib 41.2.0 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-01-31 12:47:39 +Last updated 2015-03-08 20:42:58
    diff --git a/modules/std.package.html b/modules/std.package.html index b3d0c5c..972cb2f 100644 --- a/modules/std.package.html +++ b/modules/std.package.html @@ -3,7 +3,7 @@ - stdlib 41.1.1 Reference + stdlib 41.2.0 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-01-31 12:47:39 +Last updated 2015-03-08 20:42:58
    diff --git a/modules/std.strict.html b/modules/std.strict.html index 0db6a76..bc19eb7 100644 --- a/modules/std.strict.html +++ b/modules/std.strict.html @@ -3,7 +3,7 @@ - stdlib 41.1.1 Reference + stdlib 41.2.0 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-01-31 12:47:39 +Last updated 2015-03-08 20:42:58
    diff --git a/modules/std.string.html b/modules/std.string.html index 8c2efda..3a01a2f 100644 --- a/modules/std.string.html +++ b/modules/std.string.html @@ -3,7 +3,7 @@ - stdlib 41.1.1 Reference + stdlib 41.2.0 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-01-31 12:47:39 +Last updated 2015-03-08 20:42:58
    diff --git a/modules/std.table.html b/modules/std.table.html index d289b9c..99af92e 100644 --- a/modules/std.table.html +++ b/modules/std.table.html @@ -3,7 +3,7 @@ - stdlib 41.1.1 Reference + stdlib 41.2.0 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-01-31 12:47:39 +Last updated 2015-03-08 20:42:58
    From 17407827e24c98b62437e6c589abb7d18c00ab54 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Mon, 3 Sep 2018 17:56:09 -0700 Subject: [PATCH 15/15] gh-pages: update for v41.2.2 Signed-off-by: Gary V. Vaughan --- classes/std.container.html | 6 +++--- classes/std.list.html | 6 +++--- classes/std.object.html | 6 +++--- classes/std.optparse.html | 6 +++--- classes/std.set.html | 6 +++--- classes/std.strbuf.html | 6 +++--- classes/std.tree.html | 6 +++--- index.html | 6 +++--- modules/std.debug.html | 6 +++--- modules/std.functional.html | 6 +++--- modules/std.html | 6 +++--- modules/std.io.html | 6 +++--- modules/std.math.html | 6 +++--- modules/std.operator.html | 6 +++--- modules/std.package.html | 6 +++--- modules/std.strict.html | 6 +++--- modules/std.string.html | 6 +++--- modules/std.table.html | 6 +++--- 18 files changed, 54 insertions(+), 54 deletions(-) diff --git a/classes/std.container.html b/classes/std.container.html index 5e902a6..acdfc83 100644 --- a/classes/std.container.html +++ b/classes/std.container.html @@ -3,7 +3,7 @@ - stdlib 41.2.0 Reference + stdlib 41.2.2 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-03-08 20:42:58 +Last updated 2018-09-03 17:48:42
    diff --git a/classes/std.list.html b/classes/std.list.html index 85f7652..c29ce85 100644 --- a/classes/std.list.html +++ b/classes/std.list.html @@ -3,7 +3,7 @@ - stdlib 41.2.0 Reference + stdlib 41.2.2 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-03-08 20:42:58 +Last updated 2018-09-03 17:48:42
    diff --git a/classes/std.object.html b/classes/std.object.html index 776f5fa..65dc357 100644 --- a/classes/std.object.html +++ b/classes/std.object.html @@ -3,7 +3,7 @@ - stdlib 41.2.0 Reference + stdlib 41.2.2 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-03-08 20:42:58 +Last updated 2018-09-03 17:48:42
    diff --git a/classes/std.optparse.html b/classes/std.optparse.html index f46f42b..757d8dc 100644 --- a/classes/std.optparse.html +++ b/classes/std.optparse.html @@ -3,7 +3,7 @@ - stdlib 41.2.0 Reference + stdlib 41.2.2 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-03-08 20:42:58 +Last updated 2018-09-03 17:48:42
    diff --git a/classes/std.set.html b/classes/std.set.html index e89ec4f..0344303 100644 --- a/classes/std.set.html +++ b/classes/std.set.html @@ -3,7 +3,7 @@ - stdlib 41.2.0 Reference + stdlib 41.2.2 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-03-08 20:42:58 +Last updated 2018-09-03 17:48:42
    diff --git a/classes/std.strbuf.html b/classes/std.strbuf.html index dd5cb82..22c5c94 100644 --- a/classes/std.strbuf.html +++ b/classes/std.strbuf.html @@ -3,7 +3,7 @@ - stdlib 41.2.0 Reference + stdlib 41.2.2 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-03-08 20:42:58 +Last updated 2018-09-03 17:48:42
    diff --git a/classes/std.tree.html b/classes/std.tree.html index 12cdf27..0a64c23 100644 --- a/classes/std.tree.html +++ b/classes/std.tree.html @@ -3,7 +3,7 @@ - stdlib 41.2.0 Reference + stdlib 41.2.2 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-03-08 20:42:58 +Last updated 2018-09-03 17:48:42
    diff --git a/index.html b/index.html index 9a0e491..9a1556f 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - stdlib 41.2.0 Reference + stdlib 41.2.2 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-03-08 20:42:58 +Last updated 2018-09-03 17:48:42
    diff --git a/modules/std.debug.html b/modules/std.debug.html index f3a3e9d..052f34c 100644 --- a/modules/std.debug.html +++ b/modules/std.debug.html @@ -3,7 +3,7 @@ - stdlib 41.2.0 Reference + stdlib 41.2.2 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-03-08 20:42:58 +Last updated 2018-09-03 17:48:42
    diff --git a/modules/std.functional.html b/modules/std.functional.html index a1a6bde..f5eeda1 100644 --- a/modules/std.functional.html +++ b/modules/std.functional.html @@ -3,7 +3,7 @@ - stdlib 41.2.0 Reference + stdlib 41.2.2 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-03-08 20:42:58 +Last updated 2018-09-03 17:48:42
    diff --git a/modules/std.html b/modules/std.html index 6b4d078..40f7de8 100644 --- a/modules/std.html +++ b/modules/std.html @@ -3,7 +3,7 @@ - stdlib 41.2.0 Reference + stdlib 41.2.2 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-03-08 20:42:58 +Last updated 2018-09-03 17:48:42
    diff --git a/modules/std.io.html b/modules/std.io.html index 8294c56..f69b83a 100644 --- a/modules/std.io.html +++ b/modules/std.io.html @@ -3,7 +3,7 @@ - stdlib 41.2.0 Reference + stdlib 41.2.2 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-03-08 20:42:58 +Last updated 2018-09-03 17:48:42
    diff --git a/modules/std.math.html b/modules/std.math.html index 1564650..8fd2b94 100644 --- a/modules/std.math.html +++ b/modules/std.math.html @@ -3,7 +3,7 @@ - stdlib 41.2.0 Reference + stdlib 41.2.2 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-03-08 20:42:58 +Last updated 2018-09-03 17:48:42
    diff --git a/modules/std.operator.html b/modules/std.operator.html index 3920271..0ebf53f 100644 --- a/modules/std.operator.html +++ b/modules/std.operator.html @@ -3,7 +3,7 @@ - stdlib 41.2.0 Reference + stdlib 41.2.2 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-03-08 20:42:58 +Last updated 2018-09-03 17:48:42
    diff --git a/modules/std.package.html b/modules/std.package.html index 972cb2f..c1d7e16 100644 --- a/modules/std.package.html +++ b/modules/std.package.html @@ -3,7 +3,7 @@ - stdlib 41.2.0 Reference + stdlib 41.2.2 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-03-08 20:42:58 +Last updated 2018-09-03 17:48:42
    diff --git a/modules/std.strict.html b/modules/std.strict.html index bc19eb7..ff52f9e 100644 --- a/modules/std.strict.html +++ b/modules/std.strict.html @@ -3,7 +3,7 @@ - stdlib 41.2.0 Reference + stdlib 41.2.2 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-03-08 20:42:58 +Last updated 2018-09-03 17:48:42
    diff --git a/modules/std.string.html b/modules/std.string.html index 3a01a2f..e04aad9 100644 --- a/modules/std.string.html +++ b/modules/std.string.html @@ -3,7 +3,7 @@ - stdlib 41.2.0 Reference + stdlib 41.2.2 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-03-08 20:42:58 +Last updated 2018-09-03 17:48:42
    diff --git a/modules/std.table.html b/modules/std.table.html index 99af92e..2184872 100644 --- a/modules/std.table.html +++ b/modules/std.table.html @@ -3,7 +3,7 @@ - stdlib 41.2.0 Reference + stdlib 41.2.2 Reference @@ -24,7 +24,7 @@
    generated by LDoc 1.4.3 -Last updated 2015-03-08 20:42:58 +Last updated 2018-09-03 17:48:42