lua-users home
lua-l archive

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


On 11/8/12, Enrique Garcia Cota <kikito@gmail.com> wrote:
>> 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.
>
> That is what I usually do when I have this problem.
>

The problem here is that hashing does not take table contents in
consideration. I wonder if it would make sense to have __eq influence
table hashing. That way it would be possible to simply store the
values in a table has key to another table. That would (imho) be the
cleanest approach, in accordance to the "table has the basic data
structure" mantra. (Mantras are a good thing :-) ).

Makes you miss Lisp's eq, eql, equal and equalp.