metatables
Metatables are a feature of Lua that allow developers to customize the behavior of tables by associating them with another table called the metatable. Through a metatable, you can control how a table responds to operations such as indexing, assignment, or arithmetic, enabling patterns like prototype-based inheritance and operator overloading.
Lua consults the metatable when performing many operations. The __index metamethod defines lookup behavior for missing
Common uses include implementing simple object-oriented patterns, providing default values for missing keys, creating read-only wrappers,
Notes and limitations: metatables apply to tables and userdata, not primitive values. Some metamethods require symmetric