Created
October 15, 2010 15:33
-
-
Save tyama/628391 to your computer and use it in GitHub Desktop.
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
/* | |
original "Translation IF/ELSE´s to Portuguese" | |
http://groovyconsole.appspot.com/script/278001 | |
Translation IF/ELSE´s to Japanese | |
*/ | |
/* DSL to conditional expressions in japanese */ | |
モシ = { exp, c -> | |
if (exp){ | |
c() | |
} | |
return { c2 -> | |
if (!exp){ | |
c2() | |
} | |
} | |
} | |
/*wrapper to the closure*/ | |
ホカワ = { c -> c } | |
カケ = { println it } | |
/*DSL to if,else in japanese*/ | |
モシ (10>20){ | |
カケ 'そうだね' | |
} ホカワ { | |
カケ 'その他' | |
} | |
モシ (10<20){ | |
カケ 'そうだね' | |
} ホカワ { | |
カケ 'その他' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment