lua-users home
lua-l archive

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

I have an object with metatable RECORD and several objects which are
specialized RECORDs, with metatables OBJ1, OBJ2 etc. There are certain
methods and metamethods that are common to all RECORDs and others that
are specific to each specialization.

For non-meta methods the situation is easy: OBJ1.__index = RECORD.

However, for metamethods, access is raw. There is no other way except
copying the metamethods from RECORD into OBJ1 etc.

Or is there?