lua-users home
lua-l archive

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


> 	Just out of curiosity, there is a good reason to create two classes of
> variables?

Performance.


> Why not having a locals table for each function and create
> them at run time? 

Lua local variables are ~3 times faster than global (table field)
variables, without counting the time to create/collect those tables.
Moreover, the "unit" of scope in Lua is a block, not a function (so you
would need several tables for each function...)

-- Roberto