Can now use alias for collapsing multiple fields in nested structs

Nick Treleaven nick at geany.org
Mon Jan 6 12:12:30 UTC 2025


On Sunday, 5 January 2025 at 07:48:38 UTC, ryuukk_ wrote:
>> Why do you need an anonymous struct type there? Naming it and 
>> using the struct name for `inner` isn't difficult, and it 
>> doesn't seem needed that often.
>
> It's same story with tagged union, tuples, .enum, if you don't 
> see them as improvements, there is nothing to argue about, try 
> to use a language that supports them all, and you'll realize 
> that it's like stepping up and upgrading your toolbox

You were asking for anonymous structs, yet tuple syntax is 
already planned ([and std Tuple is usable 
today](https://forum.dlang.org/post/lgzmgfforaaxogcyoxdl@forum.dlang.org)). It's not good design to have both in the language. If a tuple is too concise for a use-case (e.g. you want to ddoc the fields), then use a named struct.

Too much language complexity has costs in tooling, learning, 
error messages, etc.


More information about the Digitalmars-d mailing list