DIP1044---"Enum Type Inference"---Formal Assessment

bachmeier no at spam.net
Mon May 1 14:03:51 UTC 2023


On Monday, 1 May 2023 at 00:34:03 UTC, ryuukk_ wrote:

>> I don't think it's a misconception. It's more like a complete 
>> lack of clarity.

> the goal is not to use an anonymous enum, the goal is to 
> leverage the robust type system to avoid repeting yourself, 
> wich is bad
>
> ```
> Value value;
> value.type = ValueType.STRING;
> ```
>
> vs
>
> ```
> Value value;
> value.type = .STRING;
> ```

This is another case of the "complete lack of clarity" I wrote 
about in my earlier comment. With an anonymous enum you could 
write

```
value.type = STRING;
```

Maybe you have something deeper in mind, but that example does 
not make a case for changing the language. Rather than shouting, 
you should put together a better example.

I will let this conversation die. I don't think it's going to 
resolve anything (and I'm not the one that needs convincing 
anyway).


More information about the Digitalmars-d-announce mailing list