> On Nov 11, 2018, at 6:51 AM, Ben Grasset <operato...@gmail.com> wrote:
> 
> Personally I think the answer here is keep working on your new/alternate 
> implementation of default field functionality! It's a missing puzzle piece 
> for FPC generics in many ways.
> 

Not sure how default fields in generics help here. I just thought it would be 
nice if FPC supported this so we can init records at compile time easier. I’d 
prefer default struct fields like C++ has but typed const defaults would be an 
improvement.

I looked at the sources and in ttypedconstbuilder.read_typed_const_data (I 
think) it simply doesn’t support default record values with typed consts, only 
the = (a:x;b:x) style syntax. The typed const in the class was clearly defined 
as a hidden static var but I couldn’t figure out how to assign the values. 
Maybe I’ll look into it later.

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