Enum literals, good? bad? what do you think?

Mike Parker aldacron at gmail.com
Tue Jul 20 16:13:04 UTC 2021


On Tuesday, 20 July 2021 at 15:50:49 UTC, russhy wrote:

>
> So what do you think? yay? nay? why not?
>
>

Personally, I have no issue with the current setup. I like 
knowing exactly where the enum values are coming from, and the 
existing tools to cut down on the typing (like with) are 
sufficient.

But if you do want to propose a solution, I don't think `.foo` is 
the way to go. It looks too much like the module scope operator:

https://dlang.org/spec/module.html#module_scope_operators

I have no idea what that would mean for the implementation (and 
you'd need to account for that in the DIP), but visually it would 
be an unnecessary speed bump when mentally parsing the code.


More information about the Digitalmars-d mailing list