[fpc-pascal] class property accessor static
hnb.code at gmail.com
Tue Feb 7 13:25:16 CET 2017
2017-02-07 13:11 GMT+01:00 Mattias Gaertner <nc-gaertnma at netcologne.de>:
> That's an advantage of static methods.
> But how is that related to class properties?
> How can you use class properties with "methods designed for
> callbacks from external API"?
Is not related. AFAIK "class property" exist for complexity of language
(otherwise usage of "static" methods would be impossible for "property"
> Sorry, I don't get it.
> Why is using a static method as accessor an advantage?
You can use Get/Set pair of static methods in "property" form. Might be
> > and second: will work for improper implemented code ;)
> > (which is maybe disadvantage?):
> > TFoo($1).F;
> > TFooClass($1).F;
> I don't see why these calls require static instead of normal.
In other scenario (for normal "property") this call will raise AV.
btw. "class property" is probably slightly faster ;) because don't pass
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal