lua-users home
lua-l archive

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


Carlos:

On Wed, May 13, 2020 at 4:32 AM Carlos Aguilar <capagp@gmail.com> wrote:

> My point is that in Lua, inheritance is performed by means of tables (metatables), but in C the function checks not only for inheritance based in tables but also in the type of the actual instance, in my example a userdata. However, given that one has a userdata in first place, and that check has been successful, inheritance check should be performed next based only on tables (metatables).

Lua does not have a class system, or an inheritance system. It has
facilities to build them and some helpers for some ways of building
them. If you need a different one, its easy to build, I've managed to
do at least two, one of them supporting mapping multiple inheritance
in the c++ side, and I'm not a great Lua programmer, just build your
own inheritance checks functions, mines are about a hundred C lines,
not that complicated.

Francisco Olarte.
_______________________________________________
lua-l mailing list -- lua-l@lists.lua.org
To unsubscribe send an email to lua-l-leave@lists.lua.org