Waldek Hebisch wrote:
Prof. Abimbola A. Olowofoyeku wrote:
On 18 Jun 2005 at 19:57, Frank Heckenbach wrote:
Waldek Hebisch wrote:
[...]
I think that letting an object inherit from anything should work. In fact, one of my pet ideas is to let Pascal objects inherit from other language objects and vice-versa. AFAICS inheriting from Objective C objects is one of main CW Pascal extensions.
Surely, such code could break some patterns valid in single-model programming, but people who want to stay in a single model may do it, and the others probably will find added complexity worthwile.
Seems reasonable.
Is it possible to achieve inheritance from C++ objects?
I think so. Hard, but should be doable by re-using parts of C++ compiler.
There are nasty semantic problems: -- C++ names are case-sensitive -- C++ methods may be overloaded -- C++ methods may be inline -- templates
Still, there is Objective-C++ compiler which allows mixing Objective C with C++, so the problems are solvable.
I think overloading and inlining are things some here want to see anyway. Case-sensitive names are a problem, as always, but probably solvable similar to C names (perhaps using attributes etc.). IMHO templates are somewhat orthogonal, so perhaps we should leave them out (at first).
What about friends (maybe not a big problem), multiple inheritance, etc.? As I understand it, the virtual method calling mechanism is different because of multiple inheritance, possibly less efficent (is it?). If so, I'm a bit doubtful of changing it in GPC (at least, unconditionally), and we surely won't get it changed in G++ ...
Frank