[fpc-devel] Proposal for 2 new compiler functions

J. Gareth Moreton gareth at moreton-family.com
Tue Jun 12 20:33:07 CEST 2018


That would be nice, but I don't think Free 
Pascal supports such a concept, at least 
not yet. It would certainly be much more 
flexible and allow such functions to be 
distributed as part of a mathematical 
package, say.

The concept of a pure function is useful 
to determine for other purposes as well 
(insomuch that pure functions are far 
easier to online).

Gareth

On Tue 12/06/18 19:26 , "David Pethes" 
public at satd.sk sent:
> Hi,
> 
> given the description, maybe compile 
time function execution is what
> 
> you're looking for as a general solution 
instead of builtins?
> 
> 
https://en.wikipedia.org/wiki/Compile_time
_function_execution
> 
> 
> David
> 
> 
> 
> On 12. 6. 2018 14:42, J. Gareth Moreton 
wrote:
> 
> 
> 
> > Why should they be in-built though? 
With the
> binary search example, the
> > size of the list is sometimes known at 
compile
> time, hence is a constant
> > - therefore, its logarithm is also a
> constant.  By pre-calculating the
> > logarithm using the in-built function, 
it can be
> used to aid
> > optimization such as loop unrolling. 
> 
> 
> 
> 
> 




More information about the fpc-devel mailing list