I have some lua code implemented with the standard binary operators ==,>,<,-,+,*,etc. I want to add some functionality with a lua object like imaginary numbers (not specifically imaginary numbers, but an answer with them in mind would still be exactly what I'm looking for). I want the original operators throughout the code to function without having to replace each instance of one of these operators with a function like mult(x,y) that would consider the case of a number being imaginary. In Python, one would use
__add__,__mul__,etc.
(see here if unfamiliar) I am looking for an analog in lua. Could I get a suggested class structure with this functionality in mind?