[fpc-pascal] [fpc-devel] Nested function closures

Ryan Joseph genericptr at gmail.com
Wed Apr 28 03:18:35 CEST 2021



> On Apr 27, 2021, at 4:53 PM, Graeme Geldenhuys via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> 
> Why must the anonymous function repeat all that information again,
> as shown in the quoted code above? Can't the compiler figure all
> that out simply by inference? All the developer should have to do
> is give the 2 parameters a name, and a function body (block of
> code). Thus you could end up with something like this:
> 
> 
>     value.SortEntities((a, b) ->
>       begin
>         // do stuff with a and b, then
>         // return some integer.
>       end
>     );

I agree it's verbose but the syntax is already decided upon and implemented already.

Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list