[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Associative tuples
- From: Dirk Laurie <dirk.laurie@...>
- Date: Sat, 13 Jan 2018 13:28:51 +0200
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.