[fpc-devel] Packages, Generics

Willibald Krenn Willibald.Krenn at gmx.at
Mon Sep 13 12:31:38 CEST 2010


> > OTOH 'specialize' is an additional
> > (unfamiliar) keyword and has semantics totally unknown to the world.
> > So why not take what's already in the language?
> 
> As I said, to emphasis that a new type is created, generic
> specialization is something really new to the language. The meaning of
> type ... = type ...; is imo very unclear.

Well, it's the Delphi way of creating a new type rather than an alias.

> > FPC's generics are, however, very different to all other
> > implementations of generics that I know of. And I really(!) hope,
> > that FPC does not do the C++ like duck-typing, which could give
> 
> FPC works in this regard as C++ which is not nice but much more flexible
> being not only some type cast wrapper generator as in C# etc.

Well, you know my opinion. This is type-unsafe, C-style, poor-man's generics. You are asking for trouble by following that route. 

And one last time - C#/.NET generics are not only some 'type cast wrapper': think about working static fields, co-/contravariance ... . Java generics, however, could be described as type cast wrapper generators. And everybody on earth knows that Java generics are broken.

> Let us know if you've something working and regarding the branch: just
> tell me if you need one.

Ok, thanks!

 Willi
-- 
GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für nur 19,99 Euro/mtl.!*
http://portal.gmx.net/de/go/dsl



More information about the fpc-devel mailing list