Created
March 26, 2014 10:44
-
-
Save k-nishijima/9780640 to your computer and use it in GitHub Desktop.
This file contains 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
def res = { a, b -> | |
println "a="+ a + "/ b="+ b | |
} | |
println "1:"+ res | |
println "2:"+ res("1", "2") | |
println "3:"+ {res("1", "2")} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
で、結果は
1:ConsoleScript4$_run_closure1@3c5a5e89
a=1/ b=2
2:null
3:ConsoleScript4$_run_closure2@1fcd3ed6
になるんですが、そういうものなんですかね。。。
何故2がnullになるの?
環境は
Groovy Version: 2.1.9 JVM: 1.7.0_45 Vendor: Oracle Corporation OS: Mac OS X
です。。