Updated State of the Lambda

Ali Ebrahimi ali.ebrahimi1781 at gmail.com
Fri Oct 15 22:36:55 PDT 2010


looks fine. another step to real closures.

but one question. if we can not improve the inference scheme to support
following sample code?

public class Test
{
   public static class Customer {
      public String getName() { return "";}
   }
   public abstract static class StringSorter<U> {
      abstract String value(U val);
   }
   public static interface Select<U, V> {
      public V select(U val);
   }
   public static class DBSet<T>  {
      public <U> DBSet<U> select(Select<T,U> x) {return new DBSet<U>();}
      public DBSet<T> sortedByStringAscending(StringSorter<T> x) {return this;}
   }

   public static DBSet<Customer> allCustomer()
   {
      return new DBSet<Customer>();
   }

   public static void main(String[] args)
   {
      DBSet<String> result = allCustomer()   //DBSet<Customer>
         .select(#{c -> c.getName()})      // This line fails in compile time
         .sortedByStringAscending(#{str -> str});

   }
}


On Fri, Oct 15, 2010 at 11:25 PM, Brian Goetz <brian.goetz at oracle.com>wrote:

> An updated draft (Version 3) of the State of the Lambda has been published
> at:
>
>   http://cr.openjdk.java.net/~briangoetz/lambda/lambda-state-3.html
>
> Notable differences from the previous draft include:
>  - 'this' in lambda expressions is lexically scoped
>  - 'yield' keyword dropped in favor of 'return'
>  - new syntax
>
> Maurizio will be pushing an implementation conforming to this draft soon.
>
>
>


More information about the lambda-dev mailing list