Why have __add or __unm at all anyway
On 2018-04-07 05:34 PM, Albert Chan wrote:
This is legal in Lua, so why not only a __bshr meta method and callSame reason we have __sub operator (for convenience):
this with a negative shift count for the << operator?
A - B = A + (-B)
A + (-B) is legal in Lua, so why not ...
A + B == A - (0 - B)
-A == (0 - A)
Also why have __mul
A * B == A / (1 / B)
And so on.