DenialAdams / roland

Roland programming language
https://www.brick.codes/roland
Apache License 2.0
48 stars 0 forks source link

Default values for struct fields #12

Open DenialAdams opened 2 years ago

DenialAdams commented 1 year ago

Fixed in 0f9f2011f2f795d0bdac864c9217f0a0ad05a22a

DenialAdams commented 8 months ago

I yoinked this feature out in ce343e4d4ab061f211c09a19ef8e918db645221d

The implementation had a bug (#128) as well as a new bug caused by our reworking of aggregates for the backends. Both bugs could have been fixed, but I want to focus on other things for now.

When I come back to this, I'd like to examine the design. Should users opt-in to default fields? Or should there be an opt-out? I like the principle of minimizing action at a distance.

The other thing to think about is ABI compatibility, where adding a struct field default is fine API-wise but does require recompiling. I think that's fine though, based on what Roland is atm?