More operators inside `is(...)` expressions

Mathias LANG geod24 at gmail.com
Sun Aug 23 23:19:57 UTC 2020


On Sunday, 23 August 2020 at 22:18:48 UTC, Per Nordlöw wrote:
> On Sunday, 23 August 2020 at 22:11:41 UTC, Steven Schveighoffer 
> wrote:
>> static if (is(int != T))
>> {
>>    // use T
>> }
>
> Furthermore, what's wrong with allowing
>
> [...]

If I may interject, that's the wrong way to think about it. You 
should stop asking "Why not?" and ask "Why?" instead.
Why should we allow this syntax ? What's the benefit over the 
current syntax ?

Having two syntaxes for the same thing will lead to:
- Two sides arguing over which one should be preferred (e.g. when 
writing examples);
- Rules being implemented in linter(s), e.g. DScanner;
- A special mention in any style guide(s);
- Subtle differences between the two syntax creeping in;

We actually have a good example for this: alias declarations.
I'm actually a big fan of [this 
quote](https://www.goodreads.com/quotes/19905-perfection-is-achieved-not-when-there-is-nothing-more-to) when it comes to design.


More information about the Digitalmars-d mailing list