Expected distribution of lambda sizes (Re: Syntax poll, take 2)
Reinier Zwitserloot
reinier at zwitserloot.com
Tue Jun 14 06:55:50 PDT 2011
Long lambdas are going to exist. Stephen Colebourne, perhaps Collin, and I
are trying to say that they may well be more common than (potentially)
one-linerable short lambdas. Whatever syntax we end up with, it should
optimally look decent when used with something other than a trivial <10
character expression.
--Reinier Zwitserloot
On Tue, Jun 14, 2011 at 3:30 PM, Paul Benedict <pbenedict at apache.org> wrote:
> I don't see how long lambdas would help code. That's not more clear to
> me than what already exists.
>
> On Tue, Jun 14, 2011 at 7:02 AM, Collin Fagan <collin.fagan at gmail.com>
> wrote:
> > Here are is a SAM types from the JDK written as if it a lambdas.
> >
> > straw man syntax
> >
> > Comparator<String> CASE_INSENSITIVE_ORDER = #(String s1, String s2) {
> > int n1=s1.length(), n2=s2.length();
> > for (int i1=0, i2=0; i1<n1 && i2<n2; i1++, i2++) {
> > char c1 = s1.charAt(i1);
> > char c2 = s2.charAt(i2);
> > if (c1 != c2) {
> > c1 = Character.toUpperCase(c1);
> > c2 = Character.toUpperCase(c2);
> > if (c1 != c2) {
> > c1 = Character.toLowerCase(c1);
> > c2 = Character.toLowerCase(c2);
> > if (c1 != c2) {
> > return c1 - c2;
> > }
> > }
> > }
> > }
> > n1 - n2;
> > };
> >
>
>
More information about the lambda-dev
mailing list