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" [email protected] 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. > > > > > _______________________________________________ fpc-devel maillist - [email protected] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
