Skip to content

Instantly share code, notes, and snippets.

@zakky-dev
Created July 28, 2013 13:30
Show Gist options
  • Save zakky-dev/6098588 to your computer and use it in GitHub Desktop.
Save zakky-dev/6098588 to your computer and use it in GitHub Desktop.
D言語のラムダで遊んでみた
import std.stdio;
void main() {
int delegate()[int] dict;
foreach(it; 0 .. 10) {
dict[it] = ((i) => (() => i))(it);
}
foreach(key, func; dict) {
writeln(key, " => ", dict[key]());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment