| Current Path : /usr/share/doc/lua50/examples/ |
| Current File : //usr/share/doc/lua50/examples/undefined.lua |
-- catch "undefined" global variables
local f=function (t,i) error("undefined global variable `"..i.."'",2) end
setmetatable(getfenv(),{__index=f})
-- an example
a=1
c=3
print(a,b,c) -- `b' is undefined