DIPX: Enum Literals / Implicit Selector Expression

The Zealot zod at zod.zod
Thu Jun 30 11:06:31 UTC 2022


https://forum.dlang.org/post/sxqwowayftguwtroluli@forum.dlang.org

On Thursday, 2 December 2021 at 20:23:42 UTC, Dennis wrote:
> I love enums and think they could use some more love in D, but 
> I'm skeptical whether this particular thing can be made to work 
> in D without introducing edge cases and complexity.
>
> On Thursday, 2 December 2021 at 19:44:07 UTC, russhy wrote:
>> That's a feature i long desired, and i'm pretty envious of the 
>> languages that have it implemented, to name a few: Zig/Odin/Jai
>
> Don't know about Odin/Jai, but Zig does not have function 
> overloading / UFCS / template functions, so it doesn't have to 
> deal with D's existing complex baggage. The DIP should figure 
> out what happens in these situations:


Typing out those enums is annoying, but i have to say, i prefer 
it this way. it makes the code so much easier to understand 
later, as you don't have to guess which enum is actually used.

you can always alias the enums into global scope too, if you want 
to have short names.

So i'm more against adding this to the language.


More information about the Digitalmars-d mailing list