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

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

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 <mi...@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-pas...@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to