groostav
09/22/2023, 1:59 AMcompareTo
function again, and im reminded of how much i hate it.
Any chance kotlin could do some inline class magic to make this disappear? Make a Comparable
interface that returns an value class ComparsionResult(val value: Int)
with some nice factory methods fun leftIsFirst: ComparisonResult = ComparisonResult(-1)
?
I cant help but think this is a jvm pimple that kotlin can really elegantly sugar.ephemient
09/22/2023, 2:22 AMif (comparison == leftIsFirst)
which IMO is an API flaw that is almost as bad as the original