[fpc-pascal] Generic type declaration example versus manual.
sur.pignard at wanadoo.fr
Sun Nov 22 21:17:47 CET 2009
Thanks for your proposal.
I'm a bit surprised of Delphi chosen syntax because
"TList<T>=class ..." breaks Pascal usual type declaration
"Id=type;" and "<T>=" may be confused with greater or equal operator.
Have you some documentation available on Internet?
The one I found is Delphi Object Pascal Language Guide, version 7, 2002.
Generic types are not described in it ;-(
Le 22 nov. 09 à 12:00, fpc-pascal-request at lists.freepascal.org a écrit :
> From: Anthony Walter <sysrpl at gmail.com>
> Subject: Re: [fpc-pascal] Generic type declaration example versus
> 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.
More information about the fpc-pascal