lua-users home
lua-l archive

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


Curious why/when you need such a function? Would the retrieval become
dependent on how the accessor is implemented, which would lead to that
the client code will rely on implementation details of API provider?

On Sun, Oct 26, 2014 at 10:10 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 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.
>