[fpc-devel] Delphi anonymous methods

Boian Mitov mitov at mitov.com
Mon Mar 4 05:54:16 CET 2013


Here is example:

Parallel execution with selection of executor:

for i := 0 to AMaxScaleIndex - 1 do
  begin
  APerIterationLocations.Add( TRTDynamicList<TVLImageRect>.Create() );
  AExecutionTask.Add( AExecutor.Execute(
      procedure()
      begin
        ProcessOne( levelScale[ i ], img, hitThreshold, winStride, padding, 
APerIterationLocations[ i ] );
      end
    ));

  end;

In this case, not only you save declaration, you save the need to write a 
whole new class just for the task.
This code reduced well over 30 lines of code alone.
I have a lot of other examples as well ;-) .

With best regards,
Boian Mitov

-------------------------------------------------------
Mitov Software
www.mitov.com
-------------------------------------------------------
-----Original Message----- 
From: Martin
Sent: Sunday, March 03, 2013 8:42 PM
To: FPC developers' list
Subject: Re: [fpc-devel] Delphi anonymous methods

On 04/03/2013 03:49, Boian Mitov wrote:
Well I give you the benefit of the doubt, and believe you. But that does
not help me, because I still do not know which case you are talking
about.... So for my benefit, please enlighten me with an example.





More information about the fpc-devel mailing list