Re: [fpc-pascal] Auto vars (again)

2018-08-19 Thread Jonas Maebe
On 18/08/18 23:18, Maciej Izak wrote: on SCOPEDINTERFACEDESTROY)... FPC core team said that this behavior of Delphi is not documented and not COM compatible (or is undefined in COM - I don't remember). Also there is some mystery example for large methods when Delphi is able to break the rule an

Re: [fpc-pascal] Auto vars (again)

2018-08-19 Thread Maciej Izak
2018-08-18 20:26 GMT+02:00 Marcos Douglas B. Santos : > On Sat, Aug 18, 2018 at 2:04 PM, Ryan Joseph > wrote: > > > > How does TAutoFree in mORMot work? Never heard of this. > > See http://blog.synopse.info/post/2014/11/14/Automatic- > TSQLRecord-memory-handling worth to note that in FPC you ad

Re: [fpc-pascal] Auto vars (again)

2018-08-18 Thread Ryan Joseph
> On Aug 18, 2018, at 11:04 AM, Ryan Joseph wrote: > >> The solution which probably should be accepted by fpc team is default >> property without indexer: >> >> === code begin === >> property obj: T read fobj; default; >> === code end === >> >> with this property should be possible: >> >> =

Re: [fpc-pascal] Auto vars (again)

2018-08-18 Thread Ryan Joseph
> On Aug 17, 2018, at 7:50 PM, Maciej Izak wrote: > > class operator Initialize(var a: TAutoCreate); > class operator Finalize(var a: TAutoCreate); > One other thing I wanted to ask you. I know it’s minor but for me it’s pretty disappointing that the Initialize and Finalize operators

Re: [fpc-pascal] Auto vars (again)

2018-08-18 Thread Marcos Douglas B. Santos
On Sat, Aug 18, 2018 at 2:04 PM, Ryan Joseph wrote: > > How does TAutoFree in mORMot work? Never heard of this. See http://blog.synopse.info/post/2014/11/14/Automatic-TSQLRecord-memory-handling regards, Marcos Douglas ___ fpc-pascal maillist - fpc-p

Re: [fpc-pascal] Auto vars (again)

2018-08-18 Thread Ryan Joseph
> On Aug 17, 2018, at 7:50 PM, Maciej Izak wrote: > > 2018-08-18 1:24 GMT+02:00 Ryan Joseph : > but is there any merit to this idea if it was cleaned up and made safe? I did > some tests to see if you could prevent passing auto vars out of scope and > it’s possible to prevent most ways but no

Re: [fpc-pascal] Auto vars (again)

2018-08-18 Thread Maciej Izak
2018-08-18 1:24 GMT+02:00 Ryan Joseph : > but is there any merit to this idea if it was cleaned up and made safe? I > did some tests to see if you could prevent passing auto vars out of scope > and it’s possible to prevent most ways but not 100%. > You are trying to achieve something what is almo

[fpc-pascal] Auto vars (again)

2018-08-17 Thread Ryan Joseph
I had some free time recently so I decided as a learning experience to fork the compiler and implement the “auto var” idea that was mentioned a few weeks ago. What I found is that it’s a pretty lightweight (in terms of impact on the compiler) and unintrusive way to manage memory on a per-scope b