[fpc-pascal] Generic type declaration example versus manual.

Anthony Walter sysrpl at gmail.com
Sun Nov 22 02:56:11 CET 2009

I haven't used generics in FPC, but really have to ask, is they
keyword generic really necessary? Shouldn't generics be declared like

  TList<T> = class
    function Add: T;
    procedure Remove(Item: T);
    property Item[Index: Integer]: T read Get write Put; default;

I believe this makes the most sense, and it's also how they are
declared in Delphi.

It would be a real shame to create more Delphi incompatibilities.

On Sat, Nov 21, 2009 at 1:24 PM, Micha Nelissen <micha at neli.hopto.org> wrote:
> Jonas Maebe wrote:
>> tgeneric16.pp is not an example, it's a test. Moreover, it doesn't compile
>> yet, not even with FPC 2.5.1. So documenting that syntax is not really a
>> good idea.
> His comment doesn't really apply to tgeneric16 specifically, but more to
>  generic syntax in general.
> Micha
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal

More information about the fpc-pascal mailing list