3 ms·
It’s had pattern matching since 16, it’s been expanded since with some syntactic sugar and more recently the introduction of sum types and exhaustiveness to go
by CraigJPerry 2y ago
It’s had pattern matching since 16, it’s been expanded since with some syntactic sugar and more recently the introduction of sum types and exhaustiveness to go along with pattern matching.
- grumpyprole 2y agoI think there should be a second edition of this book then :)
- kelnos 2y agoIMO Java's pattern matching is still fairly primitive. Not even up to the level of usefulness of Scala 2.13.
- CraigJPerry 2y agoInteresting - what specifically is missing? I’m thinking we’ve got all of scala’s pattern matching since JEP 406 (2021) but I don’t write Scala so there’s maybe a feature i don’t know. Would be interested to know. switch (thing) { case Integer i when i > 0 -> println(“Positive…”); case … }