lua-users home
lua-l archive

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


Somebody must have asked this before! Is there anybody
who can claim to have written a Lua program that uses
a table whose keys are neither numbers nor strings,
and for which this feature is essential?

When I first learned that Lua allowed any non-nil value
as a key, I thought "Wow - democracy for table-keys".
That was quite a time ago. But what properties do we actually
require of keys in a table? 1) that keys are distinguishable,
and sometimes 2) that keys form a linear order. Can anybody
suggest any other qualities that might be desirable?

-- 
Gavin Wraith (gavin@wra1th.plus.com)
Home page: http://www.wra1th.plus.com/