News for hackers. Stuff that matters.
Re:Principle of Least Astonishment by benatkin on Monday April 06, 2020 @05:17PM (#22797989)
It's a big ask, to have a binary operator and ternary operator that use the same symbol.
Re:Principle of Least Astonishment by Doxin on Tuesday April 07, 2020 @03:04AM (#22800970)
It's honestly some fairly trivial AST-twiddling to support that feature. the compiler can simply detect cases where the left-hand-side of a comparison is /also/ a comparison and change the AST to make it two comparisons combined with an AND statement.

That said I find comparison chaining rather confusing and unexpected so I make a point of avoiding its use. Typing it out as two comparisons hardly saves any effort in any case.

Re:Principle of Least Astonishment by benatkin on Tuesday April 07, 2020 @01:26PM (#22805351)
I know, but it isn't a very useful feature, so why bother?