# Metatable

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Metatable
> Markdown URL: https://mediated.wiki/source/Metatable.md
> Source: https://en.wikipedia.org/wiki/Metatable
> Source revision: 1164724068
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Data holding structure that is designated to hold metadata}}
{{No footnotes|date=November 2021}}{{For|the object prototype mechanism in Lua|Lua (programming language)#Object-oriented programming}}
A '''metatable''' is the section of a [database](/source/database) or other [data](/source/data) holding structure that is designated to hold data that will act as [source code](/source/source_code) or [metadata](/source/Metadata_(computing)).  In most cases, specific [software](/source/software) has been written to read the data from the metatables and perform different actions depending on the data it finds.

==See also==
* [Magic number (programming)](/source/Magic_number_(programming))
* [Virtual method table](/source/Virtual_method_table)

==External links==
* [http://lua-users.org/wiki/BindingWithMetatableAndClosures Binding With Metatable And Closures]

Category:Metadata
Category:Programming constructs
Category:Software architecture

---
Adapted from the Wikipedia article [Metatable](https://en.wikipedia.org/wiki/Metatable) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Metatable?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
