lua-users home
lua-l archive

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


It is easy to code in Lua a function that returns the actual table
or function from which an indexing operation eventually retrieves
its value, unless some metatable along the line is locked, in which
case it returns the value of the lock. Just take `gettable_event` from
the 5.2 manual and modify all the return statements (expanding the
very last one to return the lock if h is not a table).

This is clearly an operation that shou;d in principle be much
easier and more efficient at the level of Lua's source code.
It would it be nice to have such a function in (a) the Lua API
(b) the debug library.