Skip to content

Instantly share code, notes, and snippets.

@ncaq
Created September 29, 2013 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ncaq/6753603 to your computer and use it in GitHub Desktop.
Save ncaq/6753603 to your computer and use it in GitHub Desktop.
D言語で関数の部分適用する方法 カリー化することも多分出来る
import std.stdio;
pure int f(in int x,in int y)
{
return x + y;
}
pure auto g(in int x)
{
return (in int y) => f(x,y);
}
void main()
{
writeln(g(1)(2));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment