[fpc-devel] Question about Syntax: I there a reason for this design?
pascaldragon at googlemail.com
Mon Sep 22 11:10:33 CEST 2014
Am 22.09.2014 10:54 schrieb "Michael Schnell" <mschnell at lumino.de>:
> 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
logically undefined outside the outer function and technically stack based.
Hence a local function can't be passed anywhere.
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).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-devel