Skip to content

Instantly share code, notes, and snippets.

@alphaKAI
Created October 8, 2014 07:58
Show Gist options
  • Select an option

  • Save alphaKAI/69901c3b29f6f18e0369 to your computer and use it in GitHub Desktop.

Select an option

Save alphaKAI/69901c3b29f6f18e0369 to your computer and use it in GitHub Desktop.
なんかふと思い立ってD言語のlambdaっていうかfunctionで遊んでみた
import std.stdio,
std.array,
std.algorithm;
void main(){
((()=>"H")()~(()=>"e")() ~(()=>"l")()~(()=>"l")()~(()=>"o")()~(()=>" ")()~(()=>"w")()~(()=>"o")()~(()=>"r")()~(()=>"l")()~(()=>"d")()).writeln;
([()=>"H", ()=>"e", ()=>"l", ()=>"l", ()=>"o", ()=>" ", ()=>"w", ()=>"o", ()=>"r", ()=>"l", ()=>"d"].map!(x => x())).join.writeln;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment