lua-users home
lua-l archive

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


Yes Roberto I know and I agree with you.
I just would like to know what are the main advantages of the hash usage in terms of flexility.

I guess loading code at runtime for example (it can load globals without knowing much details about it)... but I am sure there should be something more.
--
Marco Bambini
http://www.creolabs.com


On 08 Jan 2015, at 13:40, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:

one of the criticisms about Lua is the way it uses globals (using an hash table instead of a regular array and so performance suffers when globals are accessed).

I think this is an unfair (or more likely an uninformed) criticism.
Practically any dynamic language uses something like hash (or worse) to
access global variables.

-- Roberto