最大的差别是在闭包内不使用对象的任何属性,因为它被定义为静态类。
The big difference is that we don't use any properties of the object within the closure, since it is defined as static.
在进行一些灵敏的操作,例如对象导航,特别是使用闭包的时候,Groovy 偶尔会遇到歧义性问题和语法受限的问题。
When it came to clever operations such as object navigation, and particularly closures, Groovy suffered from occasional ambiguities and an arguably limiting syntax.
“闭包”可以被看成是在function scope中的一个临时对象。
The "closure" can be viewed as a temporary object that exists in the function scope.
应用推荐