Hacker News new | ask | show | jobs
by silentbicycle 5258 days 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})