ExpressiveJava: Rewriting simple Scala interpreter – JDK17 code nearly identical
github.com
github.com
With JDK17 and the introduction of Record types, sealed classes/interfaces, and pattern-matching the implementation can come close to ver-batim mirroring the Scala 2 one:
https://github.com/Randgalt/expressive-java/blob/master/java...
> NOTE: Pattern-matching for switch is in second preview for JDK17, so not all features used are stable
Unfortunately, the Scala org website is down right now, so the original/target code can be viewed here for the moment:https://web.archive.org/web/20200103022853/https://www.scala...
The final feature that is needed to really seal the deal, is part of JEP 405 for destructuring + binding to values in patterns ("Deconstruction patterns"):