lua-users home
lua-l archive

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


How about simply having nested datastructures? Yes, it takes a few lookups instead of 1. But on the other hand you create less garbage to be collected when concating.


On Thu, Nov 8, 2012 at 4:36 AM, Marc Lepage <mlepage@antimeta.com> wrote:
I know it's trivial to hash on a single value, by putting it into a table field. I want to effectively store a composite key in a table: say, a string, a number, and another string.

Is there a way I can somehow produce a single hash of that combination of three values, to use as a key in a field? Something not obvious? Or must I effectively have a few levels of tables to hash 3 values? (And more for 4, 5, 6 values...)

Thanks,
Marc