I feel rejected :)
Les Stroud
les at lesstroud.com
Tue Mar 15 13:46:34 PDT 2011
Not to butt in, but I’m not sure which one is 'less pretty', the xml version or the lisp version (<<<< vs ((( ) :)
LES
On Mar 15, 2011, at 4:32 PM, Neal Gafter wrote:
> 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
>>
>>
>>
>
--
Les Stroud Developer, Architect, Creative Thinker
web: lesstroud.com email: les at lesstroud.com linked in | twitter | facebook
More information about the lambda-dev
mailing list