Re: [fpc-devel] (ref types / circles) Re: Defer keyword

2021-05-10 Thread Sven Barth via fpc-devel
Am 09.05.2021 um 17:14 schrieb Ryan Joseph via fpc-devel: On May 9, 2021, at 3:40 AM, Sven Barth wrote: === code begin === {$mode objfpc} type TTest = class protected procedure DoSomething; end; TTestSub = class refcounted(TTest) public procedure Test; end;

Re: [fpc-devel] Defer keyword

2021-05-10 Thread Kostas Michalopoulos via fpc-devel
On 5/8/2021 8:27 PM, Ryan Joseph via fpc-devel wrote: That was a bad example. It's for ANY class really. o := TObject.Create.AutoRelease; Then next event cycle the autorelease pool frees all the objects added to it. Very simple but effective however we can't do this in Pascal without a new

Re: [fpc-devel] (ref types / circles) Re: Defer keyword

2021-05-10 Thread Ryan Joseph via fpc-devel
> On May 10, 2021, at 3:05 PM, Sven Barth via fpc-devel > wrote: > > Why should they? You pass the reference to a non-reference counted > parameter/field/variable, the reference count is increased and then what? It > sits there for the remaining life time of the program, because nothing >

Re: [fpc-devel] (ref types / circles) Re: Defer keyword

2021-05-10 Thread Ryan Joseph via fpc-devel
Over the weekend I fixed up my old default property code to work with records only which implement classes (which reduced lots of the complexity). It's actually a pretty clean and small implementation so I put a patch you can look at and try. It's not decided upon but this is a place to start

Re: [fpc-devel] (ref types / circles) Re: Defer keyword

2021-05-10 Thread Sven Barth via fpc-devel
Am 09.05.2021 um 16:58 schrieb Ryan Joseph via fpc-devel: On May 9, 2021, at 3:40 AM, Sven Barth wrote: It seems that you don't work much with classes then. If one disallows the assignment of a reference counted class to a non-reference counted one then you can't use e.g.

Re: [fpc-devel] Defer keyword

2021-05-10 Thread Kostas Michalopoulos via fpc-devel
On 5/11/2021 4:09 AM, Ryan Joseph via fpc-devel wrote: On May 10, 2021, at 5:59 PM, Kostas Michalopoulos via fpc-devel wrote: You do not need any special language feature for that, you can simply do something like ReleaseLater(TObject.Create) yes but we can't get back the

Re: [fpc-devel] Google APIs - Authenticate using a service account?

2021-05-10 Thread Wayne Sherman via fpc-devel
On Tue, Jun 30, 2020 at 12:47 AM Michael Van Canneyt wrote: > > The problem with the service account is that you must create a JWT Token. > FPC does not yet have a unit that can generate *and sign* a JWT Token. > > The good news is I have this weekend a reminder that I received some code > that

Re: [fpc-devel] Defer keyword

2021-05-10 Thread Ryan Joseph via fpc-devel
> On May 10, 2021, at 5:59 PM, Kostas Michalopoulos via fpc-devel > wrote: > > You do not need any special language feature for that, you can simply do > something like > >ReleaseLater(TObject.Create) yes but we can't get back the reference. It's a small thing but making this possible