<div dir="auto"><div>Hello Holo,</div><div dir="auto"><br></div><div dir="auto">Thank you for your response!</div><div dir="auto"><br></div><div dir="auto">> JEP 433, 427, 420, 406 all have a word</div><div dir="auto">> about parenthesized patterns. Maybe an</div><div dir="auto">> example like in your [2] would have been</div><div dir="auto">> more clear, but the existence and</div><div dir="auto">> grammar of parenthesized patterns</div><div dir="auto">> existent from the first preview.</div><div dir="auto"><br></div><div dir="auto">Looking back at them, you are definitely right. They all do mention it like you said. But reading each JEP's section on it, I think I see where I was coming from when I originally made my point.</div><div dir="auto"><br></div><div dir="auto">I saw that you can put parentheses around the pattern, but they pretty much just said "improves readability". The links I mentioned said that, then showed you what the parentheses were protecting you from. Specifically, parentheses allow you to use lambdas and switch patterns together without messing up the order of operations. And like you said, the code example makes it entirely unambiguous.</div><div dir="auto"><br></div><div dir="auto">Could we add a code example for this JEP? If not that, then maybe just link to the equivalent of what I linked, but for the respective version of Java?</div><div dir="auto"><br></div><div dir="auto">Thank you for your help!</div><div dir="auto">David Alayachew<br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Sat, Mar 18, 2023, 6:33 AM Holo The Sage Wolf <<a href="mailto:holo3146@gmail.com">holo3146@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">JEP 433, 427, 420, 406 all have a word about
parenthesized patterns. Maybe an example like in your [2] would have been more clear, but the existence and grammar of
parenthesized patterns existent from the first preview</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 18, 2023 at 5:59 AM David Alayachew <<a href="mailto:davidalayachew@gmail.com" target="_blank" rel="noreferrer">davidalayachew@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Hello Amber Dev Team,<div dir="auto"><br></div><div dir="auto">I am very excited for this feature. I think the new levels of exhaustiveness that this feature enables will remove a common source of bugs for me when I write code.</div><div dir="auto"><br></div><div dir="auto">Looking at the link, I am very happy to see that switch expressions will now play nicer with enums under a sealed type. This was a pain point for code I was writing a few months ago [1], so having this will streamline my development by a lot.</div><div dir="auto"><br></div><div dir="auto">I also very much like to see that parenthesized patterns are being removed, to be handled later. In general, I like the idea of simply deferring the uncommon edge cases to be dealt with in the future. Curious to see how it will be dealt with in the future.</div><div dir="auto"><br></div><div dir="auto">That said, could we add a short description of what parenthesized patterns are? Perhaps I missed a discussion on it, but I didn't even know that they existed until I saw this JEP back when it was a JEP Draft. And if not a description, maybe a link to some official Oracle documentation? This link [2] is how I figured out what parenthesized patterns are.</div><div dir="auto"><br></div><div dir="auto">Thank you all for your time and effort!</div><div dir="auto">David Alayachew</div><div dir="auto"><br></div><div dir="auto">[1] = <a href="https://mail.openjdk.org/pipermail/amber-dev/2022-October/007528.html" rel="noreferrer noreferrer noreferrer" target="_blank">https://mail.openjdk.org/pipermail/amber-dev/2022-October/007528.html</a></div><div dir="auto"><br></div><div dir="auto">[2] = <a href="https://docs.oracle.com/en/java/javase/19/language/pattern-matching.html#GUID-3EEBECEA-D874-4B20-B46B-07ED6172881D" rel="noreferrer noreferrer" target="_blank">https://docs.oracle.com/en/java/javase/19/language/pattern-matching.html#GUID-3EEBECEA-D874-4B20-B46B-07ED6172881D</a></div><div dir="auto"><br></div></div>
</blockquote></div><br clear="all"><div><br></div><span>-- </span><br><div dir="ltr"><div dir="ltr">Holo The Wise Wolf Of Yoitsu</div></div>
</blockquote></div></div></div>