Is there is specific reason that `<` etc are no...
# getting-started
f
Is there is specific reason that
<
etc are not supported in
when
(I mean in the same way as
in
and
is
)
l
You can use ranges
👍 1
eg:
when(position) { in 0..3 -> {} }
m
I don’t know in details, probably they’re not supported because of how Kotlin grammar is defined: https://kotlinlang.org/docs/reference/grammar.html#whenCondition In the end you can always use them more verbosely:
Copy code
val i = 42
when {
    i < 10 -> println("low")
    i >= 10 -> println("hi")
}