【Lua】組み込み系言語総合 その2【Squirrel】
■ このスレッドは過去ログ倉庫に格納されています
0735デフォルトの名無しさん
2009/12/20(日) 18:46:57call_with_finally = function (block)
local t, n = {}, 0
block(function (f)
n = n + 1
t[n] = f
end)
for i = n, 1, -1 do t[i]() end
end
call_with_finally(function (finally)
local resource = ...
finally(function ()
finalize(resource)
end)
:
:
end)
■ このスレッドは過去ログ倉庫に格納されています