[fpc-devel] Pure function Wiki page

Sven Barth pascaldragon at googlemail.com
Mon Jul 9 11:25:35 CEST 2018


Ryan Joseph <ryan at thealchemistguild.com> schrieb am Mo., 9. Juli 2018,
08:45:

>
>
> > On Jul 8, 2018, at 8:50 AM, J. Gareth Moreton <gareth at moreton-family.com>
> wrote:
> >
> > With some blessing from Florian on the concept, I've set up a Wiki page
> discussing the design proposals for the support of pure functions, as well
> as some explanation on what they actually are.
> >
>
> What are the performance benefits? It sounds like this is a proposal for a
> compiler optimization which we can explicitly opt in to, but what exactly
> is the optimization?
>
> If nothing else I like the idea as a way to enforce a function is not
> accessing global state. Kind of like const for functions.
>

It would allow you to declare constants that use those functions with the
compiler evaluating them at compile time.
Also the compiler might be able to optimize such functions better
especially if they're inlined. *shrugs*

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20180709/1ef0fc97/attachment.html>


More information about the fpc-devel mailing list