[fpc-pascal] Traits Proposal

Sven Barth pascaldragon at googlemail.com
Fri Feb 19 19:01:23 CET 2021


Ryan Joseph via fpc-pascal <fpc-pascal at lists.freepascal.org> schrieb am
Fr., 19. Feb. 2021, 17:32:

> Btw, here's point of reference for this other proposed syntax.
>
> https://github.com/genericptr/freepascal/wiki/Default-Implements-Property


Your example is not quite correct and it's also not really complete: if a
class implements an interface there *must* be a parent class mentioned (at
least TObject). Also your example should demonstrate that one can call
TMyShape.Draw without having to retrieve the interface (after all that's
the point of the interface property).

Additionally support for raw interfaces (aka Corba) should be added for
interface delegation if it isn't already supported. (Otherwise your
TMyShape either needs to inherit from e.g. TInterfacedObject or one of the
involved types needs to implement the methods of IInterface.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20210219/5d0e8300/attachment.htm>


More information about the fpc-pascal mailing list