<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Michael Van Canneyt via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>> schrieb am Di., 15. Feb. 2022, 15:29:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On Tue, 15 Feb 2022, Ryan Joseph via fpc-pascal wrote:<br>
<br>
><br>
><br>
>> On Feb 15, 2022, at 8:26 PM, Sven Barth via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-pascal@lists.freepascal.org</a>> wrote:<br>
>> <br>
>> It's relatively "easy" to implement assigning a nested function to function references. However assigning a nested function variable to a function reference is much harder.<br>
>> Assigning a function reference to a nested function variable is hard as well. <br>
>> <br>
><br>
> I'm getting lost with the terms now I think. <br>
> If your function takes a function reference parameter and you assign it a nested function pointer, <br>
> this is difficult? I believe this was Michaels request in that code snippet.<br>
<br>
Sven will need to confirm, but as I understand it:<br>
<br>
Procedure DoDemo(aTest : TProc);<br>
<br>
Procedure MyTest;<br>
<br>
Procedure DoSub;<br>
begin<br>
end;<br>
<br>
begin<br>
DoDemo(DoSub)<br>
end;<br>
<br>
is easy.<br>
<br>
but<br>
<br>
Procedure DoDemo(aTest : TProc);<br>
<br>
Procedure MyTest;<br>
<br>
Var<br>
ASub : procedure is nested;<br>
<br>
begin<br>
aSub:=SomeFunctionThatReturnsANestedProc;<br>
DoDemo(aSub);<br>
end;<br>
<br>
is difficult.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Correct (yes, I saw your addendum). </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>