Created
September 29, 2013 15:46
-
-
Save ncaq/6753603 to your computer and use it in GitHub Desktop.
D言語で関数の部分適用する方法
カリー化することも多分出来る
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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