[fpc-devel] Pure function Wiki page

Dmitry Boyarintsev skalogryz.lists at gmail.com
Mon Jul 9 01:00:13 CEST 2018


On Sun, Jul 8, 2018 at 6:47 PM, Thorsten Engler <thorsten.engler at gmx.net>
wrote:

> You are thinking about something like:
>
>
>
> const
>
>   x = FunctionCall(42);
>
>
>
> In which case, yes, the compiler could possibly see that as in implicit
> “check if that function is pure”.
>
>
>
> But “constant expressions” can also be something like:
>
>
>
> If FunctionCall(42) > 0 then
>
>
>
> In which case you don’t want the compiler to have to test every single
> expression in your program to see if it is composed (all the way down) of
> pure functions.
>

Maybe a different approach should be taken?
Determine how much performance impact is made to determine the purity of a
function. and then consider adding a new directive and a keyword.

thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20180708/c81e9f0e/attachment.html>


More information about the fpc-devel mailing list