lua-users home
lua-l archive

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


> Well, I have similar things, but <close> is not that needed, a pcall +
> call to __close() can do it. It 's uglier, but not that difficult, and
> you can wrap that in a with(to_be_closed_things, closure ) function.
> That being said, that's exactly what with thingies, try with resources
> or <close> are for and they make code prettier ( IMO ) and probably a
> tad faster.

An often neglected, but quite important aspect of __close is its
interaction with coroutine termination.  pcall + call don't do that.

-- Roberto