[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Let deprecate to-be-close variables as harmful concept
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 3 Oct 2023 16:31:09 -0300
> 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