模組:No globals

Permanently protected 個模組
出自維基百科,自由嘅百科全書
模組解[]
local mt = getmetatable(_G) or {}
function mt.__index (t, k)
	if k ~= 'arg' then
		error('試過去讀冇嘢嘅全域值 ' .. tostring(k), 2)
	end
	return nil
end
function mt.__newindex(t, k, v)
	if k ~= 'arg' then
		error('試過去寫入全域值 ' .. tostring(k), 2)
	end
	rawset(t, k, v)
end
setmetatable(_G, mt)