lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Jun 12, 2019 at 3:46 PM Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> Right now, my only complain with the <toclose> is the term "close" that I
> found a bit vague and over-loaded (conceptually).

Suggestions are welcome.

Name aside, what about something similar to:
http://luajit.org/ext_ffi_api.html#ffi_gc

E.g.

local f = toclose(io.open("myfile"), function(f)
  f:close()
end)
io.close(toclose(f, nil))