Syntax for method references

Brian Goetz brian.goetz at oracle.com
Wed Oct 26 13:54:06 PDT 2011


There was going to be an announcement when consensus was reached in the EG.  We're not there yet; "front runner" is my subjective characterization based on recent discussions.  We've been pretty consistent about relaying syntax decisions when they're made; this one isn't made yet.  

Note that this syntax was also shown in JavaOne presentations recently.  Showing a candidate syntax in a conference presentation, blog post, or web article is one of the ways we gather feedback on ideas that are still being kicked around, since that gives us a chance to gauge reactions, which is one of the inputs we use in evaluating a syntax.    

(Keen observers might recall that each iteration of State of the Lambda used a *different* syntax for lambdas!   And none of them were the final version.)  




On Oct 26, 2011, at 1:47 PM, Collin Fagan wrote:

> I think :: is just fine. I just wish there had been some announcement on the list that this was the front runner. 
> 
> Collin
> 
> On Wed, Oct 26, 2011 at 3:38 PM, Brian Goetz <brian.goetz at oracle.com> wrote:
> It is perfect, until you realize it is unworkable; you need room for generic type arguments on both sides:
> 
>  foo-><T>bar
> 
> or
> 
>  foo<T>->bar
> 
> At which point you give up on that approach.
> 
> 
> 
> On Oct 26, 2011, at 12:39 PM, Serge Boulay wrote:
> 
> > I liked the syntax shown at the 2011 JVM language summit
> >
> > Predicate<> p = String->isEmpty
> >
> > http://www.wiki.jvmlangsummit.com/images/a/a1/2011_Goetz_Extension_Slides.pdf
> >
> > On Wed, Oct 26, 2011 at 3:17 PM, Bob Foster <bobfoster at gmail.com> wrote:
> >
> >> On Tue, 25 Oct 2011 15:01:21 -0700 (whew!) Brian Goetz wrote:
> >>
> >> Oh, good. The dreaded :: from C++. :)
> >>
> >> Bob
> >>
> >>> This is the current front-runner.
> >>
> >>> On Oct 25, 2011, at 9:26 AM, Stephen Colebourne wrote:
> >>>> Is this now decided? Or just an experiment?
> >>>>
> >> http://www.ibm.com/developerworks/java/library/j-ldn3/index.html?ca=drs-
> >>>>
> >>>> Collections.sortBy(people, Person::getLastName);
> >>>> people.sortBy(Person::getLastName);
> >>>>
> >>>> Stephen
> >>>>
> >>
> >>
> >
> 
> 
> 



More information about the lambda-dev mailing list