lua-users home
lua-l archive

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



On 12/6/06, Ivan Smirnov <i.s.smirnov@gmail.com> wrote:
Hello everyone, I've come up to the problem of 'true' inheritance realization in Lua recently. Being correctly implemented, this can give you a full control over data inheritance and storage.

I see the mechanism you want to implement, but I cannot think of the practical problem(s) which it solves. Could you provide a concrete, real life design issue, which is solved in a smarter way by your framework?

Besides, beware that subtyping in records is a very tricky issue, easily leading to unsound programs:  

  http://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)

You might also be interested into looking at Scala, which gives users a fine control on subtyping: http://scala.epfl.ch. It illustrates how tricky class variance is, when you want to do it soundly.