[fpc-devel] Compile time functions

J. Gareth Moreton gareth at moreton-family.com
Sat Jul 28 18:33:54 CEST 2018


 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?

 And yes, object methods can't be pure because accessing the fields of the
current object (Self) is internally dereferencing a pointer .

 Gareth aka. Kit

 On Sat 28/07/18 18:14 , "Sven Barth" pascaldragon at googlemail.com sent:
 J. Gareth Moreton  schrieb am Sa., 28. Juli 2018, 18:49:
  Another little progress update with implementing pure functions.
 1. In my code (not submitted yet), the compiler now recognises and accepts
the 'pure' directive.  There are a number of other directives that it
can't be used with ('noreturn' being one of them) and it can't be used on
object methods.
 You could allow it for static class methods which don't have a Self
argument and are essentially scoped ordinary routines. 
  Regards, Sven   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20180728/32909012/attachment.html>


More information about the fpc-devel mailing list