Several folks have asked that I sketch out a little more of the roadmap for pattern matching, so that we can better evaluate the features being discussed now (since, for example, the semantics of pattern matching are heavily influenced by nested patterns.)

I've checked into two drafts which are VERY ROUGH, but which correspond to the next two logical increments after patterns in switch.

Deconstruction patterns:

https://github.com/openjdk/amber-docs/blob/master/eg-drafts/deconstruction-patterns-records-and-classes.md

This document outlines the semantics of deconstruction patterns and nested patterns, and declaration of deconstructors in classes.

Reconstructors:

https://github.com/openjdk/amber-docs/blob/master/eg-drafts/reconstruction-records-and-classes.md

This one addresses the challenge of "mutating" immutable objects such as records and inline classes, and builds on deconstructors.

(There are some teasers for related features, mostly to put these in context, but I don't want to get distracted on those features until these are nailed down, so take them as merely context.)


Reply via email to