Skip to content

Instantly share code, notes, and snippets.

----------------------------------------------------------------------------------------------------------------
-- AUTOMAGIC TABLES
----------------------------------------------------------------------------------------------------------------
-- There is a well-known "standard" implementation of automagic tables at http://lua-users.org/wiki/AutomagicTables
--
-- Unfortunately, that implementation behaves weirdly in some situations:
-- local a = AutomagicTable()
-- local x = a.b.c
-- local y = a.b.c
-- assert(x == y) -- assertion fails !