[fpc-devel] Delphi anonymous methods

Sven Barth pascaldragon at googlemail.com
Tue Mar 5 14:27:18 CET 2013


Am 05.03.2013 14:23, schrieb Alexander Klenin:
> On Wed, Mar 6, 2013 at 12:16 AM, Sven Barth <pascaldragon at googlemail.com> wrote:
>> 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...)
>>
> BTW, does anybody know why on earth the "sane" objFPC syntax still have
> those angle brackets instead of normal round ones?
>
I don't know why the one who first implemented them chose them, but now 
the reason is backwards compatibility.

Please note that I wouldn't have choosen round brackets either 
(potential conflicts with type casting) but more something like this:

=== snippet begin ===

specialize SomeType with (Something)

=== snippet end ===

Regards,
Sven



More information about the fpc-devel mailing list