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

Neal Gafter neal at gafter.com
Tue Jun 14 07:52:17 PDT 2011


On Tue, Jun 14, 2011 at 3:18 AM, Stephen Colebourne <scolebourne at joda.org>wrote:

> Thus the example (adjusted to make the point) above in typical java might
> be:
>
>  students.filter(#{student -> if (student == null ||
> student.getName() == null) {return false;} else {return
> student.getName().equals("Smith");}});
>
> or formatted more typically:
>
>  students.filter(#{student ->
>    if (student == null || student.getName() == null) {
>      return false;
>    } else {
>      return student.getName().equals("Smith");
>    }
>  });
>

students.filter(s => s!=null && "Smith".equals(s.getName()))


More information about the lambda-dev mailing list