On reflection, I think this is just something we have to trust users to
do responsibly; use parentheses, newlines, and indentation to make their
code clear.
On 3/5/2021 7:11 PM, John Rose wrote:
On Mar 4, 2021, at 8:28 AM, Brian Goetz <brian.go...@oracle.com
<mailto:brian.go...@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.