Discussion Thread: DIP 1044--Enum Type Inference--Community Review Round 1

cc cc at nevernet.com
Sun Nov 27 03:28:06 UTC 2022


On Saturday, 26 November 2022 at 11:14:05 UTC, XavierAP wrote:
> But... Why then not not go one step further, and leave it up to 
> each one's private code to
>
>     alias _ = EType;
>
> when desired, and leave the language and backwards 
> compatibility alone?

Then you just have more escalating noise around every location 
where such aliases are needed.  Having to copy/paste:
```d
alias A = AttackType;
alias W = WeaponType;
alias M = MovementType;
```
is unideal.  And the broader the scope they're declared in the 
more likely they are to conflict with other shortened alias names.

And then when you have, say `enum EntityState` and `enum 
EnemySprite`, what then?  `alias ETS`, `alias ESPR`... just 
further increasing symbolic clutter and cognitive load.


More information about the Digitalmars-d mailing list