[fpc-devel] Packages, Generics
Willibald.Krenn at gmx.at
Mon Sep 13 14:51:57 CEST 2010
> > Well, it's the Delphi way of creating a new type rather than an
> > alias.
> Since they are still assignment compatible, I don't consider it as a
> really new type.
Are you sure they are assignment compatible? I thought the whole point of the type A = type B was to make a new type, not an alias.
> > Well, you know my opinion. This is type-unsafe,
> It is perfectly type safe.
Well. FPC checks types when specializing the template and not when "compiling" it.
> Well, I consider them more powerful than others because the C#
> programming style (having only one core implementation) can be done also
> with C++ style templates, see e.g. the fgl unit of fpc.
What do you mean by one core implementation? .NET generates one implementation for the class path, and different ones for value types.
But ok, we disagree on that matter.
> > And one last time - C#/.NET generics are not only some 'type cast
> > wrapper': think about working static fields, co-/contravariance ... .
> Yes. But the principle remains the same.
The semantics are different. Maybe not by very much, but still quite different.
Achtung Sicherheitswarnung: GMX warnt vor Phishing-Attacken!
More information about the fpc-devel