<p>Am 22.09.2014 10:54 schrieb "Michael Schnell" <<a href="mailto:mschnell@lumino.de">mschnell@lumino.de</a>>:<br>
><br>
> On 09/21/2014 06:36 PM, Boian Mitov wrote:<br>
>><br>
>> 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.<br>
>><br>
> ???<br>
> Local functions can use local variables of the outer function. Same are logically undefined outside the outer function and technically stack based. Hence a local function can't be passed anywhere.</p>
<p>You do know that anonymous functions can use variables contained in the function they are defined in as well? Also local functions can be passed around in Delphi and recent FPC functions, but you shouldn't call them once the containing function as exited (so for local callbacks they are useable).</p>
<p>Regards,<br>
Sven</p>