Salta al contegnùo

Modulo:No globals

Da Wikipedia, l'ençiclopedia libara.
Version del 17:31, 9 ago 2019 de Vajotwo (discusion | contribusion) (Pagina creà co 'local mt = getmetatable(_G) or {} function mt.__index (t, k) if k ~= 'arg' then error('Tried to read nil global ' .. tostring(k), 2) end return nil end function mt.__newind...')
(dif) ← Version pi vecia | Ultima version (dif) | Version pì nova → (dif)


local mt = getmetatable(_G) or {}
function mt.__index (t, k)
	if k ~= 'arg' then
		error('Tried to read nil global ' .. tostring(k), 2)
	end
	return nil
end
function mt.__newindex(t, k, v)
	if k ~= 'arg' then
		error('Tried to write global ' .. tostring(k), 2)
	end
	rawset(t, k, v)
end
setmetatable(_G, mt)
Traesto fora da Wikipèdia - L'ençiclopedia łìbara e cołaboradiva in łéngua Vèneta "https://vec.wikipedia.org/w/index.php?title=Modulo:No_globals&oldid=604693"