|
On 10/06/2022 01:08, Luiz Henrique de Figueiredo wrote:
if a == 1 then -- metamethod __eqYou can write this instead: if a:__eq(1) then
does that work if a is a Lua number?
Not as pretty but not terrible either. This assumes that the methods in your library work with objects and numbers, promoting numbers to objects as needed.