Re: Call for bikeshed -- break replacement in expression switch

2019-05-16 Thread James Laskey
Yield +1 Sent from my iPhone > On May 16, 2019, at 12:24 PM, Brian Goetz wrote: > > We’ve probably pretty much explored the options at this point; time to > converge around one of the choices... > >> >> De: "Brian Goetz" >> À: "amber-spec-experts" >> Envoyé: Dimanche 12 Mai 2019 21:38:38

Re: Call for bikeshed -- break replacement in expression switch

2019-05-16 Thread Alex Buckley
On 5/16/2019 2:05 PM, Maurizio Cimadamore wrote: There are other contexts in which we limit what can be done w/r/t/ parenthesized expressions (since these are ambiguous with cast to generic types). So this looks like another case where the grammar has to say - sorry no parens here. If you're

Re: Call for bikeshed -- break replacement in expression switch

2019-05-16 Thread Maurizio Cimadamore
On 16/05/2019 21:46, John Rose wrote: On May 16, 2019, at 1:34 PM, Maurizio Cimadamore wrote: On the other hand is a trivial one to resolve, given what we're discussing now is something like "yields" EXPRESSION so, as soon as the compiler sees a "(" it will say: "ok, that's not a new

Re: Call for bikeshed -- break replacement in expression switch

2019-05-16 Thread Maurizio Cimadamore
On 16/05/2019 21:04, Brian Goetz wrote: The notion of “reserved word” is insufficiently precise.  More precisely, yield is a _reserved type identifier_, like `var`.  That means that you cannot have a class called `yield`, but you can have local variables, or methods, or fields, or type

Re: Call for bikeshed -- break replacement in expression switch

2019-05-16 Thread John Rose
On May 16, 2019, at 12:36 PM, Alex Buckley wrote: > having `yield` as the junior member of that club is quite natural. Putting > the junior and senior members side by side shows both similarity and > difference: If junior yield is allowed to help senior return with his job, we have a more

Re: Call for bikeshed -- break replacement in expression switch

2019-05-16 Thread Brian Goetz
The notion of “reserved word” is insufficiently precise. More precisely, yield is a _reserved type identifier_, like `var`. That means that you cannot have a class called `yield`, but you can have local variables, or methods, or fields, or type variables, with that name. See

Re: Call for bikeshed -- break replacement in expression switch

2019-05-16 Thread John Rose
FTR I'm OK with "yield". (I yield the floor?) (And I'm OK with "pass", but we'll probably pass on that option?) The rule, I take it, is that `yield x;` would deliver a value to the innermost enclosing `->` operator. If it could be that simple, that would be a win; we could teach our eyes and

Re: Call for bikeshed -- break replacement in expression switch

2019-05-16 Thread Guy Steele
> On May 16, 2019, at 3:36 PM, Alex Buckley wrote: > > On 5/16/2019 8:24 AM, Brian Goetz wrote: >> We’ve probably pretty much explored the options at this point; time to >> converge around one of the choices... > > I am very happy with `yield` as the new construct for concluding the >

Re: Call for bikeshed -- break replacement in expression switch

2019-05-16 Thread Alex Buckley
On 5/16/2019 8:24 AM, Brian Goetz wrote: We’ve probably pretty much explored the options at this point; time to converge around one of the choices... I am very happy with `yield` as the new construct for concluding the evaluation of a switch expression and leaving a value on the stack for

Re: Call for bikeshed -- break replacement in expression switch

2019-05-16 Thread Brian Goetz
We’ve probably pretty much explored the options at this point; time to converge around one of the choices... > > De: "Brian Goetz" > À: "amber-spec-experts" > Envoyé: Dimanche 12 Mai 2019 21:38:38 > Objet: Call for bikeshed -- break replacement in expression switch > As mentioned in the