Stephan Soller <stephan.sol...@helionweb.de> wrote:

        [1, 2, 3, 4, 5].select((int e){ return e > 3; })
                .collect((int e){ return e*e; });

It's already fairly compact. The main overhead is the parameter type and the return statement. I don't believe this can be reduced any more without breaking consistency of the language.

The delegates can be passed by alias parameter, and then be written
without the parameter type:

@property void bar(alias t)() {
    t(3);
}

void main() {
    bar!((e){writeln(e);});
}


--
Simen

Reply via email to