On 2010-07-25 08:33:53 -0400, bearophile <[email protected]> said:

D lambdas can be multiline, so that's not a problem.
But it can be useful to write more readable expressions when they are complex:

auto c = sqrt(a*a + b*b) where {
    auto a = retrieve_a();
    auto b = retrieve_b();
}

Is this really an improvement over using a delegate literal?

        auto c = {
                auto a = retrieve_a();
                auto b = retrieve_b();
                return sqrt(a*a + b*b);
        };


--
Michel Fortin
[email protected]
http://michelf.com/

Reply via email to