[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua 5.4 Tuples FTW!
- From: Duane Leslie <parakleta@...>
- Date: Fri, 16 Mar 2018 21:11:23 +1100
> On 16 Mar 2018, at 17:54, Thomas Jericke <email@example.com> wrote:
> The problem I see, is that you don't get raw equality with any userdata implementation of tuples. So I cannot use them as table keys.
This can be solved using interning as is often done with strings, it just makes the constructor function more difficult and requires a `__gc` metamethod.
> Also they are passed by reference and not by value. That can be confusing once you edit a value in that tuple.
The passing method doesn't matter if the tuple is immutable (or copy-on-edit) so this isn't an issue.