Guards redux

Guy Steele guy.steele at oracle.com
Thu Mar 11 02:17:40 UTC 2021


> On Mar 10, 2021, at 5:19 PM, John Rose <john.r.rose at oracle.com> wrote:
> 
>  On Mar 10, 2021, at 11:29 AM, Guy Steele <guy.steele at oracle.com> wrote:
>> 
>> Let me suggest this alternative:
>> 
>> Pattern:
>> : ConditionalOrPattern
>> : ConditionalAndPattern `&&` Guard
> 
> Clever.  Too bad we can’t do this for expressions too.
> 
>>> Guard:
>>> : AssignmentExpression
>> 
>> Yes, “AssignmentExpression” is the right thing here.

Duh. 

> Please see my previous objection:  I think the looseness
> of AssignmentExpression leads to even worse puzzlers
> than the ones you are addressing above.
> 
Actually, we had essentially the same idea for improving the grammar, but each of us spotted just one of the two problems. (Are there more?)  You put it best: we should avoid uselessly enabling more puzzlers. 



More information about the amber-spec-observers mailing list