First code then select Syntax

Ali Ebrahimi ali.ebrahimi1781 at gmail.com
Sun Nov 22 07:05:11 PST 2009


On Sun, Nov 22, 2009 at 5:25 PM, Vladimir Kirichenko <
vladimir.kirichenko at gmail.com> wrote:

> Ali Ebrahimi wrote:
> > Hi All.
> >
> > Just compare the different versions of following sample codes And then
> > vote them:
>
> Those are not realistic. There is no LINQ in java,

But Criteria API exists in java (JPA 2).

I think lang features must be help to highly readable codes.


it's noway parens
> going to be optional, general language design is not going to be changed
> backward incompatible, and custom control structures should not be
> primary goal of this.
>
> So here are mine.
>
> 1. Anonymous:
>
> a)
>        array.sort(#boolean(int a, int b) a > b);
>
> b)
>        array.sort(fun boolean(int a, int b) => a > b);
>

c)  array.sort((int a, int b) a > b);

>
> 2. Named:
>
> a)
>        #boolean(int,int) p = #boolean(int a, int b) a > b;
>        array.sort(p);
>
> b)
>        ^boolean(int,int) p = #boolean(int a, int b) a > b;
>        array.sort(p);
>
> c)
>        fun boolean p(int a,int b) => a > b;
>        array.sort(p);
>

 d) boolean(int,int) p = (int a, int b) a > b;


> --
> Best Regards,
> Vladimir Kirichenko
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/closures-dev/attachments/20091122/16787c4c/attachment.html 


More information about the closures-dev mailing list