On Sunday, 21 May 2017 at 18:17:57 UTC, Adam D. Ruppe wrote:

But, using the struct stuff, we can add some artificial sweetener now:

return bar(lambda!(x, q{ (int y) => x + y }));

You pass the captures first, then a q{} string literal of the lambda. Here's the implementation of that lambda template:

    template lambda(Args...) {
// ...

        anon lambda() {
                anon a;
                // copy the values in
                a.tupleof = Args[0 .. $-1];
                return a;
        }
    }

Looks cool, but it'd still want a GC closure, won't it?

Reply via email to