I'm not super familiar with Lua so just to make sure I'm understanding you correctly are you referring to to-be-closed variables?
If so, I think the difference is that in C++/Rust RAII is the default and is quite pervasive as a result. To-be-closed variables seem like IDisposable in C# or try-with-resources in Java in that they allow the programmer to use RAII-like semantics but are opt-in.
Manually implementing the Drop trait, perhaps, but the same can't be said for the drop operation, which you always get at the end of scope unless you opt out (which is very much a rare thing to do).
Replies (1)
If so, I think the difference is that in C++/Rust RAII is the default and is quite pervasive as a result. To-be-closed variables seem like IDisposable in C# or try-with-resources in Java in that they allow the programmer to use RAII-like semantics but are opt-in.
Replies (1)
Replies (1)