[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Metamethods and inheritance
- From: Dirk Laurie <dirk.laurie@...>
- Date: Tue, 31 Oct 2017 12:24:58 +0200
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?