lua-users home
lua-l archive

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

> const char* lua_tohstring( lua_State *L, int index, unsigned int *hash );
> 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 could you use the hash in a switch statement if the hash result
isn't a compile-time calculation?