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

IGotD- nise at nise.com
Fri Nov 18 19:14:14 UTC 2022


On Friday, 18 November 2022 at 17:54:42 UTC, monkyyy wrote:
>> using $
> If I define opDollar to return an enum; and you define an 
> opIndex to take enums; does it all work?

The $myEnum syntax is really hideous compared to the .myEnum. The 
.myEnum syntax feels natural where $myEnum looks like it is some 
kind macro parameter or something. There is a reason that all 
other example languages like Swift use the . syntax.

Is it possible to use the . syntax but there is a search 
hierarchy? If there is a global with the same enum name, you must 
give the full enum name. There might creep in serious bugs, 
however often you will have some kind of type mismatch.

The $ syntax is so ugly that I don't want this DIP in its current 
form.


More information about the Digitalmars-d mailing list