<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
Well, there has not been a lot of traffic during the last week and a half on these topics (“syntax”), so I will jump in and offer my two cents’ worth.<br id="lineBreakAtBeginningOfMessage">
<div><br>
<blockquote type="cite">
<div>On Apr 4, 2024, at 1:11 PM, Brian Goetz <brian.goetz@oracle.com> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div><font size="4" face="monospace">There's obviously some more discussion coming about "what is a pattern", but let me summarize the points on which we've asked for syntax feedback, and make another call (I can't believe I have to ask) for opinions here. 
<br>
<br>
<br>
Use-site syntax.  The document catalogs the use-site syntax for deconstruction, static, and bound/unbound instance pattern uses.  I don't think any of these are controversial.  (There are details to be captured, such as qualifier inference, but I think the
 overall scheme here is sound.)<br>
</font></div>
</div>
</blockquote>
<div><br>
</div>
I do, too.</div>
<div><br>
<blockquote type="cite">
<div>
<div><font size="4" face="monospace">Identifying a member as a pattern.  The proposed approach is a "pattern" keyword for all pattern kinds, but there are other choices. 
<br>
</font></div>
</div>
</blockquote>
<div><br>
</div>
I like using `pattern` as a (necessarily contextual) keyword.</div>
<div><br>
<blockquote type="cite">
<div>
<div><font size="4" face="monospace">Method-style (multiple return) vs inverse-style.  I thought the document made it entirely clear that the method-style declaration was going to be a loser, but I guess we had more work to do there.</font></div>
</div>
</blockquote>
<div><br>
</div>
Inverse style is good.</div>
<div><br>
<blockquote type="cite">
<div>
<div><font size="4" face="monospace">Position of match candidate.  Here, there is a reasonable menu of choices:<br>
<br>
</font><font size="4" face="monospace">    static<T> pattern Optional<T> of(T t)<br>
</font><font size="4" face="monospace">    static<T> pattern<Optional<T>> of(T t)<br>
</font><font size="4" face="monospace">    static<T> pattern(Optional<T> that) of(T t)<br>
</font><font size="4" face="monospace">    static<T> pattern of(T t) for </font><font size="4" face="monospace">Optional<T>
<br>
</font></div>
</div>
</blockquote>
<div><br>
</div>
I don’t feel strongly about this choice.</div>
<div><br>
</div>
<div>
<blockquote type="cite">
<div>
<div><font size="4" face="monospace">Naming of match candidate.  The document proposes to use `that` uniformly. </font></div>
</div>
</blockquote>
<div><br>
</div>
I think using `that` uniformly is a good choice.</div>
<div><br>
<blockquote type="cite">
<div>
<div><font size="4" face="monospace">Body types.  There is the broad choice of "imperative vs functional"; within that, there are choices about "implicit failure" or "implicit success."  There is also how we indicate success and failure.  The suggested approach
 is functional, implicit failure, return means fail, success is indicated by `match patternName(BINDINGS)`.<br>
</font></div>
</div>
</blockquote>
<div><br>
</div>
I am all for this.</div>
<div><br>
</div>
<div>If we choose to provide the “special convenience feature” to support the imperative style, I would suggest that it be simply `match;` and not `match patternName;` because its reason for existence is to abbreviate.<br>
<blockquote type="cite">
<div>
<div><font size="4" face="monospace"><br>
Exhaustiveness.  The document proposes `case` as a modifier for patterns that form exhaustive sets.  This isn't great, but note that this feature is likely to be used less often than we probably think, as new code will likely steer towards sealed classes and
 deconstruction patterns. </font><br>
</div>
</div>
</blockquote>
<br>
</div>
<div>Agreed, not great, but I think we could live with it.</div>
<br>
</body>
</html>