> On Sep 19, 2022, at 4:17 PM, Sven Barth wrote:
>
> === code begin ===
>
> Proc1 := @c.OnChange;
> Proc2 := @c.OnClick;
> Proc3 := @c2.OnChange;
>
> === code end ===
>
> Will result in the following capture object:
>
> === code begin ===
>
> type
> TCapturer = class(TInterfacedObject,
Hairy Pixels schrieb am So., 18. Sep. 2022, 02:50:
>
>
> > On Sep 17, 2022, at 10:57 PM, Sven Barth
> wrote:
> >
> > === code begin ===
> >
> > type
> > TProc = reference to procedure;
> > TMyClass = class
> > procedure DoThis;
> > end;
> >
> > TCapturer = class(TInterfacedObject, TP
> On Sep 17, 2022, at 10:57 PM, Sven Barth wrote:
>
> === code begin ===
>
> type
> TProc = reference to procedure;
> TMyClass = class
> procedure DoThis;
> end;
>
> TCapturer = class(TInterfacedObject, TProc)
> m: procedure of object;
> procedure Anonymous1;
>
> proc
Am 16.09.2022 um 03:53 schrieb Hairy Pixels:
On Sep 11, 2022, at 3:28 PM, Ondrej Pokorny via fpc-pascal
wrote:
You should be able to get the Invoke procedure pointer from the RTTI.
Sorry Sven mentioned this I must have glossed over it. So yes I am storing the
function reference in a class
> On Sep 11, 2022, at 3:28 PM, Ondrej Pokorny via fpc-pascal
> wrote:
>
> You should be able to get the Invoke procedure pointer from the RTTI.
Sorry Sven mentioned this I must have glossed over it. So yes I am storing the
function reference in a class so it’s not going to get freed.
Given
Am 15.09.2022 um 15:30 schrieb Hairy Pixels:
On Sep 15, 2022, at 12:28 PM, Sven Barth wrote:
As mentioned elsewhere function references are in fact interfaces. And you
can't retrieve a method pointer to a interface function, cause relying on that
would result in either memory leaks or prema
> On Sep 15, 2022, at 12:28 PM, Sven Barth wrote:
>
> As mentioned elsewhere function references are in fact interfaces. And you
> can't retrieve a method pointer to a interface function, cause relying on
> that would result in either memory leaks or premature release of the
> interface, bec
Am 08.09.2022 um 16:55 schrieb Hairy Pixels via fpc-pascal:
A function reference can call a class method but can you get the TMethod data
from function references? It was possible with “is object” to cast to TMethod
but that doesn’t seem to be possible with references.
=
type
TMyCl
Am 09.09.2022 um 00:49 schrieb Hairy Pixels via fpc-pascal:
On Sep 8, 2022, at 11:14 AM, Michael Van Canneyt via fpc-pascal
wrote:
It must keep this information somewhere, but this does not mean you can
typecast it to a TMethod.
Indeed. I wonder if this information could be exposed by some m
> On Sep 8, 2022, at 11:14 AM, Michael Van Canneyt via fpc-pascal
> wrote:
>
> It must keep this information somewhere, but this does not mean you can
> typecast it to a TMethod.
Indeed. I wonder if this information could be exposed by some method in the
interface? It would be useful to int
On Thu, 8 Sep 2022, Hairy Pixels via fpc-pascal wrote:
On Sep 8, 2022, at 9:09 AM, Michael Van Canneyt wrote:
To me it seems logical that you cannot do this, since a function reference is
actually an
interface, and there is no actual object to back it up.
Your function reference could
> On Sep 8, 2022, at 9:09 AM, Michael Van Canneyt
> wrote:
>
> To me it seems logical that you cannot do this, since a function reference is
> actually an
> interface, and there is no actual object to back it up.
>
> Your function reference could also be a regular procedure (no data at all)
On Thu, 8 Sep 2022, Hairy Pixels via fpc-pascal wrote:
A function reference can call a class method but can you get the TMethod data
from function references? It was possible with “is object” to cast to TMethod
but that doesn’t seem to be possible with references.
=
type
TMyClass
A function reference can call a class method but can you get the TMethod data
from function references? It was possible with “is object” to cast to TMethod
but that doesn’t seem to be possible with references.
=
type
TMyClass = class
constructor Create;
procedure DoThis;
end
14 matches
Mail list logo