> On Apr 13, 2018, at 4:27 PM, Maciej Izak <hnb.c...@gmail.com> wrote:
> 
> FPC has "Initialize" operator for such purposes :  
> http://wiki.freepascal.org/management_operators
> 

These are great and one of the best features to be added in a while but that’s 
not the same. I mean a default constructor like Create() which the compiler 
automatically generates and takes as parameters the fields of the record. 
Making the same boiler plate constructors for records all the time is not so 
great.

var
  rec: TPoint;
begin
  rec := TPoint(x: 100, y: 100);


I mentioned this some time ago since Pascal already has that syntax for init 
records at compile time. Now that I mention it, you could use the same syntax 
with no arguments to zero the record.

var
  rec: TPoint = ();
begin

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