Do we want to chain comparison operators? #8771
-
// do we want this:
var foo = a > b > c;
var bar = a < b < c;
// to be shorthand for this:
var foo = a > b && b > c;
var bar = a < b && b < c; I don't see much use for this in general application as I've only ever desired it when participating in code-golf challenges or other friendly competitions like Advent of Code. As a result, I don't predict there will be much support for this, and IIRC our stance is to not add support for every esoteric use-case we can find for things. However, I wanted to bring it up as it's my third time asking myself if it could be useful to others working math heavy environments. 🤷♀️ |
Beta Was this translation helpful? Give feedback.
Answered by
ufcpp
Dec 5, 2024
Replies: 1 comment
Answer selected by
333fred
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#8643