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

printf

-- いわゆるprintf。
function printf(...)
   local function wrapper(...) io.write(string.format(...)) end
   local status, result = pcall(wrapper, ...)
   if not status then error(result, 2) end
end

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