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.go...@oracle.com>
> À: "amber-spec-experts" <amber-spec-experts@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.

Reply via email to