lua-users home
lua-l archive

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




On Mon 7 Oct 2019, 23:24 Dibyendu Majumdar, <mobile@majumdar.org.uk> wrote:
One thing I realized while implementing this approach is that it
doesn't require folks to rewrite their libraries to implement __close
metamethods; i.e. user code can take advantage of deterministic
cleanup without having to use 5.4 only compatible libraries. In
particular, a patch can be applied to 5.3 to support this syntax.

Regards

This also means that you are not forcing any standards, i.e. your users need to know HOW to close any object, while with the <close> syntax they just need to know that they have to close them [1].

pocomane

P.S. I am enchanted by the simplicity of a go-like defer too.

[1] http://lua-users.org/lists/lua-l/2019-06/msg00735.html