22, 2014 1:54 AM
To: fpc-devel@lists.freepascal.org
Subject: Re: [fpc-devel] Question about Syntax: I there a reason for this
design?
On 09/21/2014 06:36 PM, Boian Mitov wrote:
I consider it a design bug that local functions can’t be passed as anonymous
methods in Delphi. There is no reason
Am 22.09.2014 10:54 schrieb "Michael Schnell" :
>
> On 09/21/2014 06:36 PM, Boian Mitov wrote:
>>
>> I consider it a design bug that local functions can’t be passed as
anonymous methods in Delphi. There is no reason for that not to be done,
except that they did not bother.
>>
> ???
> Local functio
On 09/21/2014 06:36 PM, Boian Mitov wrote:
I consider it a design bug that local functions can't be passed as
anonymous methods in Delphi. There is no reason for that not to be
done, except that they did not bother.
???
Local functions can use local variables of the outer function. Same are
Am 21.09.2014 06:13, schrieb Jonas Maebe:
On 21/09/14 08:10, Samuel Herzog wrote:
But it's not accepted.
*procedure* TFormThreading.Button1Click(Sender: TObject);
*var*
aTask: ITask;
**procedure* *MyTask*;
*begin*
*sleep (3000); // 3 seconds*
*ShowMessage ('Hello');*
v.com
---
-Original Message-
From: Jonas Maebe
Sent: Sunday, September 21, 2014 10:23 AM
To: FPC developers' list
Subject: Re: [fpc-devel] Question about Syntax: I there a reason for this
design?
[Jonas: anonymous methods and local
[Jonas: anonymous methods and local functions could use the same syntax]
On 21/09/14 18:43, Boian Mitov wrote:
> I used to think the same way, until I actually started to use anonymous
> methods, and I realized what a full I used to be.
> The simplest difference is that you can return anonymous me
unday, September 21, 2014 3:13 AM
To: FPC developers' list
Subject: Re: [fpc-devel] Question about Syntax: I there a reason for this
design?
On 21/09/14 08:10, Samuel Herzog wrote:
As you observed, anonymous methods and nested routines are essentially
identical other than the syntax, and I
---
From: Samuel Herzog
Sent: Saturday, September 20, 2014 11:10 PM
To: FPC developers' list
Subject: [fpc-devel] Question about Syntax: I there a reason for this design?
I was looking at the following example in DXE7
http://delphiaball.co.uk/
procedure TFormThreading.Button1Click(Sender: TO
On 21.09.2014 12:13, Jonas Maebe wrote:
On 21/09/14 08:10, Samuel Herzog wrote:
But it's not accepted.
*procedure* TFormThreading.Button1Click(Sender: TObject);
*var*
aTask: ITask;
**procedure* *MyTask*;
*begin*
*sleep (3000); // 3 seconds*
*ShowMessage ('Hello');*
On 21/09/14 08:10, Samuel Herzog wrote:
> But it's not accepted.
>
> *procedure* TFormThreading.Button1Click(Sender: TObject);
> *var*
> aTask: ITask;
>
> **procedure* *MyTask*;
> *begin*
> *sleep (3000); // 3 seconds*
> *ShowMessage ('Hello');*
>* end*
>
> begin*
> //
I was looking at the following example in DXE7
http://delphiaball.co.uk/
procedure TFormThreading.Button1Click(Sender: TObject); var aTask: ITask; begin
// not a thread safe snippet aTask := TTask.Create (procedure () begin sleep
(3000); // 3 seconds ShowMessage ('Hello'); end); aTask.Start; end;
11 matches
Mail list logo