[Proposal:] Syntactic sugar for a < x < b and tertiary operators #10102
-
|
To check if a value is between two others you should be abe to write: as syntactic sugar for some tertiarty operator This might require being able to overoad tertiary operators in general. e.g. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
You can use pattern matching to somewhat achieve this: var x = 4;
if (x is >= 3 and < 5)
{
}Personally, I have always found python's "if between two values" syntax confusing. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
#8643