DIP 1031--Deprecate Brace-Style Struct Initializers--Community Review Round 1 Discussion

Basile B. b2.temp at gmx.com
Thu Feb 13 08:17:01 UTC 2020


On Thursday, 13 February 2020 at 07:29:00 UTC, Mike Parker wrote:
> This is the feedback thread for the first round of Community 
> Review for DIP 1031, "Deprecate Brace-Style Struct 
> Initializers":

I'm in favor of a change. So there were two options

1. StructInitializers could have become StructLiterals, ie. a 
primary expression, i.e usable in all contexts, not only as 
initializer.

2. Kill them. By removing them you can now get rid of the special 
AST node for initializers. After the removal it will be either an 
array literal (so a primary), an AA literal (so a primary) or an 
expression, in other words always an expression. This option is 
also good to simplify the parser because struct literals could 
look like func literals without a full, arbitrarily long lookup.

Nobody wrote a proposal for 1. so let it be 2. End of story from 
my point of view.




More information about the Digitalmars-d mailing list