On 03/01/2010 04:00 AM, Michel Fortin wrote:
On 2010-02-28 19:46:29 -0500, Pelle Månsson <pelle.mans...@gmail.com> said:

What about @curried? It (potentially) changes the way the function is
called, yet looks quite good as an @attribute.

I'm not sure I understand how you expect a @curried attribute to be
used. How would you call a @curried function?


@curried @pure add(int a, int b) {
    return a + b;
}

auto add2 = add(2);

assert(add2(2) == 4);
assert(add(4, 1) == 5);
assert(add(4)(1) == 5);

This is how I imagine it.

It already exists as a template, somewhere.

Reply via email to