News for hackers. Stuff that matters.
Re:Microfeatures I'd like to see in more languages by dima_vm on Friday January 06, 2023 @06:34PM (#34282926)
You can make that in Kotlin, e.g.: `3.mph` or `(-45..45).deg` for ranges.

with definition like:

    val Double.mph: Speed
      get() = Speed.mph(this)

    data class Speed(val ms: Double)
      companion object {
        fun mph(mph: Double) = Speed(mph * 1609.344 / 3600.0)
      }

There are no comments on this comment yet.