On 26 Mar 2011, at 14:55, Marco van de Voort wrote:

> In our previous episode, Sven Barth said:
>> 1. Record helpers in Delphi don't support inheritance. In FPC they do 
>> and I believe (see point 2) that record helpers in Delphi could support 
>> that as well, but it's been disabled on purpose. I personally think that 
>> inheritance for record helpers increases their use, because you can work 
>> around the "one helper per type" problem by using inheritance.
> 
> I though helpers were mostly static? How does the helped class know what
> exact instance is meant?

It's not for the helped class, and the result is still static since afaik 
virtual methods are not allowed for class helpers. Because only one class 
helper can be used for particular class at a time, if you want to enable both 
the routines of an existing helper and some extra routines in the current 
scope, you have to create a child of the existing helper and add those extra 
routines to this child. If you don't inherit from the existing helper then only 
the new routines will be available.


Jonas_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to