Steve Yegge's rant on The Next Big Language
    Vassily Gavrilyak 
    gavrilyak at gmail.com
       
    Mon Mar 12 16:32:25 PDT 2007
    
    
  
Argument(s) type could be inferred too, as it is currently with foreach.
So
auto res = [1,2,3].map((x){return x+x;}).filter((x, i){return i<2;});
Almost array comprehension.
Another possibility is to do it C# 3.0 way
auto res = [1,2,3].map(x=> x+x).filter(_, i => i<2).sort(a,b => a>b);
Such syntax is consistent with current lazy arguments.
Max Samukha Wrote:
> On Mon, 12 Mar 2007 16:14:09 +0200, Max Samukha
> <samukha at voliacable.com> wrote:
> 
> >The return value of the delegate literal is inferred from the return
> >expression type.
> >
> 
> Not return value, return type, of course. Frits was faster, anyway.
    
    
More information about the Digitalmars-d-announce
mailing list