[fpc-pascal] Re: New multicast event implementation

Sven Barth pascaldragon at googlemail.com
Thu Feb 3 12:40:46 CET 2011


Am 02.02.2011 15:40, schrieb Anthony Walter:
> By the way, does Free Pascal generic support generic constraints yet?
> Also, this format seems more natural to me:
>

They aren't implemented currently, but I hope they will at some time.

> TCollection<T: TCollectionItem> = class
>    property Count: Integer;
>    property Items[Index: Integer]: T;
> end;
>
> TStatusPanels = class(TCollection<TStatusPanel>);
>
> rather than ...
>
> generic TCollection<T> = class // no constrain ability
>    property Count: Integer;
>    property Items[Index: Integer]: T;
> end;
>
> TStatusPanels = specialize TCollection<TStatusPanel>;

When using FPC 2.5.1 you can use the Delphi compatible syntax in mode 
Delphi (not supported in mode ObjFPC).

When constraints are implemented they should work in both modes.

Regards,
Sven



More information about the fpc-pascal mailing list