[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: RES: RES: Cryptic OOP syntax
- From: Klaus Ripke <paul-lua@...>
- Date: Tue, 1 Feb 2005 11:52:15 +0100
On Tuesday 01 February 2005 01:31, André de Leiradella wrote:
> But one thing that I like is being able to define all
> the class' members inside a block like
> I use lots of interfaces in Java, but I think they don't fit in Lua.
probably not as a compile-time concept.
A runtime check for whether some object "implements an interface"
(supports a given set of method names) should be feasible.
> Instead, I'd like to have multiple inheritance and I think it goes along
> the Lua lines of not limiting the programmer. How to handle methods
> declared in more than one inherited class is a discussion that I can't
> have right now, have to study a little first :)
> difficult to remember how each set of classes behave in terms of
> inheritance etc.
so inheritance seems to be the number one issue left,
especially where it also should open the "protected" backdoor.
Where a class is "final" (does not support a given inheritance
mechanism) there is no need to care about other internals either, right?
One approach satisfying a couple of your demands might be
Perl-style dynamic inheritance (as opposed to declarative),
where you gain access to the super's protected parts by passing
(an otherwise hidden version of) yourself to one or the others
super's "placement constructor", asking it to put them in your place,
as this also allows finetuning of multiple inheritance issues and such.