[fpc-devel] Delphi anonymous methods

Michael Van Canneyt michael at freepascal.org
Mon Mar 4 18:03:58 CET 2013



On Mon, 4 Mar 2013, Boian Mitov wrote:

> Ye, by writing 20 times more code for the same.
> What here I can do with 3 lines, otherwise needs declaration of a new class, 
> new interface and new instance of the class.
> So what I can do here i 15 seconds would take me 1 hour to do traditionally.

This is not correct.

For anonymous functions you do not need to declare a new class. 
Just name a local method.
That means move a line, and put a name in front of it. No more, no less.

Michael.



More information about the fpc-devel mailing list