[fpc-pascal] Traits Proposal

Adriaan van Os fpc at microbizz.nl
Wed Feb 17 17:59:35 CET 2021


To streamline the discussion, let me recapitulate:

1. multiple inheritance is nice to have, but it has the big issue that the inheritance tree becomes 
an inheritance graph and that makes overrules ambiguent.
2. interfaces don't have this issue with multiple inheritance, because they just declare, not implement
3. but that is also the weakness of interfaces,  as we don't want to reimplement the same code each 
time
4. so, we really want an multiple-inheritance graph at the declaration level with clear tree-like 
unambigous inheritance paths at the implementation level
5. thus, the idea is to "push-in" implementation code into an interface that integrates fully at 
the declaration level but is independent at the implementation level.

So, the idea (and the purpose of the discussion) I think is to implement (5) in an elegant way.

Regards,

Adriaan van Os



More information about the fpc-pascal mailing list