Skip to content

Instantly share code, notes, and snippets.

@tyama
Created October 15, 2010 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tyama/628391 to your computer and use it in GitHub Desktop.
Save tyama/628391 to your computer and use it in GitHub Desktop.
/*
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