[fpc-devel] New feature announcement: constant parameters for generics

Ben Grasset operator97 at gmail.com
Sun Apr 26 18:09:05 CEST 2020

On Sun, Apr 26, 2020 at 4:08 AM Anthony Walter via fpc-devel <
fpc-devel at lists.freepascal.org> wrote:

> Thank you Ryan and Sven. Your work is much appreciated as usual.
> However, Michael beat me to it in asking how this feature is useful. I am
> sure there might be use cases, but for right now I am coming up without any
> real advantages. Could anyone with better insight than me please explain?

A simple, but IMO exciting use case is just that it can provide
impossible-to-achieve-otherwise optimizations via const propagation.

For example, some functions and procedures that used to have to take
numerical values as regular parameters can now instead take them as generic
constant parameters, which allows the compiler to "carry them farther" than
it ever would have previously.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20200426/059b1a13/attachment.html>

More information about the fpc-devel mailing list