Re: Associative tuples
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Associative tuples
- From: Dirk Laurie <dirk.laurie@...>
- Date: 2018年1月13日 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.