withFile defeats dead handle closure

Ryan Trinkle ryan at trinkle.org
Wed Dec 30 21:18:11 UTC 2020

I think David's suggestion may have been that withFile would still close
the file at the end of the block, but would *also* close it if the
handle died.

On 12/30/20 4:05 PM, Henning Thielemann wrote:
> On Wed, 30 Dec 2020, Ryan Trinkle via Libraries wrote:
>> Although it might be nice to have a weak-reference-based alternative to
>> withFile, I think it would be best to keep the behavior of withFile as
>> predictable as possible (i.e. the current behavior), since closing a
>> file can be semantically significant.
> Right, if I open and close and re-open a file, it must be closed
> before I can re-open it.

More information about the Libraries mailing list