[fpc-pascal]Any plans for multiple inheritence?

Nikolay Nikolov nickysn1983 at netscape.net
Thu May 1 12:31:15 CEST 2003


paradice at paradicesoftware.com wrote:

>Just wondering, are there any plans for implementing multiple class
>inheritence in the FPC compiler? So that you can have a class that inherits
>from two separate ancestors, and can override or call  methods contained in
>either of them. In most [maybe all] cases you can work around; usually by
>making one of your ancestor types descendent from the other [not ideal...],
>or implementing the shared methods twice, but multiple inheritence can
>occasionally be a handy feature.
>  
>
Fpc is going to support interfaces as in Delphi. (I think they're 
already supported in the 1.1 version.) Interfaces turn out to be a 
convenient alternative to multiple inheritance. Modern object oriented 
languages (Delphi, Java, C#), support interfaces instead of multiple 
inheritance. There are several reasons for this, most of them you'll 
realise if you start learning C++ :). (What happens if, say B and C are 
classes that inherit from A, and D inherits both B and C, then D shoud 
have 2 copies of A... multiple inheritence is such a joy :) )




More information about the fpc-pascal mailing list