[fpc-pascal] [PATCH] Addition of OnNotify event on "TFPGObjectList" and "TFPGList" triggered on the insert, delete and extract methods.

Sven Barth pascaldragon at googlemail.com
Sun Feb 21 00:58:32 CET 2016


Am 20.02.2016 11:33 schrieb "denisgolovan" <denisgolovan at yandex.ru>:
>
> Hi
>
> That always keeps me wondering - why neither FPC, no any other mainstream
static-type language implements specialization based not only on types, but
on compile-time constants as well?
>

Then you don't consider C++ as mainstream, do you?

> I mean something like
>
>   TGenericList<T,options> = class
>     ...
>   end;
>
> procedure TGenericList<T,options>.Delete(index:integer);
> begin
>   if (nnNotifyDelete in options) and Assigned(FOnDelete) then
>      FOnDelete(...);
>   end;
> end;
>
> // usage
> type
>   TMyList = specialize TGenericList<integer, [nnNotifyAdd,
nnNotifyDelete, nnNotifyChange]>;

I had thought about this some time ago and then found a reason why I
wouldn't do it... Now if I'd only remember that reason -.-

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160221/2561fff3/attachment.html>


More information about the fpc-pascal mailing list