Modules

base Adds to the existing global functions
bin Binary data utilities
debug Additions to the debug module
fstable Tables mapped to the filing system Only string keys are permitted; package.dirsep characters are converted to underscores.
getopt Simplified getopt, based on Svenne Panne's Haskell GetOpt.
Usage:
  • options = 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).
io Additions to the io module
lcs Longest Common Subsequence algorithm.
list Tables as lists.
math Additions to the math module.
mbox mbox parser.
object Prototype-based objects
  • Create an object/class:
    • object/class = prototype {value, ...; field = value ...}
    • An object's metatable is itself.
    • In the initialiser, unnamed values are assigned to the fields given by _init (assuming the default _clone).
    • 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 (...) ...
package
parser Parser generator.
set
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.
strbuf String buffers
string Additions to the string module TODO: Pretty printing (use in getopt); see source for details.
table
tree Tables as trees.

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!