On Sun, Jul 8, 2018 at 6:47 PM, Thorsten Engler <thorsten.eng...@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
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to