[fpc-pascal] Check In Interface Type Helpers

Marcos Douglas B. Santos md at delfire.net
Wed Aug 23 16:57:59 CEST 2017


On Wed, Aug 23, 2017 at 11:00 AM, Anthony Walter <sysrpl at gmail.com> wrote:
> Marcos, it doesn't work that way.
>
> Type helpers simply allow you to extend an existing type with new methods
> and/or properties. When you declare a type helper you extend all instances
> of said type given that:
>
> A) You 'use' the unit declaring the type helper in some other unit.
> B) No other unit you're using also defines a type helper for that same type.
> Only one type helper per type allowed.
>
> As to what they are useful for, consider the following:
>
> type
>   // IShellLink is define by Microsoft
>   IShellLinkHelper = record helper for IShellLink
>   public
>     procedure Save(const Target, Description, Link: string);
>   end;

Anthony,

I understood. In fact, this is a great feature for whose work with
interfaces a lot.
We can have small interfaces but add some methods in just some places,
extending such interfaces.

Is this compatible with Delphi?

Best regards,
Marcos Douglas



More information about the fpc-pascal mailing list