2017-02-07 13:11 GMT+01:00 Mattias Gaertner <nc-gaert...@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" syntax). > 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 more handy. > > 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 "self" parameter. -- Best regards, Maciej Izak
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal