Hacker News new | ask | show | jobs
by high_density 1864 days ago
newb here -- please expand more on this.

Are there stuff that kotlin's pattern-matching can't do?

2 comments

Here's a quote from Reynolds, one of the creators of Spark:

> The primary issue I can think of comes from the lack of pattern matching. Kotlin’s language designer left out pattern matching intentionally because it is a complex feature whose use case is primarily for building compilers. However, modern Spark (post Catalyst / Tungsten) look a lot like compilers and as a result the internals would become more verbose if built using a language that doesn't support pattern matching.

Source: https://www.quora.com/profile/Reynold-Xin

You can find some discussion and good examples here: https://discuss.kotlinlang.org/t/destructuring-in-when/2391/...