lua-users home
lua-l archive

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


Brett Bibby wrote:
Is it possible to set and handle metamethods from the C API?  Or can they
only be done in Lua?  Basically I want to intercept __index metamethods in
C, process them, and return the result to Lua without invoking the Lua
metamethods.

You can push a C function into a table's __index field and set that
table as another table's metatable, all from the C side if you like.

--Adam