lua-users home
lua-l archive

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

> However, I cannot fathom why anyone would want to use 
> floating point keys in a hash table. Integer indexes and
> string indexes make sense, but what is ` x[1.5] = "foo" ' 
> supposed to express? What languages besides Lua allow you to do that

> Anyway, to solve the problem with this (IMO) uncommon case, 
> I think conversion from the floating point to a string would 
> be the simplest solution. Perhaps Lua should do this internally?

A memory allocation every time you use a number as an index? No thanks.