First code then select Syntax

Ali Ebrahimi ali.ebrahimi1781 at gmail.com
Sun Nov 22 04:54:29 PST 2009


Hi All.

Just compare the different versions of following sample codes And then vote
them:

--------------------------------------------------------------
Sample code 1: new language construct with closures


version 1:

int x=0;

loop{

//do some thing
x++;

} unitl {x == 10}


version 2:

int x = 0;
loop({

//do some thing
x++;

}).until( {x == 10});



version 3:

int x = 0;
loop((){

//do some thing
x++;

}).until( (){x == 10});



version 4:

int x = 0;
loop(#(){

//do some thing
x++;

}).until( #(){x == 10});


--------------------------------------------------------------
Sample code 2: query on Collections


version 1:

         from myCollection where x > 10 select x +10 ;

version 2:

         from myCollection  where {x > 10} select {x+10};

version 3:

          from myCollection  where (int x) x > 10 select (int x) x+10;

version 4:

         from myCollection  where (int x){ x > 10} select (int x){ x+10};

version 5:

         from(myCollection ).where( (int x){ x > 10}).select( (int x){
x+10});

version 6:

        from(myCollection ).where( #(int x){ x > 10}).select( #(int x){
x+10});

..
You can add your own versions to list.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/closures-dev/attachments/20091122/4a871f22/attachment.html 


More information about the closures-dev mailing list