Module:User:Theknightwho/strict

local error = error

local new_G = {} new_G.__index = new_G setmetatable(_G, new_G)

for k, v in pairs(_G) do	new_G[k] = v	_G[k] = nil end

function new_G:__index(k) if k == "arg" or k == "_G" then return new_G[k] elseif new_G[k] then error("variable '" .. k .. "' is a global", 2) end error("variable '" .. k .. "' is not declared", 2) end

function new_G:__newindex(k, v)	if k ~= "arg" then error("assign to undeclared variable '" .. k .. "'", 2) end new_G[k] = v end