Issue with Curry

sybrandy sybrandy at gmail.com
Thu Jun 24 15:54:32 PDT 2010


Hello,

I tried using the curry function last night and I ran into a compilation 
issue.  Here's a simple example that demonstrates the issue:

import std.functional;
import std.stdio;

void strwrite(string input)
{
     writeln(input);
}

alias curry!(strwrite, "foo") writefoo;

void main()
{
     writefoo();
}

And the error message:

/apps/dmd2/linux/bin/../../src/phobos/std/functional.d(303): Error: 
tuple index 1 exceeds 1
/apps/dmd2/linux/bin/../../src/phobos/std/functional.d(9): Error: 
template instance std.functional.curry!(strwrite,"foo") error instantiating

The examples I found in the documentation used ints, IIRC, however I 
don't recall seeing anything that would prevent me from using a string 
in this case.  Am I doing something wrong or did I find an issue?

Casey


More information about the Digitalmars-d-learn mailing list