[fpc-devel] Delphi anonymous methods

Michael Van Canneyt michael at freepascal.org
Mon Mar 4 15:28:07 CET 2013



On Tue, 5 Mar 2013, Alexander Klenin wrote:

>
> 4) With both "lambda" and "as" syntax:
> ATree.VisitPreorder(lambda TVisitor as X + 5);
>
> Now, my argument is that (2) does indeed have only a marginal
> advantage over (1),
> but (4) is powerful enough to really make functional-style programming
> practically useful (as opposed to theoretically possible).

Pascal is declarative, not functional.
Trying to import elements from the second into the first is misguided.

There is of course no *technical* reason why you cannot do this.

But you must have some regard for the basic properties and design principles of Pascal.

Otherwise you have no place in a pascal community, but should go 
and use some other language. Use Javascript, python, whatever suits you best.

I can understand one wants the functionality of closures, but I draw the line at 
the rape of Pascal syntax people are proposing here.

I play chess. The rules of chess have not evolved in a long time.
It doesn't make the game less popular or interesting to those that play it.
I dare you to propose a new movement or a new piece, and see how the chess community reacts.

Michael.



More information about the fpc-devel mailing list