Lua operators: Difference between revisions
From wikinotes
(Created page with "= Operator Overloading = <blockquote> Every object type in lua has a lua metatable.<br> The metatable can define custom methods like <code>__add</code> to perform addition. </blockquote><!-- Operator Overloading -->") |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
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> | ||
Every object type in lua has a [[lua metatable]].<br> | Every object type in lua has a [[lua metatable]].<br> | ||
The metatable can define custom methods like <code>__add</code> to perform addition. | The metatable can define custom methods like <code>__add</code> to perform addition. | ||
Here's a list of [https://www.lua.org/manual/5.4/manual.html#2.4 operator overloading methods] | |||
</blockquote><!-- Operator Overloading --> | </blockquote><!-- Operator Overloading --> |
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