Re: enhanced enums - back from the dead?

2018-12-07 Thread forax
- Mail original - > De: "Maurizio Cimadamore" > À: "Remi Forax" > Cc: "amber-spec-experts" > Envoyé: Jeudi 6 Décembre 2018 20:23:05 > Objet: Re: enhanced enums - back from the dead? > On 06/12/2018 16:53, fo...@univ-mlv.fr wrote: >> >> - Mail original - >>> De: "Maurizio Cima

Re: Sealed types

2018-12-07 Thread Brian Goetz
I’ve updated the document on sealing to reflect the discussion so far. Sealed Classes *Definition.* A /sealed type/ is one for which subclassing is restricted according to guidance specified with the type’s declaration; finality can be considered a degenerate form of sealing, where no

Re: Sealed types

2018-12-07 Thread Brian Goetz
The most obvious remaining question appears to be: how do we spell "permits ". We could say "permits this", which has the advantage of being a keyword, but doesn't really mean what it says. We could say "permits local", though "local" usually means local to a method. We could say "permits

Re: Sealed types

2018-12-07 Thread Doug Lea
Some idle bikeshedding... On 12/7/18 12:50 PM, Brian Goetz wrote: > The most obvious remaining question appears to be: how do we spell > "permits ". Maybe "permits" -> "exclusivelyIncludes" or just "exclusively"? These seem less likely to be misinterpreted and also less likely to lead to any c

Re: Sealed types

2018-12-07 Thread Brian Goetz
Maybe "permits" -> "exclusivelyIncludes" or just "exclusively"? These seem less likely to be misinterpreted and also less likely to lead to any confusion with not-rare use of "permits" as a variable (in semaphores etc). Good thought. Is there any reason except convenience to use the implicit v

Re: Sealed types

2018-12-07 Thread Guy Steele
How about “permits class”? (if you don’t like that, then all I have left to offer are “permits catch” and “permits goto”. :-) > On Dec 7, 2018, at 12:50 PM, Brian Goetz wrote: > > The most obvious remaining question appears to be: how do we spell "permits > ". > > We could say "permits th

Re: Sealed types

2018-12-07 Thread Guy Steele
Has a nice ring to it. > On Dec 7, 2018, at 1:57 PM, Brian Goetz wrote: > > And if we're trying to save on new keywords: > > permits this class > > :)

Re: Sealed types

2018-12-07 Thread Brian Goetz
And if we're trying to save on new keywords:     permits this class :) On 12/7/2018 1:27 PM, Guy Steele wrote: How about “permits class”? (if you don’t like that, then all I have left to offer are “permits catch” and “permits goto”.  :-) On Dec 7, 2018, at 12:50 PM, Brian Goetz

Re: Sealed types

2018-12-07 Thread Guy Steele
More seriously (?): `permits ...` . > On Dec 7, 2018, at 1:39 PM, Guy Steele wrote: > > Has a nice ring to it. > >> On Dec 7, 2018, at 1:57 PM, Brian Goetz > > wrote: >> >> And if we're trying to save on new keywords: >> >> permits this class >> >> :) >

Re: Sealed types

2018-12-07 Thread Remi Forax
> De: "Brian Goetz" > À: "amber-spec-experts" > Envoyé: Vendredi 7 Décembre 2018 17:38:53 > Objet: Re: Sealed types > I’ve updated the document on sealing to reflect the discussion so far. > Sealed Classes > Definition. A sealed type is one for which subclassing is restricted according > to gui

Re: Sealed types

2018-12-07 Thread Brian Goetz
basically forcing me to write the code that the compiler generates for me when i use an anonymous class. Yes, and I'm OK with that :) You could look at the glass as 90% full (after all, you can still do what you want to do), or 10% empty (you had to be more explicit about it.)  I think its

Re: enhanced enums - back from the dead?

2018-12-07 Thread Maurizio Cimadamore
so let's retry public enum Foo> { S(""), I(42); // JEP 301 mentions the diamond syntax private T t; public Foo(T t) { this.t = t; } T t() { return t; } public static void main(String[] args) { Arrays.stream(values()).sorted(Comparator.co