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

IchorDev zxinsworld at gmail.com
Wed Nov 23 04:43:16 UTC 2022


On Tuesday, 22 November 2022 at 21:47:28 UTC, XavierAP wrote:
> On Friday, 18 November 2022 at 15:37:31 UTC, Mike Parker wrote:
>> ## Discussion Thread
>>
>> This is the discussion thread for the first round of Community 
>> Review of DIP 1044, "Enum Type Inference":
>>
>> https://github.com/dlang/DIPs/blob/e2ca557ab9d3e60305a37da0d5b58299e0a9de0e/DIPs/DIP1044.md
>
> At the very least I would require the "rationale" to say 
> something more than "can be tedious" or at least provide a use 
> case thereof (which cannot have a better solution within the 
> existing language).
>
> I concur about the $, looks terrible. And why is it better to 
> type "$" than "Type."?
>
> Is it because your enum names are too long (in some context)? 
> Just alias them.

Aliasing requires figuring out a good alias name, polluting the 
namespace, and just feels like a hack. It's nice that D lets you, 
but I think a dedicated mechanism to reduce typing fatigue is 
better than obfuscation.

"What's this... `M`?" *searches library* "What? This isn't in 
here!" *searches codebase* "Oh, it's an alias of `Magic`. Who did 
this?"
vs
"`$`? Oh, this function call uses ETI. Let me see its 
declaration..." *checks declaration* "Okay it's `Magic`"


More information about the Digitalmars-d mailing list