[fpc-pascal] Syntax changes suggestions
Ryan Joseph
ryan at thealchemistguild.com
Tue Jul 17 04:59:15 CEST 2018
> On Jul 16, 2018, at 1:27 PM, Marco van de Voort <marcov at stack.nl> wrote:
>
>> But you don't necessarily know that the function you call does that (think
>> third party code). And people *will* use this and don't think about the
>> consequences. So a system with automatic reference counting is safer and
>> that is what is planned, if at all.
>
> Moreover the use case, dynamically instantiated classes with very local
> scope is rare.
1) if you call a function that has an “auto” variable how does that affect the caller? I don’t see how it could.
2) Huh? I always allocate classes in functions. All the time. I do it so often I want a language feature to do clean up for me. This is also a way to deallocate classes with auto members so you don’t need to override the destructor all the time.
c++ does this using classes on the stack and it’s ubiquitous. In FPC we need to allocate the memory and call free every single time, even in local scope when we know we don’t need the class anymore. It’s such an obvious feature I don’t understand how it gets so much resistance.
Regards,
Ryan Joseph
More information about the fpc-pascal
mailing list