<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial'; COLOR: #000000">
<DIV> Hi Sam,</DIV>
<DIV> </DIV>
<DIV>You can watch my CodeRage session last year explaining the huge advantages
of the first syntax.</DIV>
<DIV>That being said, 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.</DIV>
<DIV>I hope if FPC implements anonymous methods, that they will also allow local
functions to be passed, and outdo Delphi :-) .</DIV>
<DIV> </DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial'; COLOR: #000000">With best
regards,<BR>Boian
Mitov<BR><BR>-------------------------------------------------------<BR>Mitov
Software<BR>www.mitov.com<BR>-------------------------------------------------------</DIV>
<DIV
style='FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline'>
<DIV style="FONT: 10pt tahoma">
<DIV><FONT face=Arial></FONT> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=sam_herzog@yahoo.com
href="mailto:sam_herzog@yahoo.com">Samuel Herzog</A> </DIV>
<DIV><B>Sent:</B> Saturday, September 20, 2014 11:10 PM</DIV>
<DIV><B>To:</B> <A title=fpc-devel@lists.freepascal.org
href="mailto:fpc-devel@lists.freepascal.org">FPC developers' list</A> </DIV>
<DIV><B>Subject:</B> [fpc-devel] Question about Syntax: I there a reason for
this design?</DIV></DIV></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV></DIV>
<DIV
style='FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline'>
<DIV
style="FONT-SIZE: 14px; FONT-FAMILY: helveticaneue, helvetica neue, helvetica, arial, lucida grande, sans-serif; COLOR: #000; BACKGROUND-COLOR: #fff">
<DIV>I was looking at the following example in DXE7</DIV>
<DIV><A href="http://delphiaball.co.uk/">http://delphiaball.co.uk/</A></DIV><PRE><B>procedure</B> TFormThreading.Button1Click(Sender: TObject);
<B>var</B>
aTask: ITask;
<B>begin</B>
// not a thread safe snippet
aTask := TTask.Create (<B>procedure</B> ()
<B>begin</B>
sleep (3000); // 3 seconds
ShowMessage ('Hello');
<B>end</B>);
aTask.Start;
<B>end</B>;</PRE>
<DIV
style="FONT-SIZE: 14px; FONT-FAMILY: helveticaneue,helvetica neue,helvetica,arial,lucida grande,sans-serif; COLOR: rgb(0,0,0); FONT-STYLE: normal; BACKGROUND-COLOR: transparent"> </DIV>
<DIV
style="FONT-SIZE: 14px; FONT-FAMILY: helveticaneue,helvetica neue,helvetica,arial,lucida grande,sans-serif; COLOR: rgb(0,0,0); FONT-STYLE: normal; BACKGROUND-COLOR: transparent">I
dislike this syntax and tried to write it this way because I think it's better
readable code.</DIV>
<DIV
style="FONT-SIZE: 14px; FONT-FAMILY: helveticaneue,helvetica neue,helvetica,arial,lucida grande,sans-serif; COLOR: rgb(0,0,0); FONT-STYLE: normal; BACKGROUND-COLOR: transparent">But
it's not accepted.<BR></DIV><PRE><B>procedure</B> TFormThreading.Button1Click(Sender: TObject);
<B>var</B>
aTask: ITask;
<BR><B><B> procedure</B> </B><SPAN>MyTask</SPAN><B>;
<B>begin</B>
</B><SPAN>sleep (3000); // 3 seconds</SPAN><B>
</B><SPAN>ShowMessage ('Hello');</SPAN><B>
<B> end</B><BR><BR>begin</B>
// not a thread safe snippet
aTask := TTask.Create(<B>MyTask</B>);
aTask.Start;
<B>end</B>;</PRE>
<DIV class=yui_3_16_0_6_1411278637955_60
style="FONT-SIZE: 14px; FONT-FAMILY: helveticaneue,helvetica neue,helvetica,arial,lucida grande,sans-serif; COLOR: rgb(0,0,0); FONT-STYLE: normal; BACKGROUND-COLOR: transparent">I
just wonder if there is a valuable reason to do it why my example is not allowed
or would it be easy to make this available in free-pascal?</DIV>
<DIV class=yui_3_16_0_6_1411278637955_60
style="FONT-SIZE: 14px; FONT-FAMILY: helveticaneue,helvetica neue,helvetica,arial,lucida grande,sans-serif; COLOR: rgb(0,0,0); FONT-STYLE: normal; BACKGROUND-COLOR: transparent"> </DIV>
<DIV class=yui_3_16_0_6_1411278637955_60
style="FONT-SIZE: 14px; FONT-FAMILY: helveticaneue,helvetica neue,helvetica,arial,lucida grande,sans-serif; COLOR: rgb(0,0,0); FONT-STYLE: normal; BACKGROUND-COLOR: transparent">Thank
you.</DIV>
<DIV
style="FONT-SIZE: 14px; FONT-FAMILY: helveticaneue,helvetica
neue,helvetica,arial,lucida grande,sans-serif; COLOR: rgb(0,0,0); FONT-STYLE: normal; BACKGROUND-COLOR: transparent">Sam<BR></DIV>
<DIV
style="FONT-SIZE: 14px; FONT-FAMILY: helveticaneue,helvetica neue,helvetica,arial,lucida grande,sans-serif; COLOR: rgb(0,0,0); FONT-STYLE: normal; BACKGROUND-COLOR: transparent"><BR><SPAN></SPAN></DIV>
<DIV
style="FONT-SIZE: 14px; FONT-FAMILY: helveticaneue,helvetica neue,helvetica,arial,lucida grande,sans-serif; COLOR: rgb(0,0,0); FONT-STYLE: normal; BACKGROUND-COLOR: transparent"><SPAN><BR></SPAN></DIV>
<DIV> </DIV>
<DIV
style="FONT-SIZE: 14px; FONT-FAMILY: helveticaneue, helvetica neue, helvetica, arial, lucida grande, sans-serif">
<DIV
style="FONT-SIZE: 12pt; FONT-FAMILY: helveticaneue, helvetica neue, helvetica, arial, lucida grande, sans-serif">
<DIV>
<HR SIZE=1>
<FONT size=2 face=Arial><B><SPAN
style="FONT-WEIGHT: bold"></SPAN></B></FONT><BR></DIV></DIV></DIV></DIV>
<P>
<HR>
_______________________________________________<BR>fpc-devel maillist
-
fpc-devel@lists.freepascal.org<BR>http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel<BR></DIV></DIV></DIV></BODY></HTML>