Project Elvis
Nick Treleaven
nick at geany.org
Mon Nov 13 14:44:55 UTC 2017
On Monday, 6 November 2017 at 13:02:43 UTC, Ola Fosheim Grøstad
wrote:
> On Monday, 6 November 2017 at 10:12:11 UTC, Jonathan M Davis
> wrote:
>> All it does is take the expression
>>
>> x ? x : y
>>
>> and make it
>>
>> x ?: y
>
> Yes, that is an issue because it means that typos no longer are
> caught. E.g. if you accidentally comment out or delete the
> second expression.
The commenting out case can be prevented by making ?: an actual
operator, so ?/**/: would be an error. (Also I think it's
regressive to argue invalid code becoming valid is a good reason
to prevent introducing a feature).
>
> Which is why I think ?? or some other choice would offer better
> usability.
I think ??= reads better than ?:=, which looks like Pascal
assignment.
More information about the Digitalmars-d
mailing list