lua-users home
lua-l archive

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


Hi Javier,

thanks for your reply, i have changed the first post to explain things a
little bit better and i have also slightly changed the code to make it more
clear, if you can have a look at it again i will appreciate it.

What i am trying to do is simulate class inheritance in the way C++ handles
it, Class/Base/A/B are all classes definitions used to create instances
(through the same New function) and i would expect them to not affect each
other; redefining functions i am trying to simulate the "virtual"/"override"
behavior you can have in C++

when you say:

> in a class/instance, you could separate which fields belong to the 
> class (shared) and which are a 'template' to be copied to the 
> instance. 

how would i do that? how can i define a table to be "copied over" to the
instance?

Thanks again



--
View this message in context: http://lua.2524044.n2.nabble.com/inheritance-and-sub-tables-tp7656847p7656850.html
Sent from the Lua-l mailing list archive at Nabble.com.