[fpc-pascal] Pascal type-parametric definitions

Sven Barth pascaldragon at googlemail.com
Thu Mar 1 18:54:44 CET 2012


Am 01.03.2012 12:29 schrieb "Lukasz Stafiniak" <lukstafi at gmail.com>:
>
> Why are type-parametric definitions called generics in Pascal? It
> seems to me their semantics is like templates in C++, not like
> generics in Java/C# (or ML languages).

They are named generics, because they are "generic" as in "can be used for
everything". We do not need to follow the naming of other languages. Also
there is the possibility that FPC's generics might be optimized a bit for
inheritable types (class, object, interface) once they are feature
complete. Then they would behave more like Java generics for such types.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20120301/a5c5e7fe/attachment.html>


More information about the fpc-pascal mailing list