lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2018-01-13 11:59 GMT+02:00 Gavin Wraith <gavin@wra1th.plus.com>:
>
>>        end
>>        return true
>>      else
>>        return false
>>      end
>>    end
>
> I was looking for something that worked with ==.  But thanks
> anyway.

If just '==' is good enough, then a metamethod does it.

If you need to use tuples as an index into a table, raw equality
is needed. This can be done in many ways, such as memoizing,
serializing etc, but all the approaches work on the metatable of
the table, not of the tuple.