Luaで良く作る関数 ~table編~

table.empty

-- 配列が空かどうかの判定
-- 引数にnilを渡しても「空」とみなす。
function table.empty (tbl)
	if tbl==nil then return true end
	return not next (tbl)
end

トップ   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS