4 ms·
Yeah I really want to move to a language with pattern matching. Hopefully it will finally land in Java
by linkmotif 8y ago
Yeah I really want to move to a language with pattern matching. Hopefully it will finally land in Java
- vbezhenar 8y agoKotlin does not support pattern matching.
- sk5t 8y agoYeah, Kotlin has some "enhanced switch" type stuff, but nothing that compares to Scala's matching with unapply, list extraction, etc.
- linkmotif 8y agoOh! Thought it did. Forget Kotlin, then :)!!
- sk5t 8y agoKotlin is still a pleasant language to use, and some of the ideas have some good carryover to Scala, with quite a lot less culture shock than going right from Java to Scala.
- nostrademons 8y agoIt has destructuring in value binding and lambda parameters, as well. Pretty handy when you're dealing with a lot of pairs, triples, and data classes, though not quite as powerful as true pattern-matching.
- vbezhenar 8y agoActually they have some foundations, componentN functions serve similar role to unapply, so theoretically it should be possible to build good enough pattern matching. But, unfortunately, they seem to slow down language development a lot since release.
- dionian 8y agoscala, eta
- Floegipoky 8y agohttps://docs.scala-lang.org/tour/pattern-matching.html https://docs.scala-lang.org/tour/pattern-matching.html