4 ms·
You can set __index on the global table's metatable. Basically: "run this hook whenever I try to access an undefined field". setmetatable(_G, {__index=func
by silentbicycle 15y ago
You can set __index on the global table's metatable. Basically: "run this hook whenever I try to access an undefined field".
setmetatable(_G, {__index=function(global_env, name) print("unknown: " .. name) end})