lambda prototype - second milestone

Ali Ebrahimi ali.ebrahimi1781 at gmail.com
Mon May 23 03:37:02 PDT 2011


Hi Maurizio,
Thanks for your hard works, this is awesome!

finally, now i can compile and run this code.

public class Test
{
   public static class Customer {
      public String getName() { return "";}
   }

   public static interface StringSorter<T> {
      abstract T value(T val);
   }

   public static interface Select<R, A> {
      public R select(A val);
   }

   public static class DBSet<T>  {
      public <U> DBSet<U> select(Select<U,T> 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()
         .select(#{c -> c.getName()})
         .sortedByStringAscending(#{str -> str});
   }
}

Best Regards,
Ali Ebrahimi

On Fri, May 20, 2011 at 8:20 PM, Maurizio Cimadamore <
maurizio.cimadamore at oracle.com> wrote:

> Dear lambdians,
> As you might have noticed, there's a new compiler in town ;-)
> There are a lot of improvements, especially around the type-system,
> type-inference part, where Dan has been doing an outstanding job at
> clearing out the issues one by one. This prototype is by no means
> complete, there are a lot of rough edges here and there - please be
> patient, especially in this early stage, and keep the bug reports
> flowing as usual. I will try to get to them as quickly as possible. Your
> feedback has proven to be very valuable to us - please continue to help
> us make Java a better language.
>
> Maurizio
>
>


More information about the lambda-dev mailing list