メニューを切り替える
Toggle preferences menu
個人設定を切り替える
ログインしていません
編集を行うと、IPアドレスが公開されます。

「モジュール:No globals」の版間の差分

提供:Sleeping Cocoon-wiki
テンプレート>Pneuma
first creation
 
1版 をインポートしました
 
(相違点なし)

2025年1月11日 (土) 11:40時点における最新版

このモジュールについての説明文ページを モジュール:No globals/doc に作成できます

スクリプトエラー: Lua エラー: 内部エラー: インタープリターは終了コード 2 で終了しました。

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)