[fpc-pascal] Delphi compatible anonymous functions

Craig Peterson craig at scootersoftware.com
Wed May 21 17:52:56 CEST 2014


On 5/18/2014 2:34 AM, Florian Klämpfl wrote:
> I wanted only to point out that personally I would first work on OpenMP support than implementing
> anonymous methods (which I consider anyways very un-pascalish) and closures.

That's fair.  I wouldn't expect anyone who's philosophically opposed to
the idea to work on it.  The last time it came up it sounded like some
of the other devs were interested, and there was at least grudging
acceptance that it would eventually be added for Delphi compatibility.
I'd just like to hurry that up.

OpenMP support would certainly be nice, but it's also only half of the
reason I want anonymous methods, and it doesn't seem like the timeframe
for that would be any faster.

> To be honest, I see anonymous methods and closures not much earlier in a stable release: if they are
> not implemented and merged during the next few months, they will not go into the next major release
> (somewhere in 2015). Between major releases we have usually 3 years, so 4 years at least as well for
> anonymous methods/closures.

I don't mind keeping a fork of a stable release with the feature
backported, if that's what it takes, though obviously I'd prefer it to
be in properly.  Sven, if you're still following the thread, would a
bounty help bump the priority enough for you to work on it before the
2.8 cutoff?

> Yes, that's what I meant. Closures/anonymous methods allow sometimes (in my eyes seldomly) some
> source line savings in modern pascal, no more no less.

We'll have to agree to disagree on that.  I think it's useful for
encapsulating asynchronous callbacks and improving readability by
keeping the callback code near the setup location and removing data
marshalling scaffolding.

I know our GUI design combined with the number of different asynchronous
calls is rare in the Pascal community though, so I agree that for a lot
of developers it won't be as large of a benefit.

-- 
Craig Peterson
Scooter Software




More information about the fpc-pascal mailing list