[fpc-pascal] class property accessor static

Luiz Americo Pereira Camara luizamericop at gmail.com
Wed Feb 8 10:51:43 CET 2017


2017-02-07 23:17 GMT-03:00 Paul Ishenin <paul.ishenin at gmail.com>:

> 07.02.2017 18:10, Mattias Gaertner wrote:
>
>> The getter/setter of a class-property must be "static" (Delphi
>> compatible).
>> If I understand "static" correctly, then "static" simply omits passing
>> the class as parameter. So a static class procedure is just a dumber
>> version of a normal class procedure.
>>
>> What is the advantage of using "static" for class property accessors?
>> Aka: Why did Delphi choose static here?
>>
> Class properties has apperared together with class constants and class
> variables (which are static by their nature). They were introduced (as I
> understand) to give access to private/protected static elements.
>


For the record, there was a discussion about the topic years ago:
https://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg30511.html


Luiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20170208/2edba83f/attachment.html>


More information about the fpc-pascal mailing list