Why doesn't curry work with multiple arguments?

Andrej Mitrovic none at none.none
Wed Apr 6 13:50:22 PDT 2011


import std.functional;

void foo(int x, int y, int z)
{
}

alias curry!(foo, 1, 2, 3) bar;

Error: template instance curry!(foo,1,2,3) does not match template declaration curry(alias fun,alias arg)

Shouldn't curry take a variable number of arguments and then check the length of the arguments passed in against `fun`s length of parameters, and do its work from there?

I'm trying to translate a C header file from the following to a D equivalent:
#define txmOpenFile(hwndTV, szFile) \

                  SendMessage((hwndTV), TXM_OPENFILE, 0, (LPARAM)(szFile))

Yes, I write a whole new function, but why do that when curry is there. Or so I thought..


More information about the Digitalmars-d-learn mailing list