Deprecate `!a == b`

Nick Treleaven nick at geany.org
Tue Aug 13 21:02:28 UTC 2024


On Tuesday, 13 August 2024 at 20:40:32 UTC, IchorDev wrote:
> On Tuesday, 13 August 2024 at 20:30:10 UTC, IchorDev wrote:
>> Do we really need to pander to people who don’t even 
>> understand that logical operators only *return* `bool`?

I think it's actually that they don't know the operator 
precedence, or they just made a mistake.

> A problem I have actually had is not being able to parse the 
> operation order for expressions like `1 + 2 * 3`, but I don’t 
> think we should require parenthesis there either.

Agreed, because that syntax comes from maths rather than a subset 
of programming languages.

> Also, here’s a nice case where I’d actually want to write this: 
> `!myInt == myBool` Again, here the parenthesis would just be 
> visual noise.

The diagnostic doesn't need to fire when both sides are bool.




More information about the dip.ideas mailing list