https://github.com/dlang/DIPs/pull/22
https://github.com/dlang/DIPs/pull/71
6 year passed, any idea when this will be done ?
Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
May 03, 2022 In-place struct initialization | ||||
---|---|---|---|---|
| ||||
https://github.com/dlang/DIPs/pull/22 6 year passed, any idea when this will be done ? |
May 03, 2022 Re: In-place struct initialization | ||||
---|---|---|---|---|
| ||||
Posted in reply to test123 | On Tuesday, 3 May 2022 at 06:38:34 UTC, test123 wrote: >https://github.com/dlang/DIPs/pull/22 6 year passed, any idea when this will be done ? Wilzbach ask Andrei Alexandrescu to comment at this link: https://github.com/dlang/dmd/pull/8460#issuecomment-438920811 Almost 4 year passed and no comment yet. Maybe Andrei Alexandrescu has response on the form or other place, but he should has the courtesy to add comment to github too. Maybe this is why D unpopular. Newbie come here and find the problem and solution, but D core team don't care to comment or merge it for 5 year. This is sure to scare a lot of people away. |
May 03, 2022 Re: In-place struct initialization | ||||
---|---|---|---|---|
| ||||
Posted in reply to test123 | On Tuesday, 3 May 2022 at 06:38:34 UTC, test123 wrote: >https://github.com/dlang/DIPs/pull/22 6 year passed, any idea when this will be done ? Do I need to know the name of the members in a struct? Isn't it easier to use it unknowingly and directly?
On Tuesday, 3 May 2022 at 06:48:36 UTC, test123 wrote: >[...] I think you have to think well. There may be another reason for this. SDB@79 |
May 03, 2022 Re: In-place struct initialization | ||||
---|---|---|---|---|
| ||||
Posted in reply to Salih Dincer | On Tuesday, 3 May 2022 at 08:28:32 UTC, Salih Dincer wrote: >Do I need to know the name of the members in a struct? Isn't it easier to use it unknowingly and directly?
On Tuesday, 3 May 2022 at 06:48:36 UTC, test123 wrote: >[...] I think you have to think well. There may be another reason for this. SDB@79 consider this code:
With in-place struct initialization you need pass all arguments. Beside this, the work is not worth to merge can not be the reason to ignore the request to comment on github. |
May 03, 2022 Re: In-place struct initialization | ||||
---|---|---|---|---|
| ||||
Posted in reply to test123 | On Tuesday, 3 May 2022 at 09:56:36 UTC, test123 wrote: >consider this code:
With in-place struct initialization you need pass all arguments. This will be covered by DIP 1030, "Named Arguments": https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1030.md The DIP has already been accepted, and work is currently in-progress to implement it in the compiler. Once it is finished, you will be able to write code like the following:
|
May 04, 2022 Re: In-place struct initialization | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paul Backus | On Tuesday, 3 May 2022 at 13:47:54 UTC, Paul Backus wrote: >This will be covered by DIP 1030, "Named Arguments": https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1030.md The DIP has already been accepted, and work is currently in-progress to implement it in the compiler. Once it is finished, you will be able to write code like the following:
This will work for most use case, if you add a verbose this __ctor to struct all struct. If D support In-place struct initialization , then the __ctor is no need for a lot case. |
May 04, 2022 Re: In-place struct initialization | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paul Backus | On Tuesday, 3 May 2022 at 13:47:54 UTC, Paul Backus wrote: >On Tuesday, 3 May 2022 at 09:56:36 UTC, test123 wrote: >consider this code:
Will this use case remain in effect? A lot of its useful! Thanks... |