Anonymous procedures (Was: Re: [fpc-devel] for-in-index loop)

Sven Barth pascaldragon at googlemail.com
Sat Jan 26 15:57:28 CET 2013


On 26.01.2013 15:52, Alexander Klenin wrote:
> On Sun, Jan 27, 2013 at 12:26 AM, Paul Ishenin <paul.ishenin at gmail.com> wrote:
>> 26.01.13, 6:57, Alexander Klenin пишет:
>>
>> Why to invent a new solution if Delphi already have one:
>> http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/anonymousmethods_xml.html
>>
>
> Of course, the Delphi-compatible implementation is a basis --
> I did not even mention it, because I thought it is obvious.
> (Although I would still like to devise some solution for using
> closures for events --
> "IDE does not recognize them" seems quite a weak obstacle to me).
>

I assume this is because anonymous functions are not plain methods. Thus 
they are not compatible with TMethod (the type behind 
"procedure/function of object"). They are instead based on a different 
(internal) type.

> My proposals were for syntax extensions to eliminate the ugliness of
> procedure-inside-extression construct.

Too which I principially agree (the elimination of the ugliness, not 
necesserily the syntax proposed by Alexander)

Regards,
Sven




More information about the fpc-devel mailing list