|
On 16.03.2018 09:12, William Ahern
wrote:
Not saying that this doesn't work, but what would I use as the key of the ephemeron table? I still need to somehow "hash" or concatenation the tuple into some raw type. And then why I am asking myself, why don't just use tables all the way. Maybe there is a performance benefit?On Fri, Mar 16, 2018 at 07:54:12AM +0100, Thomas Jericke wrote:On 16.03.2018 00:37, Duane Leslie wrote:Hi, A quick and dirty tuple implementation using the new multi-uservalue userdata implementation.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. For example I cannot use tuples to index a matrix. t = {} t[tuple(2,2)] = 42 print(tuple(2,2)) -- prints nilYou can memoize using an ephemeron table. -- Thomas |