[dmd-beta] D2 2.058 beta

Andrej Mitrovic andrej.mitrovich at gmail.com
Thu Feb 9 13:57:48 PST 2012


On 2/9/12, Jacob Carlborg <doob at me.com> wrote:
> Yes it is. Together with delegates.

I didn't find them next to delegates but after hash literals in the
Expressions section.
http://www.d-programming-language.org/expression.html#Lambda

It should have usage examples though. It took me a while to figure out
what was wrong with this:

void test(int function(int, int) func) {
    func(1, 2);
}

void main() {
    test(x, y => x);
}

Error: undefined identifier x

The fix: test((x, y) => x);


More information about the dmd-beta mailing list