> De: "John Rose" <john.r.r...@oracle.com>
> À: "Brian Goetz" <brian.go...@oracle.com>
> Cc: "amber-spec-experts" <amber-spec-experts@openjdk.java.net>
> 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 < [ mailto:brian.go...@oracle.com |
> brian.go...@oracle.com ] > 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? …")

> There are some design ideas for all that, but it's complicated enough on its 
> own
> that it
> has to be done on its own or as part of a larger project.

> And FTR I am very enthusiastic about CMB's: They are a decisive improvement
> in Java's ability to do software reuse at method granularity. They include 
> both
> static and dynamic delegation as special cases, which are patterns Java hasn't
> been so good at to date. I remember proposals for first-class delegation 
> support
> in the past, and CMB's subsume those, IMO.

And explicit delegations is far better than implicit delegation as Kotlin does, 
but while i find the single expression form useful, the method reference form 
is very similar to the syntax that was once proposed for default methods and i 
still find this syntax ugly. 

There is also a potential confusion between 
Function<A,B> fun() = Utils::bar; 
and 
Function<A,B> fun() -> Utils::bar; 

> — John

Rémi 

Reply via email to