lua-users home
lua-l archive

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


On 26.06.2011 8:35, Andre Leiradella wrote:

When writing bindings I usually get the key string in __index/__newindex metamethods and compute some hash with them which then I use in a switch. It would be nice if I could save the time spent in computing this hash since Lua already has one.

How about a table to map needed keys to switch indexes?

--
Best regards,
Sergey Rozhenko                 mailto:sergroj@mail.ru