[fpc-devel] Templates / Generics

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Nov 3 18:53:21 CET 2005


Hi all,

I want to push generics to the next level.
For those not familar, there is already a wiki about this topic:

http://www.freepascal.org/wiki/index.php/Generics

The page still contains a couple of different proposals, so I guess, the
syntax is not yet defined.
And there are still some unsolved problems, before we can start implementing
it.
My goal is to extend Lazarus first, so we can play with the new features,
before extending the compiler, which is much more complicated.

The syntax:
The wiki contains a few proposals, but does not mention the
advantages/disadvantages. So, here are some thoughts. Please comment and
tell, where you see problems or a better solution.

- Templates should work at least for: classes, classes of, interfaces,
objects, records, pointers, procedures/functions.
- Templates may also work for: procedure types
- Template parameters can be any type.
- Template parameters may be specialised (e.g. only)


Mattias



More information about the fpc-devel mailing list