[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: RES: Standard Object Reflection (was Re: OOP in daydream...)
- From: Mark Hamburg <mhamburg@...>
- Date: Wed, 19 Jan 2005 13:15:28 -0800
on 1/19/05 9:02 AM, PA at email@example.com wrote:
>> . The syntax to call inherited methods
> What about something like: anInstance:super:doIt()?
That would only work for one level of inheritance.
Maybe the C++ approach of explicitly naming the parent class has some merit,
though it also has maintenance issues. Those issues could be handle by
defining a local variable named something like "super" at the beginning of a
What gets more interesting is when one builds a multiple inheritance system
that sequences the super classes. Then the next method (as opposed to the
inherited method) depends on the over all chain. For example, given classes
A and B as base classes for multiple-inheritance, it might be interesting to
function A:method( param )
call_next_method( self, A, "method", param )
self.field = param
One could also write an implementation for B that did appropriate chaining
and get different results depending on whether one descended from A and B or
B and A.