New candidate JEP: 441: Pattern Matching for switch

Holo The Sage Wolf holo3146 at gmail.com
Sat Mar 18 10:33:29 UTC 2023


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

On Sat, Mar 18, 2023 at 5:59 AM David Alayachew <davidalayachew at gmail.com>
wrote:

> Hello Amber Dev Team,
>
> 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.
>
> 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.
>
> 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.
>
> 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.
>
> Thank you all for your time and effort!
> David Alayachew
>
> [1] =
> https://mail.openjdk.org/pipermail/amber-dev/2022-October/007528.html
>
> [2] =
> https://docs.oracle.com/en/java/javase/19/language/pattern-matching.html#GUID-3EEBECEA-D874-4B20-B46B-07ED6172881D
>
>

-- 
Holo The Wise Wolf Of Yoitsu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230318/aea6be4d/attachment.htm>


More information about the amber-dev mailing list