[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: __close and nil error
- From: bil til <biltil52@...>
- Date: Mon, 26 Sep 2022 20:00:05 +0200
John Belmonte <firstname.lastname@example.org>:
> I noticed a possible issue of the __close metamethod: nil is a valid value for raising errors, but __close cannot distinguish between nil error and no error.
Would you mind to show here 2 or 3 small and typical Lua "Code
snippets", where I could recognize, when __close is invoked "normally"
or "by error event"?
... this different invocation somehow sounds interesting to me, but I
do not really feel sure what this means "in real Lua life".
(in reference manual there is no example code. And as unfortunately
__close I think is NOT handled in the "Programming in Lua" book by
Roberto (I do not find any reference to "__close" there), otherwise
usually PiL is a great source to find helpful code examples...).