I'd love to see half-open ranges in Kotlin just li...
# stdlib
m
I'd love to see half-open ranges in Kotlin just like in Swift! Is there a reason there are none (yet)? Something along these lines: https://github.com/fluidsonic/fluid-stdlib/blob/master/sources/common/HalfOpenRange.kt
1
i
Isn't
until
enough?
m
no, doesn't work in many cases:
"a" until "bc"
LocalTime(11, 0) until LocalTime(12, 0)
etc.
half-open ranges are especially useful for date and time periods
and pagination (start at "a" and stop before "bc", next iteration starts at "bc", etc.)
i
I see.
l
That would allow to replace when without subjects because of comparator operator usage with when with subject using half-open ranges.