I was checking out the try Kotlin website when I saw this example:
Since I knew how much Kotlin has tried to improve Java in terms of readability I was expecting something like this to work:
return start < d <= endInclusive.
Which is obviously much more readable than
return start < d && d <= endInclusive.
As far as I know c, c++ and python also support such syntax in different ways.
I am suggesting perhaps it would be nice to support such syntax in ascending order:
a < b == c <= d
Not sure about descending order:
a > b == c >= d
`a < b == c >= d
Note that == has lower precedence than comparison operators. Descending and mixed ordered syntax are not ambiguous but I’m not sure about their readability so perhaps they can be allowed with a quick fix warning(which changes semantics because of exception possibility…)
And in the rare case someone truly needs to compare Booleans:
(a < b == c) <= d
I’m not sure about the implementation complexities though…