LuaRocks.org had a security incident in September 2026. Read the incident report.

luatable

A library that gives superpowers to Lua tables

$ luarocks install luatable

Extends Lua's table library with iterators, functional helpers, set operations and utilities. Enhanced tables get these as methods plus operator overloads. Works on Lua 5.1 - 5.4 and LuaJIT 2.1.

local table = require "luatable"
local t = table { 1, 2, 3, 4 }
print(t:accept(table.even):map(table.sqr):reduce(0, table.sum)) --> 20

Constructors: table{...} / table.new, of, init, zeros, ones, ofChars

Iterators: iter, range, group, slide, keys, values, inverse

Functional: map, reduce, accept, reject, each, eachi, flat, deepflat, flatmap, all, any, allPairs, anyPairs

Utilities: max, min, avg, maximize, minimize, sample, shuffle, reverse, slice, find, clone, merge, unique, purify, equal, keyList, valueList, valueSequence, tostring

Sets: union, negation, intersect, keySet, valueSet

Methods: at, get, first, last, has, haskey, empty, append, push, pop, head, lshift, rshift, shift, clear

Operators: + (union), - (negation), * (intersect), .. (merge), == (equal)

More examples: https://github.com/Luca96/lua-table

Versions

scm-1dev8 years ago99 downloads
0.8.0-13 days ago9 downloads

Dependencies

lua >= 5.1

Dependency for

lua-reg

Labels

Manifests