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

2013-01-26 Thread Sven Barth
On 26.01.2013 20:12, Alexander Klenin wrote: On Sun, Jan 27, 2013 at 3:10 AM, Sven Barth wrote: On 26.01.2013 16:34, Alexander Klenin wrote: Ok, then let's take just one step back: SomeProc(lambda TProc1 as Writeln(aArg)); This way, but problems are solved -- procedure type is specified indep

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

2013-01-26 Thread Alexander Klenin
On Sun, Jan 27, 2013 at 3:51 AM, Marco van de Voort wrote: > In our previous episode, Alexander Klenin said: >> > >> > Please take a look at this: >> > http://blog.barrkel.com/2010/01/using-anonymous-methods-in-method.html >> >> While this article confirms my understainding of them Delphi implemen

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

2013-01-26 Thread Alexander Klenin
On Sun, Jan 27, 2013 at 3:10 AM, Sven Barth wrote: > On 26.01.2013 16:34, Alexander Klenin wrote: >> Ok, then let's take just one step back: >> SomeProc(lambda TProc1 as Writeln(aArg)); >> >> This way, but problems are solved -- procedure type is specified >> independently from the parameter type,

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

2013-01-26 Thread Marco van de Voort
In our previous episode, Alexander Klenin said: > > > > Please take a look at this: > > http://blog.barrkel.com/2010/01/using-anonymous-methods-in-method.html > > While this article confirms my understainding of them Delphi implementation, > it does not offer a solution. > The solution must come a

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

2013-01-26 Thread Sven Barth
On 26.01.2013 16:34, Alexander Klenin wrote: On Sat, Jan 26, 2013 at 8:31 PM, Sven Barth wrote: On 25.01.2013 23:57, Alexander Klenin wrote: You have also proposed lambda-expressions: map.Iterate(lambda TFPGMapLongInt.TIteratorProc(aKey, aData) as Writeln(aKey, ' => ', aData.ClassName));

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

2013-01-26 Thread Alexander Klenin
On Sun, Jan 27, 2013 at 1:59 AM, kyan wrote: >> 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. > > Please take a look at thi

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

2013-01-26 Thread Alexander Klenin
On Sat, Jan 26, 2013 at 8:31 PM, Sven Barth wrote: > On 25.01.2013 23:57, Alexander Klenin wrote: >> You have also proposed lambda-expressions: >>> >>> map.Iterate(lambda TFPGMapLongInt.TIteratorProc(aKey, aData) as >>> Writeln(aKey, ' => ', aData.ClassName)); >> >> >> I think that they are not op

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

2013-01-26 Thread kyan
On Sat, Jan 26, 2013 at 4:57 PM, Sven Barth wrote: > On 26.01.2013 15:52, Alexander Klenin wrote: >> >> On Sun, Jan 27, 2013 at 12:26 AM, Paul Ishenin >> wrote: >>> >>> 26.01.13, 6:57, Alexander Klenin пишет: >>> >>> Why to invent a new solution if Delphi already have one: >>> >>> http://docs.emb

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

2013-01-26 Thread Sven Barth
On 26.01.2013 15:52, Alexander Klenin wrote: On Sun, Jan 27, 2013 at 12:26 AM, Paul Ishenin 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/ano

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

2013-01-26 Thread Alexander Klenin
On Sun, Jan 27, 2013 at 12:26 AM, Paul Ishenin 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

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

2013-01-26 Thread Paul Ishenin
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 Best regards, Paul Ishenin ___ f

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

2013-01-26 Thread Sven Barth
On 25.01.2013 23:57, Alexander Klenin wrote: On Sat, Jan 26, 2013 at 5:17 AM, Sven Barth wrote: One could also do an alternative (though currently not with arrays, but with type helper support even that would be possible...): Yes, this is certainly the most interesting alternative. Actually,

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

2013-01-25 Thread Alexander Klenin
On Sat, Jan 26, 2013 at 5:17 AM, Sven Barth wrote: > One could also do an alternative (though currently not with arrays, but with > type helper support even that would be possible...): Yes, this is certainly the most interesting alternative. Actually, anonymous procedures/closures is the "real" t