On Tue, 24 Feb 2015 11:23:41 +0100
Michael Schnell <mschn...@lumino.de> wrote:

> On 02/24/2015 11:12 AM, Sven Barth wrote:
> >
> >
> > AFAIK Delphi doesn't use the term "closures" though conceptually 
> > anonymous functions (as implemented by Delphi) are one way to achieve 
> > them.
> >
> What is the advantage of using a "closure" and/or an "anonymous 
> function" instead of just doing "free;" as the last instruction of a 
> normal procedure of some object ?

The advantage of anonymous is less typing, disadvantage is easy
misuse, for example adding redundancy and harder to debug.

About closures see for example:
https://en.wikipedia.org/wiki/Closure_%28computer_programming%29

Mattias
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to