Why is this not allowed?

germandiago germandiago at gmail.com
Tue Oct 8 18:24:50 UTC 2024


On Saturday, 5 October 2024 at 06:35:57 UTC, ryuukk_ wrote:
>
> Why is this allowed
> ```D
>
> struct EntityDef
> {
>     struct
>     {
>         int hp;
>     }
> }
> ```
>
>
> But not this fucking thing?
>
> ```D
> struct EntityDef
> {
>     struct
>     {
>         int hp;
>     } stats;
> }
> ```
>
>
> Let me name my shit
>
>
> No, i don't want to do:
>
>
> ```D
> struct EntityDef
> {
>     struct Stats
>     {
>         int hp;
>     } Stats stats;
> }
> ```
>
> Repeating the same name 3 times, i should go back to the stone 
> age too no?
>
> C and all other C like languages allow me to be concise
>
> Why is it a D thing to be backward?

The problem is clear. What I do not agree with is your tone. I am 
noone here, but I think it is not good to tolerate this level. It 
sets a bad precedent.

Just my 2 cents.


More information about the Digitalmars-d-learn mailing list