> On Mar 9, 2018, at 11:19 PM, Sven Barth via fpc-pascal 
> <fpc-pascal@lists.freepascal.org> wrote:
> 
> Because this way the user is aware that they are something special and are 
> not supposed to be called manually. 
> 

That makes sense.

Why can’t the compiler use a similar method to call a function when a stack 
based construct like a record or object goes in/out of scope? We have the 
management operators now (which are more complicated) and reference counted 
interfaces (I never used those before they sound like the current standard for 
“ARC” in FPC but nothing which is a low-level compiler feature.

After doing some C++ work this week it appears they simply call the 
constructor/destructor for stack based structs/classes when they go in/out of 
scope and on class member variables when their parent class goes in/out of 
scope. It’s very simple but cleans up so many scenarios that exist in FPC so 
I’m curious why we never got this feature.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to