RAII metamethod magic #89
stefanos82
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In one of our previous discussions that inspired you to implement Lua's
<close>
in Nelua, made me think about it even further.Here's how your original
raii.nelua
example looks like, with someprint()
s for debugging:What I have had in mind for a couple of days now is the following code that looks closer to C++'s RAII than the example above:
Assuming Nelua supports these two new metamethods, do you think it's something that could simplify code even further?
Beta Was this translation helpful? Give feedback.
All reactions