[fpc-devel] Compile time functions

Dmitry Boyarintsev skalogryz.lists at gmail.com
Sun Jul 29 00:11:39 CEST 2018


These are known as “class” methods (rather than “static”) in object pascal.

Thanks,
Dmitry

On Saturday, July 28, 2018, J. Gareth Moreton <gareth at moreton-family.com>
wrote:

> Aah, right.
>
> I'm probably being rather dumb here from not having used them before, but
> do you mean things like this?
>
> type
>   TNewClass = class
>     function Special: Boolean; static;
> end;
>
> I gather you can't access Self in such methods.
>
> Gareth aka. Kit
>
>
> On Sat 28/07/18 20:37 , "Sven Barth" pascaldragon at googlemail.com sent:
>
> J. Gareth Moreton <gareth at moreton-family.com> schrieb am Sa., 28. Juli
> 2018, 19:34:
>
>> I did wonder about that, but wasn't sure how it would affect things where
>> inheritance is concerned.  I dare ask, do you have an example of a class
>> method that you would consider pure?
>>
>
> They don't have inheritance. If they have the modifier "static" they
> really are simply scoped functions or procedures. They can even be assigned
> to non-"of object" procedure variables.
>
> Regards,
> Sven
>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20180728/985809e3/attachment.html>


More information about the fpc-devel mailing list