[fpc-pascal] compile time init'ing records

Maciej Izak hnb.code at gmail.com
Fri Apr 13 12:31:41 CEST 2018


2018-04-13 11:54 GMT+02:00 Ryan Joseph <ryan at thealchemistguild.com>:

> 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);
>

Yes you are right. IIRC someone from core team has similar vision (Sven?),
IMO good direction :). Something like this is also on my TODO list (but not
with high priority).

-- 
Best regards,
Maciej Izak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20180413/f1898a5b/attachment.html>


More information about the fpc-pascal mailing list