Folks are jealous of other programming languages having this kind of pattern matching abilities :
fun compareNumbers(
a: Int,
b: Int
) = when {
a > b -> "A is greater than B"
b > a -> "B is greater than A"
else -> "A and B are equal"
}
But, so do we :
const compareNumbers
That’s a condition, so it can fit in a ternary.