[fpc-pascal] Auto vars (again)

Ryan Joseph ryan at thealchemistguild.com
Sat Aug 18 20:33:54 CEST 2018



> On Aug 17, 2018, at 7:50 PM, Maciej Izak <hnb.code at gmail.com> wrote:
> 
>     class operator Initialize(var a: TAutoCreate<T>);
>     class operator Finalize(var a: TAutoCreate<T>);
> 

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 aren’t simply constructor/destructor since those names are available in records already (constructor with no parameter that is).

I say this because the syntax is long and hard to remember and don’t follow the usual convention of constructors/destructors. Initialize and Finalize are the most common operators you implement so it makes sense they would follow the normal syntax rules (c++ does this for classes declared on the stack).

Was there any consideration to making the default constructor and destructor be used instead of class operators?

Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list