I seem to recall Lua has something similar to Ruby's method_missing. Or am I remembering incorrectly?
Doesn't Lua have something comparable to Ruby's method_missing?
Asked Answered
The __index
and __newindex
of a table's metatable can be used to the same effect as Ruby's method_missing
.
Yes, upon more vigilant googling I found this URL lua.org/pil/13.4.1.html from the Lua manual which states: "when we access an absent field in a table .... such access triggers the interpreter to look for an __index metamethod" –
Otway
© 2022 - 2024 — McMap. All rights reserved.