lua-users home
lua-l archive

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

On Tue, Sep 27, 2022 at 1:56 AM Roberto Ierusalimschy <> wrote:
You mean calling the method without 'self'??

Right, it wasn't a good idea.
A nil as an error object seems quite unusual. By now, a quite simple
solution would be to "normalize" a nil to false when calling __close.

I imagine it's rare-- though it can be achieved simply by `error()`.  On the other hand, if you're writing a library, or there is 3rd party code invoked within the scope of to-be-closed, you can't really guess what error values may be used.

Normalizing to false doesn't seem better, as boolean is also a valid error value.  If it's deemed worth fixing, adding a status arg seems best.