Re: JEP draft: Concise Method Bodies - extend this to local functions?

2018-09-20 Thread Brian Goetz
There is also have an issue with method references because a local function has no owner type (from the Java POV, obviously there is an owner class once desugared by the compiler), Yes, unqualified method references have been on our radar since Java 8, and yes, we know that local methods w

Re: JEP draft: Concise Method Bodies - extend this to local functions?

2018-09-20 Thread Alex Buckley
On 9/20/2018 2:16 PM, Remi Forax wrote: yes, but in your example the return type is not the same, i prefer mine class Utils { Function fun() = this::bar; Function fun2() -> this::bar; Function bar() { return null; } String bar(String s) { return null; } } Yes, it's g

Re: JEP draft: Concise Method Bodies - extend this to local functions?

2018-09-20 Thread Remi Forax
- Mail original - > De: "Maurizio Cimadamore" > À: "Alex Buckley" , "amber-spec-experts" > > Envoyé: Jeudi 20 Septembre 2018 22:28:42 > Objet: Re: JEP draft: Concise Method Bodies - extend this to local functions? > On 20/09/18 21

Re: JEP draft: Concise Method Bodies - extend this to local functions?

2018-09-20 Thread Alex Buckley
On 9/20/2018 1:28 PM, Maurizio Cimadamore wrote: Function fun() = Utils::bar; Function fun = Utils::bar; (first is method body, second is variable initializer) I think Remi is noting the fact that, when using `->`, the single expression can be a method reference expression. I have already reco

Re: JEP draft: Concise Method Bodies - extend this to local functions?

2018-09-20 Thread Maurizio Cimadamore
On 20/09/18 21:22, Alex Buckley wrote: On 9/20/2018 1:08 PM, Maurizio Cimadamore wrote: On 20/09/18 17:32, Remi Forax wrote: There is also a potential confusion between   Function fun() = Utils::bar; and   Function fun() -> Utils::bar; You meant between Function fun() = Utils::bar; and

Re: JEP draft: Concise Method Bodies - extend this to local functions?

2018-09-20 Thread Alex Buckley
On 9/20/2018 1:08 PM, Maurizio Cimadamore wrote: On 20/09/18 17:32, Remi Forax wrote: There is also a potential confusion between Function fun() = Utils::bar; and Function fun() -> Utils::bar; You meant between Function fun() = Utils::bar; and Function fun = Utils::bar; ? (first is me

Re: JEP draft: Concise Method Bodies - extend this to local functions?

2018-09-20 Thread Maurizio Cimadamore
On 20/09/18 17:32, Remi Forax wrote: There is also a potential confusion between   Function fun() = Utils::bar; and   Function fun() -> Utils::bar; You meant between Function fun() = Utils::bar; and Function fun = Utils::bar; ? (first is method body, second is variable initializer) Mau

Re: JEP draft: Concise Method Bodies - extend this to local functions?

2018-09-20 Thread Remi Forax
> De: "John Rose" > À: "Brian Goetz" > Cc: "amber-spec-experts" > Envoyé: Jeudi 20 Septembre 2018 15:40:19 > Objet: Re: JEP draft: Concise Method Bodies - extend this to local functions? > On Sep 19, 2018, at 6:23 PM, Brian Goetz < [ mailt

Re: JEP draft: Concise Method Bodies - extend this to local functions?

2018-09-20 Thread Remi Forax
> De: "John Rose" > À: "Brian Goetz" > Cc: "amber-spec-experts" > Envoyé: Jeudi 20 Septembre 2018 15:40:19 > Objet: Re: JEP draft: Concise Method Bodies - extend this to local functions? > On Sep 19, 2018, at 6:23 PM, Brian Goetz < [ mailt

Re: JEP draft: Concise Method Bodies - extend this to local functions?

2018-09-20 Thread John Rose
On Sep 19, 2018, at 6:23 PM, Brian Goetz wrote: > > I think there’s more immediate payback in doing the more constrained feature > of concise method bodies first. +1 Also, local functions seem inevitably to expand into mutually recursive groups of locals. ("Why can't I do factorial? …") T

Fwd: JEP draft: Concise Method Bodies - extend this to local functions?

2018-09-19 Thread Brian Goetz
ukas Eder > Subject: JEP draft: Concise Method Bodies - extend this to local functions? > Date: September 19, 2018 at 4:44:04 PM EDT > To: amber-spec-comme...@openjdk.java.net > > Hello, > > I've just seen this new JEP draft, which really looks very useful: > http://