Re: Patterns and nulls

2018-03-15 Thread Guy Steele
> On Mar 15, 2018, at 9:59 PM, John Rose wrote: > . . . > (Think of somebody adding Yule or Duodecember to enum Month.) Febtober!

Re: Patterns and nulls

2018-03-15 Thread John Rose
On Mar 15, 2018, at 5:01 PM, Brian Goetz wrote: > > For the exhaustiveness-lovers, they can manually enumerate all the cases > (enums, sealed type members), and have a throwing default which will detect > unexpected targets that would be impossible at compile time. (At some point, > maybe we'

Re: break seen as a C archaism

2018-03-15 Thread Guy Steele
Well, actually, Brian, I now realize that I had my tongue in only _one_ of my cheeks. Sleep on it and then see what you think. > On Mar 15, 2018, at 6:38 PM, Brian Goetz wrote: > > At this point, the Colonel from Monty Python breaks in, and shuts us down for > being too silly > > On 3/15

Re: Patterns and nulls

2018-03-15 Thread Brian Goetz
After going over this in more detail, I have some simplifications we can apply to this regarding null, default, and exhaustiveness. Key observation: we were subtly taking sides on the accept nulls vs reject nulls divide, and that left us in a hard-to-{explain,defend} place.  Instead we should

Re: break seen as a C archaism

2018-03-15 Thread Brian Goetz
At this point, the Colonel from Monty Python breaks in, and shuts us down for being too silly On 3/15/2018 6:37 PM, Remi Forax wrote: *De: *"John Rose" *À: *"Guy Steele" *Cc: *"amber-spec-experts"

Re: break seen as a C archaism

2018-03-15 Thread Remi Forax
> De: "John Rose" > À: "Guy Steele" > Cc: "amber-spec-experts" > Envoyé: Jeudi 15 Mars 2018 23:06:51 > Objet: Re: break seen as a C archaism > On Mar 15, 2018, at 2:44 PM, Guy Steele < [ mailto:guy.ste...@oracle.com | > guy.ste...@oracle.com ] > wrote: >> break return x; >> Then everybody is

Re: break seen as a C archaism

2018-03-15 Thread John Rose
On Mar 15, 2018, at 2:44 PM, Guy Steele wrote: > > > break return x; > > Then everybody is happy: > (1) Cannot be confused with the old `break` syntax. > (2) Clearly exits a `switch` like `break` does. > (3) Clearly returns a value like `return` does. > (4) Better encourages exclusive use

Re: break seen as a C archaism

2018-03-15 Thread Guy Steele
Okay, Maurizio, you got me thinking. As long as we are convinced that we are actually going to use an explicit value-returning statement within a switch expression quite infrequently in real code, why don’t we get the best of both worlds by spelling it this way: break return x; Then e

Re: break seen as a C archaism

2018-03-15 Thread John Rose
On Mar 15, 2018, at 2:13 PM, Maurizio Cimadamore wrote: > > So, from a language design perspective, 'return x' is wrong - but, as you > point out, we already committed the original sin of having 'return == local > return' for lambdas, so I'm not too convinced that we couldn't use the same > s

Re: break seen as a C archaism

2018-03-15 Thread Maurizio Cimadamore
So, from a language design perspective, 'return x' is wrong - but, as you point out, we already committed the original sin of having 'return == local return' for lambdas, so I'm not too convinced that we couldn't use the same story again here. E.g. when you say 'return', what you really mean is

Re: break seen as a C archaism

2018-03-15 Thread forax
- Mail original - > De: "Guy Steele" > À: "Remi Forax" > Cc: "mark" , "amber-spec-experts" > > Envoyé: Jeudi 15 Mars 2018 20:36:13 > Objet: Re: break seen as a C archaism >> On Mar 15, 2018, at 3:48 PM, Remi Forax wrote: >> >> - Mail original - >>> De: "mark" >>> À: "amber

Re: break seen as a C archaism

2018-03-15 Thread Guy Steele
> On Mar 15, 2018, at 3:48 PM, Remi Forax wrote: > > - Mail original - >> De: "mark" >> À: "amber-spec-experts" >> Envoyé: Jeudi 15 Mars 2018 20:06:40 >> Objet: Re: break seen as a C archaism > >> On 2018-03-15T14:50:45 -0400 >> Brian Goetz wrote: >>> If you are reconsidering o

Re: break seen as a C archaism

2018-03-15 Thread Remi Forax
- Mail original - > De: "mark" > À: "amber-spec-experts" > Envoyé: Jeudi 15 Mars 2018 20:06:40 > Objet: Re: break seen as a C archaism > On 2018-03-15T14:50:45 -0400 > Brian Goetz wrote: >> >> > If you are reconsidering options, reconsider "yield", meaning >> >"break current context

Re: break seen as a C archaism

2018-03-15 Thread Guy Steele
> On Mar 15, 2018, at 3:40 PM, Remi Forax wrote: > > > > - Mail original - >> De: "Guy Steele" >> À: "mark" >> Cc: "amber-spec-experts" >> Envoyé: Jeudi 15 Mars 2018 20:18:34 >> Objet: Re: break seen as a C archaism > >>> On Mar 15, 2018, at 3:06 PM, Mark Raynsford wrote: >>> >>>

Re: break seen as a C archaism

2018-03-15 Thread Remi Forax
- Mail original - > De: "Guy Steele" > À: "Brian Goetz" > Cc: "amber-spec-experts" > Envoyé: Jeudi 15 Mars 2018 20:12:56 > Objet: Re: break seen as a C archaism >> On Mar 15, 2018, at 2:50 PM, Brian Goetz wrote: >> >> We had rejected this earlier for fairly obvious reasons, bu

Re: break seen as a C archaism

2018-03-15 Thread Remi Forax
- Mail original - > De: "Guy Steele" > À: "mark" > Cc: "amber-spec-experts" > Envoyé: Jeudi 15 Mars 2018 20:18:34 > Objet: Re: break seen as a C archaism >> On Mar 15, 2018, at 3:06 PM, Mark Raynsford wrote: >> >> On 2018-03-15T14:50:45 -0400 >> Brian Goetz wrote: >>> If you

Re: break seen as a C archaism

2018-03-15 Thread Guy Steele
> On Mar 15, 2018, at 3:06 PM, Mark Raynsford wrote: > > On 2018-03-15T14:50:45 -0400 > Brian Goetz wrote: >> >>> If you are reconsidering options, reconsider "yield", meaning >>> "break current context with this value". >> >> Still feeling a little burned by first time we floated this, b

Re: break seen as a C archaism

2018-03-15 Thread John Rose
On Mar 15, 2018, at 11:11 AM, Brian Goetz wrote: > We had rejected this earlier for fairly obvious reasons, but let me > ask to get a subjective response: would using "return x" be better? > On the one hand, it's not really a return, and it doesn't build on the > user intuition about the control f

Re: break seen as a C archaism

2018-03-15 Thread Guy Steele
> On Mar 15, 2018, at 2:50 PM, Brian Goetz wrote: > > >>> We had rejected this earlier for fairly obvious reasons, but let me >>> ask to get a subjective response: would using "return x" be better? >> If you are reconsidering options, reconsider "yield", meaning >> "break current context with

Re: break seen as a C archaism

2018-03-15 Thread Mark Raynsford
On 2018-03-15T14:50:45 -0400 Brian Goetz wrote: > > > If you are reconsidering options, reconsider "yield", meaning > >"break current context with this value". > > Still feeling a little burned by first time we floated this, but willing > to try another run up the flagpole Silly idea,

Re: break seen as a C archaism

2018-03-15 Thread Brian Goetz
We had rejected this earlier for fairly obvious reasons, but let me ask to get a subjective response: would using "return x" be better? If you are reconsidering options, reconsider "yield", meaning "break current context with this value". Still feeling a little burned by first time we floa

Re: break seen as a C archaism

2018-03-15 Thread Doug Lea
On 03/15/2018 02:11 PM, Brian Goetz wrote: >> - That we are overloading an existing control construct, "break", >> to mean something just different enough to be uncomfortable; >> >> >> To some degree yes, since `break ` already means >> something. > > We had rejected this earlier for fairly obv

Re: break seen as a C archaism

2018-03-15 Thread Brian Goetz
On 3/14/2018 2:04 PM, Kevin Bourrillion wrote: On Wed, Mar 14, 2018 at 8:14 AM, Brian Goetz > wrote: In the meantime, let me probe for what's really uncomfortable about the current design point.  Is it:  - That we are overloading an existing control