This syntax regarding null checking baffles me

Max Haughton maxhaton at gmail.com
Thu Jan 7 15:55:52 UTC 2021


On Thursday, 7 January 2021 at 15:37:44 UTC, Dukc wrote:
> On Thursday, 7 January 2021 at 04:57:55 UTC, 12345swordy wrote:
>> if (c !is null) Why?????
>>
>> Would it be simpler to type
>>
>> if (c is not null)
>
> Saves 3 character per use, I guess. And keeps one operator in 
> one keyword. Matter of taste, and whoever designed this 
> obviously had to pick something.

I don't think not is reserved anywhere else so it would mean 
adding a new terminal to the grammar too, and d already has a lot.


More information about the Digitalmars-d mailing list