[fpc-devel] Pure function Wiki page

J. Gareth Moreton gareth at moreton-family.com
Sun Jul 8 23:22:20 CEST 2018


That's my fault for using the wrong 
terminology in that case - feel free to 
fix it.

And yes, the directive tells the compiler 
that the programmer intends for this 
function to be pure. It still requires 
effort by the compiler to determine if 
it's eligible, because the only way to 
figure out if it is, and to actually 
calculate the values, is to emulate the 
pre-compiled nodes, and this will be 
relatively expensive to perform.

Gareth

P.S. Determining if a function has side-
effects or not, to aid data flow analysis, 
itself requires data flow analysis.

On Sun 08/07/18 22:43 , "Thorsten Engler" 
thorsten.engler at gmx.net sent:
> > -----Original Message-----
> 
> > From: fpc-devel  On Behalf Of
> > R0b0t1
> 
> > Sent: Monday, 9 July 2018 07:22
> 
> > 
> 
> > There were some other comments 
touching on
> reasons for or against a
> > keyword, and I apologize for not 
speaking to
> them precisely. But,
> > this is why I would like to avoid a 
keyword - it
> is redundant.
> 
> 
> People keep talking about keywords. As 
shown in the examples, pure is not a
> keyword. It's a context-sensitive 
directive. This is already wrongly stated
> in the proposal itself (so people can be 
excused for picking up on the use
> of the term "keyword" in the proposal) 
and it should be fixed (in
> the proposal).
> 
> 
> And it's not redundant. You are telling 
the compiler: I want this function
> to be pure. Please tell me if I made a 
mistake.
> 
> 
> Cheers,
> 
> Thorsten
> 
> 
> 
> 
__________________________________________
_____
> 
> fpc-devel maillist  -  fpc-
devel at lists.freepascal.org
> http://lists.freepascal.org/cgi-
bin/mailman/listinfo/fpc-devel
> 
> 
> 
> 




More information about the fpc-devel mailing list