lua-users home
lua-l archive

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

> From: Vijay Aswadhati []
> Sent: Saturday, August 02, 2003 9:35 AM
> To: 'Lua list'
> Subject: What is differential inheritance? An example in Lua, Please.
> Steve Dekorte in a posting regarding windowing toolkits
> (Lui) mentioned about using Differential Inheritance if
> he were to rewrite Lui again.
> <>
> What is it and can anyone provide a good example in Lua
> OR point me to any appropriate links.

I *think* the reason for the comment is that the Yindo's window library
uses inheritance by delegation, which I can see being slower than moving
to a differential system. Inheritance by delegation works by using a
metamethod to search the parent class for a missing field in the local
class instance - in effect looking to see if you inherited a field. I
think if you moved to a differential system (i.e. make small
differential changes to each specialised class) you would aggregate all
of your fields at instance time to avoid doing the search every time you
need to look for an inherited field.