3 ms·
cond is neither an operator nor a statement, it's an expression. This is a demonstration of a conditional expression handling multiple conditions, which GP want
by koito17 2y ago
cond is neither an operator nor a statement, it's an expression. This is a demonstration of a conditional expression handling multiple conditions, which GP wanted.
More importantly, pattern matching is not necessary here.
- runevault 2y agoYou misunderstood. They were talking specifically about languages that only have ternary operators as a way to do if-as-expression, and why they prefer languages with either real if-else if-else expressions or full switch/pattern matching as expression.