On 16.07.2015 19:21, Michael Van Canneyt wrote:
The whole generics mess that Delphi made goes completely against the
Pascal dictum that you must declare something before you can use it.

To me, the above verbose construction makes absolute sense. It has been
so since day 1:

PRecord = ^TRecord;
TRecord = record
   a : integer;
   next : PRecord;
end;

For things like the following you can't use the "declare before use" paradigm however:

=== code begin ===

type
  generic ITest<T> = interface
    function Foo: T;
  end;

  generic TTest<T> = class(TInterfacedObject, specialize ITest<T>)
    function Foo: T;
  end;

=== code end ===

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to