[External] : Re: Two new draft pattern matching JEPs

John Rose john.r.rose at oracle.com
Sat Mar 6 00:11:13 UTC 2021

On Mar 4, 2021, at 8:28 AM, Brian Goetz <brian.goetz at oracle.com> wrote:
> A lot of people (initially, me included) would like to just interpret a boolean expression as a pattern:
>     case Foo(var x, var y) && x > y: ...
> I found that goal compelling, but as patterns get more complicated, this gets unreadable.  A main benefit of the true() patterns (or, the explicit guard() pattern declared above) is that it "quarantines" the expression in an expression wrapper; there's a clear boundary between "pattern world" and "expression world”.

Yes, this is the stubborn root cause we are working around.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20210305/86d53234/attachment.htm>

More information about the amber-spec-experts mailing list