Extensible semantics is a key feature of Lua, and the metatable concept allows Lua's tables to be customized in powerful ways. The following example demonstrates an "infinite" table. For any formula_2, fibs[n] will give the formula_2 Fibonacci number using dynamic programming and memoization.

fibs = { 1, 1 } -- Initial values for fibs[1] and fibs[2].
setmetatable(fibs, {

Tables
As array
Functions
Metatables