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 -->") |
|||
Line 3: | Line 3: | ||
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 --> |
Revision as of 21:06, 11 February 2024
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