Struct Initialization syntax
rikki cattermole
rikki at cattermole.co.nz
Tue Jul 24 07:29:05 UTC 2018
On 24/07/2018 7:23 PM, Daniel N wrote:
> On Tuesday, 24 July 2018 at 03:59:53 UTC, rikki cattermole wrote:
>> On 24/07/2018 6:43 AM, kinke wrote:
>>> On Monday, 23 July 2018 at 17:32:23 UTC, aliak wrote:
>>>> Can we just consider that named struct init syntax *is* a generated
>>>> named constructor?
>>>>
>>>> If named arguments choose a different syntax then you have no
>>>> conflict. If they go with the same (i.e. option 2) then you have
>>>> seamless consistency.
>>>
>>> +1. And hoping for the latter, seamless consistency.
>>
>> Based upon my DIP that is in the queue for named arguments, it would
>> be trivial for this DIP to make it so a named parameter constructor
>> can override the default behavior and I think that this is the best
>> way forward.
>
> Yes, it makes sense to review the "named arguments" DIP before this one,
> any link?
Mine: https://github.com/dlang/DIPs/pull/126
Yshui's: https://github.com/dlang/DIPs/pull/123
Mine is a lot heavier-weight, and applies to templates parameters as
well as functions. Where as Yshui's is very lightweight compared and
only applies to functions.
Yshui's will occur first I think, but really we should review them
together to decide what sort of approach is best.
More information about the Digitalmars-d
mailing list