Re: [fpc-devel] Defer keyword

2021-05-07 Thread Michael Van Canneyt via fpc-devel
On Fri, 7 May 2021, Sven Barth via fpc-devel wrote: In my opinion the better solution is to continue the road that Maciej started and to implement that "default field" concept together with operator hoistening so that records with management operators can be used as containers. This is

Re: [fpc-devel] Defer keyword

2021-05-07 Thread Sven Barth via fpc-devel
Michael Van Canneyt via fpc-devel schrieb am Fr., 7. Mai 2021, 08:14: > > > On Fri, 7 May 2021, Sven Barth via fpc-devel wrote: > > > > > In my opinion the better solution is to continue the road that Maciej > > started and to implement that "default field" concept together with > > operator

Re: [fpc-devel] Defer keyword

2021-05-07 Thread Michael Van Canneyt via fpc-devel
On Fri, 7 May 2021, Sven Barth via fpc-devel wrote: I thought it was agreed at the time that this was the most viable way forward ? As far as I remember there wasn't really any agreement. Can be, I was not sure... I remember this path was investigated. IIRC there was also the proposal

Re: [fpc-devel] Defer keyword

2021-05-07 Thread Ryan Joseph via fpc-devel
> On May 7, 2021, at 3:08 AM, Michael Van Canneyt via fpc-devel > wrote: > > The introduction of generics and their abundant use in Delphi has noticably > slowed down the compiler and increased binary sizes. To my dismay, compile > times of 20 seconds up to 2 minutes have become not

[fpc-devel] default property (was Defer keyword)

2021-05-07 Thread Ryan Joseph via fpc-devel
> On May 6, 2021, at 11:40 PM, Sven Barth wrote: > > In my opinion the better solution is to continue the road that Maciej started > and to implement that "default field" concept together with operator > hoistening so that records with management operators can be used as > containers. This

Re: [fpc-devel] Defer keyword

2021-05-07 Thread Ryan Joseph via fpc-devel
> On May 7, 2021, at 9:40 AM, Benito van der Zander via fpc-devel > wrote: > > the classic Delphi way was to use an interface for freeing. It only requires > one type and nothing blows up. > That's clever but even try..finally is less overhead. Regards, Ryan Joseph

Re: [fpc-devel] Defer keyword

2021-05-07 Thread Ryan Joseph via fpc-devel
> On May 7, 2021, at 2:46 AM, Sven Barth via fpc-devel > wrote: > > I cannot speak for others, but I think 90% of potential use cases for ref > counting > would be covered like this in my code: objects that only live inside a > procedure. > > I think the same. There's also a function

Re: [fpc-devel] Defer keyword

2021-05-07 Thread Benito van der Zander via fpc-devel
Hi, Don't forget that the record/management operator approach will again blow up binary size; for every variable declared like this you risk creating a new type. the classic Delphi way was to use an interface for freeing. It only requires one type and nothing blows up. type   TDefer =

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

2021-05-07 Thread Sven Barth via fpc-devel
Ryan Joseph via fpc-devel schrieb am Fr., 7. Mai 2021, 05:58: > > > > On May 6, 2021, at 7:14 PM, Ryan Joseph wrote: > > > > This can be detected at compile and at least give a warning. "a" is a > member of TR and the element type of "a" is TR, then we're assigning TR to > said array. It's that

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

2021-05-07 Thread Ryan Joseph via fpc-devel
> On May 7, 2021, at 2:52 PM, Sven Barth wrote: > > As said the main problem of reference counting on object instances, > especially if enabled by default like the Delphi NextGen compiler did, will > lead to problems in *existing* code and thus is a no-go. > What did you think about me

Re: [fpc-devel] Defer keyword

2021-05-07 Thread Ryan Joseph via fpc-devel
> On May 6, 2021, at 11:40 PM, Sven Barth wrote: > > There is no "finalization" section. It's really just an implicit try ... > finally block that the compiler inserts. Look for "cs_implicit_exceptions" > and "pi_needs_implicit_finally" if you want to learn more. Does that mean if you

[fpc-devel] Defer keyword

2021-05-07 Thread Luis Henrique via fpc-devel
07.05.2021, 06:09, "Michael Van Canneyt via fpc-devel" :On Fri, 7 May 2021, Sven Barth via fpc-devel wrote:  I thought it was agreed at the time that this was the most viable way forward ?  As far as I remember there wasn't really any agreement.Can be, I was not sure... I remember this path was