Sven Barth via fpc-pascal wrote:
"However assigning a nested function variable to a function
reference is much harder.
Assigning a function reference to a nested function variable is hard
as well. "
"is nested" means that the actual function passed can be either global or local
Ryan Joseph via fpc-pascal schrieb am
Mi., 16. Feb. 2022, 07:59:
>
>
> > On Feb 16, 2022, at 2:46 AM, Sven Barth via fpc-pascal <
> fpc-pascal@lists.freepascal.org> wrote:
> >
> > // nested function/procedure/routine variable
> > type
> > TFoobarNested = function: LongInt is nested;
> >
> > var
Ryan Joseph via fpc-pascal schrieb am
Mi., 16. Feb. 2022, 03:14:
>
>
> > On Feb 15, 2022, at 11:09 PM, Sven Barth via fpc-pascal <
> fpc-pascal@lists.freepascal.org> wrote:
> >
> > For a global function the compiler has to generate a wrapper that gets
> rid of the Self parameter of the interface.
> On Feb 16, 2022, at 12:18 AM, Thomas Kurz via fpc-pascal
> wrote:
>
> What release are anonymous functions planed for? FPC 3.4.0?
They aren't even in trunk yet. Could be months or years.
Regards,
Ryan Joseph
___
fpc-pascal maillist - f
> On Feb 15, 2022, at 11:09 PM, Sven Barth via fpc-pascal
> wrote:
>
> For a global function the compiler has to generate a wrapper that gets rid of
> the Self parameter of the interface.
>
The compiler generates this interface at compile time right? And then when the
scope of the calling
> On Feb 16, 2022, at 2:46 AM, Sven Barth via fpc-pascal
> wrote:
>
> // nested function/procedure/routine variable
> type
> TFoobarNested = function: LongInt is nested;
>
> var
>f: TFoobarFuncRef;
> begin
> // anonymous function/procedure/routine
> f := function: LongInt
>
Am 15.02.2022 um 15:05 schrieb Ryan Joseph via fpc-pascal:
On Feb 15, 2022, at 8:26 PM, Sven Barth via fpc-pascal
wrote:
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
hard
> The "Reference to procedure" that will be part of anonymous functionswill do
> this for you.
What release are anonymous functions planed for? FPC 3.4.0?
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/
Ryan Joseph via fpc-pascal schrieb am
Di., 15. Feb. 2022, 15:02:
>
>
> > On Feb 15, 2022, at 8:32 PM, Sven Barth via fpc-pascal <
> fpc-pascal@lists.freepascal.org> wrote:
> >
> > A function reference is simply an interface of which the Invoke method
> can be called on the instance instead of man
Michael Van Canneyt via fpc-pascal
schrieb am Di., 15. Feb. 2022, 15:29:
>
>
> On Tue, 15 Feb 2022, Ryan Joseph via fpc-pascal wrote:
>
> >
> >
> >> On Feb 15, 2022, at 8:26 PM, Sven Barth via fpc-pascal <
> fpc-pascal@lists.freepascal.org> wrote:
> >>
> >> It's relatively "easy" to implement ass
On Tue, 15 Feb 2022, Michael Van Canneyt via fpc-pascal wrote:
On Tue, 15 Feb 2022, Ryan Joseph via fpc-pascal wrote:
On Feb 15, 2022, at 8:26 PM, Sven Barth via fpc-pascal
wrote:
It's relatively "easy" to implement assigning a nested function to
function references. However assign
On Tue, 15 Feb 2022, Ryan Joseph via fpc-pascal wrote:
On Feb 15, 2022, at 8:26 PM, Sven Barth via fpc-pascal
wrote:
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
hard
> On Feb 15, 2022, at 8:26 PM, Sven Barth via fpc-pascal
> wrote:
>
> 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.
> Assigning a function reference to a nested
> On Feb 15, 2022, at 8:32 PM, Sven Barth via fpc-pascal
> wrote:
>
> A function reference is simply an interface of which the Invoke method can be
> called on the instance instead of manually doing "Foo.Invoke".
>
> The real "magic" is when the compiler generates the *implementation* of sai
Ryan Joseph via fpc-pascal schrieb am
Di., 15. Feb. 2022, 13:14:
>
>
> > On Feb 15, 2022, at 5:15 PM, Sven Barth
> wrote:
> >
> > It contains a capture object that backs the method.
> > If nothing is captured and the right hand side is a direct function or
> method pointer then the compiler coul
Ryan Joseph via fpc-pascal schrieb am
Di., 15. Feb. 2022, 13:06:
>
>
> > On Feb 15, 2022, at 3:32 PM, Michael Van Canneyt via fpc-pascal <
> fpc-pascal@lists.freepascal.org> wrote:
> >
> > I requested that this:
> >
> > procedure TMyObject.Demo;
> >
> > Procedure DoSub;
> > begin
> >Writeln
Ryan Joseph via fpc-pascal schrieb am
Di., 15. Feb. 2022, 13:16:
>
>
> > On Feb 15, 2022, at 7:10 PM, Michael Van Canneyt
> wrote:
> >
> > In Delphi it is not. In FPC it should be :-)
>
> Indeed should be but that's what I'm trying to figure out with how this is
> implemented.
>
> Why wouldn't D
> On Feb 15, 2022, at 7:10 PM, Michael Van Canneyt
> wrote:
>
> In Delphi it is not. In FPC it should be :-)
Indeed should be but that's what I'm trying to figure out with how this is
implemented.
Why wouldn't Delphi be able to do this I wonder. The calling mechanism in this
object is not
> On Feb 15, 2022, at 5:15 PM, Sven Barth wrote:
>
> It contains a capture object that backs the method.
> If nothing is captured and the right hand side is a direct function or method
> pointer then the compiler could in principle create something that is
> essentially static to avoid alloc
On Tue, 15 Feb 2022, Ryan Joseph via fpc-pascal wrote:
On Feb 15, 2022, at 3:32 PM, Michael Van Canneyt via fpc-pascal
wrote:
I requested that this:
procedure TMyObject.Demo;
Procedure DoSub;
begin
Writeln('Sub');
end;
begin
DoTest(DoSub);
end;
So that means "reference to pro
> On Feb 15, 2022, at 3:32 PM, Michael Van Canneyt via fpc-pascal
> wrote:
>
> I requested that this:
>
> procedure TMyObject.Demo;
>
> Procedure DoSub;
> begin
>Writeln('Sub');
> end;
>
> begin
> DoTest(DoSub);
> end;
So that means "reference to procedure" is not compatible with "
Ryan Joseph via fpc-pascal schrieb am
Di., 15. Feb. 2022, 08:34:
>
>
> > On Feb 15, 2022, at 2:09 PM, Michael Van Canneyt via fpc-pascal <
> fpc-pascal@lists.freepascal.org> wrote:
> >
> > I've answered this question before:
> >
> > The "Reference to procedure" that will be part of anonymous
> fu
On Tue, 15 Feb 2022, Ryan Joseph via fpc-pascal wrote:
On Feb 15, 2022, at 2:09 PM, Michael Van Canneyt via fpc-pascal
wrote:
I've answered this question before:
The "Reference to procedure" that will be part of anonymous functionswill do
this for you.
I'm sorry I forgot! This thing
> On Feb 15, 2022, at 2:09 PM, Michael Van Canneyt via fpc-pascal
> wrote:
>
> I've answered this question before:
>
> The "Reference to procedure" that will be part of anonymous functionswill do
> this for you.
I'm sorry I forgot! This thing keeps coming up for me and driving me nuts but I
On Tue, 15 Feb 2022, Ryan Joseph via fpc-pascal wrote:
This has been a constant problem for me with FPC and wanted to make a formal
post with code examples since I've only mentioned it in passing before.
How can it be achieved to have a caller agnostic procedure variables? I've tried
making
This has been a constant problem for me with FPC and wanted to make a formal
post with code examples since I've only mentioned it in passing before.
How can it be achieved to have a caller agnostic procedure variables? I've
tried making some big crazy dispatch record that uses generics but becau
26 matches
Mail list logo