[fpc-devel] Delphi anonymous methods

Sven Barth pascaldragon at googlemail.com
Tue Mar 5 14:16:04 CET 2013


Am 05.03.2013 12:24, schrieb Marco van de Voort:
> In our previous episode, Sven Barth said:
>>> when Delphi announced them they had much more (you know of course).
>>> That was more a prototype of generics. But inspite of that we did not
>>> drop our own implementation.
>> Just to say one thing clear: I will NOT drop FPC's generic
>> implementation and I'll revert every commit that tries to do so, because
>> not only do we have to keep backwards compatibility, but the Delphi
>> syntax is a nightmare to parse.
> But you need to anyway because of mode delphi, so what is the point?
Because in mode Delphi the following will not work for quite some time 
(because it is so damn hard to parse):

=== example begin ===

SomeVar := SomeFunc<Something> - SomeType<Something>.SomeMethod * 
SomeOtherType<Something>.SomeMethod<Something>;

=== example end ===

while this will be much easier to implement:

=== example begin ===

SomeVar := specialize SomeFunc<Something> - specialize 
SomeType<Something>.SomeMethod * specialize 
SomeOtherType<Something>.specialize SomeMethod<Something>;

=== example end ===

(though "specialize SomeType<Something>" and "specialize 
SomeOtherType<Something>" are more likely to stay in type sections for 
now...)

Regards,
Sven



More information about the fpc-devel mailing list