I feel rejected :)

Neal Gafter neal at gafter.com
Tue Mar 15 13:32:06 PDT 2011


Rémi-

I don't like casts either.  Did you mean
*
    public interface Folder<T> {
        public T fold(T a, T b);
    }

    public static <T extends Comparable<? super T>> Folder<T> max() {
      return #{ a, b -> a.compareTo(b)<0 ? b : a };
    }*

Cheers,
Neal

On Tue, Mar 15, 2011 at 8:41 AM, Rémi Forax <forax at univ-mlv.fr> wrote:

> And this one crash the compiler:
>
>     public interface Folder<T> {
>         public T fold(T a, T b);
>     }
>
>     public static <T> Folder<T> max() {
>       return #{ a, b -> (((Comparable)a).compareTo(b)<0)? b: a };
>     }
>
> It doesn't like the cast in the lambda.
>
> Rémi
>
>
>


More information about the lambda-dev mailing list