Wanted: best way to express default expectations

Dukc ajieskola at gmail.com
Wed Oct 16 10:42:01 UTC 2019


On Monday, 14 October 2019 at 13:26:56 UTC, Dennis wrote:
>
> I think a new keyword for this has very little chance.
> One related idea is making `if !(expression) statement` allowed 
> in the grammar (! outside parentheses) which makes it easier to 
> read fully negated if-statements.

Would also do the trick imo, and also avoid a new keyword. Good 
idea.

> It hasn't been that well received though:
>
> https://github.com/dlang/dmd/pull/8440
> https://forum.dlang.org/post/pgkv3t$15te$1@digitalmars.com

Thanks for those links - I didn't know that `if !(condition)` is 
allowed in C#. That's useful.


More information about the Digitalmars-d mailing list