Metatable

Noun · Development

Definitions

  1. In Lua, a regular table attached to another table that defines fallback behavior through metamethods — enabling operator overloading, inheritance, and custom indexing.

    In plain English: A special table in Lua that tells another table what to do in situations it doesn't handle on its own, like looking up missing keys.

    Example: "Set the metatable's __index to a prototype table and you've got poor man's inheritance in Lua."

Related Terms