Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Lua Shell Makefile

string: improve render and reuse for pickle and memoize.

* specs/std_spec.yaml (tostring): Adjust for more compact output.
* specs/string_spec.yaml (tostring): Likewise.
(pickle): Adjust expected output for simplified output.
(pickle returns hash keys in a stable order): Removed. Sorting
pickled tables only slows down the pickler.
(render): Adjust example to sort keys to enable comparing with
known outputs.
* lib/std/base.lua (pickle_table): Remove.
(render): Pass previous key and value as new arguments to pair
dispatch function.
Delegate decision about whether an element is a 'terminal' that
can be rendered immediately by the `elem` dispatch function
using a new `term` dispatch function instead of hardcoding.
(tostring): Output in a more compact format by skipping integer
keys in sequences and initial sequence part of a mixed table,
which requires sorting the output pairs by key.
(pickle): Move from here...
* lib/std/string.lua (pickle): here, but reimplement over
render using new `pair` and `term` facilities.

Signed-off-by: Gary V. Vaughan <>
latest commit ebe9285ea0
@gvvaughan gvvaughan authored

Standard Lua libraries

by the stdlib project

License travis-ci status Stories in Ready

This is a collection of Lua libraries for Lua 5.1, 5.2 and 5.3. The libraries are copyright by their authors 2000-2015 (see the AUTHORS file for details), and released under the MIT license (the same license as Lua itself). There is no warranty.

Stdlib has no prerequisites beyond a standard Lua system.


The simplest way to install stdlib is with LuaRocks. To install the latest release (recommended):

luarocks install stdlib

To install current git master (for testing):

luarocks install

To install without LuaRocks, check out the sources from the repository, and then run the following commands: the dependencies are listed in the dependencies entry of the file stdlib-rockspec.lua. You will also need autoconf and automake.

cd lua-stdlib
autoreconf --force --version --install
make all check install

See INSTALL for instructions for configure.


As well as requiring individual libraries, you can load the standard set with

require "std"

Modules not in the standard set may be removed from future versions of stdlib.


The libraries are documented in LDoc. Pre-built HTML files are included in the release.

Bug reports and code contributions

These libraries are written and maintained by their users. Please make bug report and suggestions on GitHub (see URL at top of file). Pull requests are especially appreciated.

Something went wrong with that request. Please try again.