local contents
local f = io.open("myfile")
do
contents =
f:read()
finally
f:close()
end
This obviates the need for __close handling, and makes all the discussion
about panic handlers and __gc moot since we would have control over the order of
"closing" and the handling of errors with nested do... finally... end and
pcall.