Expected distribution of lambda sizes (Re: Syntax poll, take 2)

Neal Gafter neal at gafter.com
Fri Jun 17 11:03:56 PDT 2011


Unfortunately, even with the Guava APIs and Java today, it is impossible to
write single-expression "lambdas" because anonymous inner classes require a
block for the body of the method.  Therefore it isn't clear how helpful your
statistics would be.

On Fri, Jun 17, 2011 at 9:17 AM, Sam Pullara <sam at sampullara.com> wrote:

> There are some people that program with this style even though the syntax
> isn't there, like myself (relying on the IDE to generate most of the
> boilerplate). In my current project I have 158 .java files that generate
> 1113 .class files. 10+ lambda type usages of anonymous classes (implementing
> interfaces like Function and Predicate) are fairly commonplace in this
> codebase. Additionally, I make heavy use of the Google Guava APIs which are
> designed to be used using lambda type expressions. It isn't clear to me how
> many examples there are in the wild, but I could give some numbers on what
> it would look like at a minimum.
>
> Sam
>
> On Jun 17, 2011, at 12:53 AM, Neal Gafter wrote:
>
> > Alex's comment makes sense to me: we cannot reasonably expect to glean
> the
> > expected size of lambda bodies from an analysis of existing code bases
> that
> > both lack lambda expressions and lack APIs that were designed in the
> > presence of a language containing lambda expressions.
> >
> > On Thu, Jun 16, 2011 at 11:49 PM, Reinier Zwitserloot <
> > reinier at zwitserloot.com> wrote:
> >
> >> On Thu, Jun 16, 2011 at 9:36 AM, Alex Blewitt <alex.blewitt at gmail.com
> >>> wrote:
> >>
> >>> On 16 Jun 2011, at 08:03, Reinier Zwitserloot <reinier at zwitserloot.com
> >
> >>> wrote:
> >>>
> >>>> Using the apparent aggregate preferences of the greater java
> community,
> >>> as
> >>>> gleaned by looking at a lot of open source code, I conclude that the
> >>> greater
> >>>> java community will likely end up putting a lot more linebreaks in
> >>> closure
> >>>> bodies than we are doing with these examples.
> >>>
> >>> Using this logic, we can conclude that no-one in the greater Java
> >> community
> >>> will be interested in lambdas, since looking at open source code shows
> no
> >>> sign of lambda use at the moment.
> >>>
> >>>
> >> This flippant commentary makes no sense and does absolutely nothing to
> >> further the discussion.
> >>
> >>
> >
>
>


More information about the lambda-dev mailing list