New pattern matching doc
Remi Forax
forax at univ-mlv.fr
Fri Jan 8 08:50:26 UTC 2021
Let's restart,
what i don't like in the current form of this document is that the is no clean separation between two things,
the pattern and the member method some patterns (not all of them) are required to be implemented to support the pattern.
By example, case Optional.of() is called the static pattern in the document, but the corresponding member is not static at al, it has to have access to the values of the instance.
So the whole section "Patterns as class member" is very hard to understand for me because of this confusion.
I've proposed to call the patterns "patterns" and the corresponding class member "case methods" for that reason, you may prefer other names, but i think that making this separation is important.
Rémi
> De: "Brian Goetz" <brian.goetz at oracle.com>
> À: "amber-spec-experts" <amber-spec-experts at openjdk.java.net>
> Envoyé: Mercredi 6 Janvier 2021 21:52:19
> Objet: New pattern matching doc
> I have pushed
> [
> https://github.com/openjdk/amber-docs/blob/master/site/design-notes/pattern-match-object-model.md
> |
> https://github.com/openjdk/amber-docs/blob/master/site/design-notes/pattern-match-object-model.md
> ]
> to the amber-docs repo, which outlines the direction for how patterns fit into
> the object model.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20210108/61718748/attachment.htm>
More information about the amber-spec-experts
mailing list