So I noticed something with the ranges in Kotlin..
If
..
and
..<
exists, why not`<..` and
<..<
?
Currently if I write
a >= b && a <= c
the IDE will tell me to replace it with
a in b..c
if I write
a >= b && a < c
then IDE will not recommend me with anything, but I can still write
a in b..<c
and this would be correct, though I'm not sure whether it's optimized by the compiler like the first case.
however, if I write
a > b && a < c
there is no way to represent it in ranges if I wanted to! I find this bit of inconsistency to be a little annoying.
Ideally all four operators should be present and optimized by the compiler.
💯 3
p
Pablichjenkov
03/20/2024, 12:37 AM
I really would love it to match the math operators