[fpc-pascal] Delphi's anonymous functions in Free Pascal

Gregory M. Turner gmt at malth.us
Sat Oct 22 04:35:59 CEST 2011


----- Original Message -----
> 18.10.2011 0:53, Andrew Pennebaker пишет:
> > Does Free Pascal have anonymous functions that you can pass around,
> > e.g.
> > to a sort(compare : function, arr : array) function?
> >
> 
> anonymous functions = closures = lambdas are part of functional
> paradigm. object pascal itself is not functional language.
> But there is modern trend to design multiparadigm languages (usually
> OO
> + functional + imperative).
> Delphi followed this trend. So the question is: should freepascal
> follow
> this trend too?

Taking these terms in the broadest sense possible, wouldn't we say that OOP is mostly a functional development paradigm?

Not a rhetorical question, I seriously am not sure.

OP's somewhat idiosyncratic requirement to put all the OOP metadata in a separate interface section of your code kind of underlines what I'm talking about.  It seems to me that in OOP, whatever we might happen to do procedurally, there's a strong declarative odor to everything happening at the class/interface level.

-gmt



More information about the fpc-pascal mailing list