[fpc-devel] Delphi anonymous methods

Alexander Klenin klenin at gmail.com
Mon Mar 4 06:11:58 CET 2013


On Mon, Mar 4, 2013 at 4:06 PM, Boian Mitov <mitov at mitov.com> wrote:
> Here is another even simpler example:
>
> AItem := GComponentEditorList.Find(
>                function( AItem : IComponentEditorItem ) : Boolean
>                begin
>                  Result := ( AComponent is AItem.GetInstance().ComponentClass );
>                end
>             );

Note that with proposed "lambda" syntax this will be even shorter:

AItem := GComponentEditorList.Find(
               lambda TComponentEditorListFilter as
                 AComponent is AItem.GetInstance().ComponentClass;
            );

P. S. Boian, could you please
stop top-posting and splitting your thoughts into so many emails?
It will make discussion much easier to follow.

--
Alexander S. Klenin



More information about the fpc-devel mailing list