DIPX: Enum Literals / Implicit Selector Expression
Steven Schveighoffer
schveiguy at gmail.com
Tue Jul 5 15:06:01 UTC 2022
On 7/5/22 2:34 AM, bauss wrote:
> On Tuesday, 5 July 2022 at 01:15:28 UTC, Steven Schveighoffer wrote:
>>
>> The literal syntax distinguishes it from everything else. My strawman
>> was `#value`, but really, any not-already-used syntax will do.
>> `.value` is not available, neither is `value`.
>>
>> -Steve
>
> Perhaps : could work as `:value` isn't currently a reserved syntax
> today, unless something comes before, so it should definitely work in
> this case.
>
> It also looks less clunky than #.
I thought that too. But there is existing syntax that might interfere:
`cond ? value1 :value2`.
I don't know enough to be sure, so I just picked one that isn't used.
-Steve
More information about the Digitalmars-d
mailing list