DIPX: Enum Literals / Implicit Selector Expression

Mike Parker aldacron at gmail.com
Thu Jun 30 12:13:53 UTC 2022


On Thursday, 30 June 2022 at 12:02:15 UTC, ryuukk_ wrote:
> On Thursday, 30 June 2022 at 11:53:16 UTC, Mike Parker wrote:
>
> This is not as clean as just this:
>
>     MyFlags flags = .A | .B | .C | .D | .E | .F;
>
>
> I feel it's much easier to read, there is no noise
>

I don't. Hijacking existing syntax without change so that it 
means something else in a different context isn't clean at all.

And opinion is what it comes down to. I'm sure we can each find 
several people who'd agree with our opposing views on this. Any 
DIP is going to have to have a stronger justification than that.

Considering how `with` currently doesn't work for this case is a 
good starting point for finding a justification. (Then again, 
that's what led me to thinking it's better to enhance `with` 
instead, and I may not be the only one who goes there, so that's 
something else to consider in the DIP).

Anyway, just wanted to throw my thoughts out there. If you do get 
a DIP submitted, good luck!


More information about the Digitalmars-d mailing list