lua-users home
lua-l archive

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


What do people think of the idea of having a locals table? I havent made the
leap to Lua5 yet. I've been trying to follow various threads though.

In Lua, you can do meta method stuff on globals and tables but not locals
(please correct me if I'm wrong). It would be fairly easy to retrieve locals
and put them in a table (I think the debug library allows this). I'm not
sure how meta methods would work with this. If locals returned a table of
local variables, could you apply metamethods to the table until the scope
expired?  eg. It might be useful for a debugger if you could read locals and
monitor writes to them.

Nick