Jump to content

Module:No globals

Fram Wikipidia

Documentation for this module may be created atModule:No globals/doc

localmt=getmetatable(_G)or{}
functionmt.__index(t,k)
ifk~='arg'then
error('Tried to read nil global '..tostring(k),2)
end
returnnil
end
functionmt.__newindex(t,k,v)
ifk~='arg'then
error('Tried to write global '..tostring(k),2)
end
rawset(t,k,v)
end
setmetatable(_G,mt)