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

Gregory M. Turner gmt at malth.us
Thu Oct 20 21:09:01 CEST 2011


----- Original Message -----
> Am 19.10.2011 20:23, schrieb Andrew Pennebaker:
> > Practical uses for referencable anonymous functions:
> 
> For such applications one uses procedure variables in pascal.
> 

> > (map (lambda (x) (+ x 1)) '(1 2 3))
> > 
> > -> (2 3 4)

[snip!]

> I still don't see why this cannot be done by procedure variables: one
> can easily pass a procedure reference to a compare function to any
> sort
> library call. The example is far from explaining why it is needed to
> be
> able to return a reference to an anonymous method to the outside of
> the
> enclosing function.

[not_sure_if_serious.png]

Interesting discussion -- at least for me, I didn't know Delphi had this feature.

In case anyone really doesn't see the point, consider that this thing:

  http://www.youtube.com/watch?v=cYw2ewoO6c4

has all the capabilities of Object Pascal (with less flowery syntactic sugar to mess up the purity of the system).

:P

--
Greg Turner

P.S., hello, list!




More information about the fpc-pascal mailing list