Lua operators: Difference between revisions
From wikinotes
No edit summary |
|||
Line 1: | Line 1: | ||
= Documentation = | |||
<blockquote> | |||
{| class="wikitable" | |||
|- | |||
| operator overloading metatable keys || https://www.lua.org/manual/5.4/manual.html#2.4 | |||
|- | |||
|} | |||
</blockquote><!-- Documentation --> | |||
= Operator Overloading = | = Operator Overloading = | ||
<blockquote> | <blockquote> |
Latest revision as of 21:07, 11 February 2024
Documentation
operator overloading metatable keys https://www.lua.org/manual/5.4/manual.html#2.4
Operator Overloading
Every object type in lua has a lua metatable.
The metatable can define custom methods like__add
to perform addition. Here's a list of operator overloading methods