On 04/03/2013 05:00, Boian Mitov wrote:
One thing for sure, I probably will very much never need to declare TThread inherited classes. I can use a single anonymous method for that, thanks to the ability of the anonymous method to capture local and member variables. This is something not doable with closure as it has fixed number of parameters ;-) .

Afaik, that is exactly what a closure is. To capture the scope/environment of the surrounding code (including the local variables of the procedure in which it is declared.

An anonymous method just skips the name, and allows to declare it in-line.

Delphi may not offer them individually. I do not know... But this is not about what Delphi offers.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to