lua-users home
lua-l archive

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


> If you want to do this, and make it feel natural to Lua, then it is a
> bit of a pig to do: Create a table (T), assign it a fresh metatable
> (MT), add an __index metamethod to MT which reads the value from the C
> structure and then add a __newindex metatable to MT which writes the
> value to the C structure.

Or use a userdata instead of a table.