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.