[fpc-pascal] Why does nested function get corrupted?
pascaldragon at googlemail.com
Sun Sep 11 21:22:05 CEST 2022
Ondrej Pokorny via fpc-pascal <fpc-pascal at lists.freepascal.org> schrieb am
So., 11. Sep. 2022, 15:29:
> Am 11.09.2022 um 14:22 schrieb Sven Barth via fpc-pascal:
> Ondrej Pokorny via fpc-pascal <fpc-pascal at lists.freepascal.org> schrieb
> am So., 11. Sep. 2022, 12:18:
>> Shouldn't this assignment be forbidden?
>> TProc = procedure is nested;
>> function TestNested: TProc;
>> result := procedure // why is this possible?
>> It is not a nested function but an anonymous one.
> And? An anonymous function is assignment compatible to multiple left sides
> depending on what it captures. See my announcement mail.
> Thank you Sven - I missed this info in your email.
It's an extension I had done compared to Delphi so that anonymous functions
are also usable without function references which are a bit more heavy
weight after all.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal