[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5 and tags
- From: Mark Hamburg <mhamburg@...>
- Date: Mon, 26 Jul 2004 08:17:20 -0700
If you can live with single-inheritance, my scheme using indices in the
metatable will work with the type-testing technique used in Oberon. Single
inheritance allows us to know that a class is at a particular depth in the
inheritance tree. The metatable for a class can then include the appropriate
light userdata for each class in its inheritance hierarchy. Testing for
class membership then becomes something like:
luaObj.metatable[ classInfo->depth ] == classInfo
Mark