【发布时间】:2016-02-13 15:47:53
【问题描述】:
如何以编程方式创建closure?
我的意思是不喜欢这样
def closure = { println "hello world" }
但更像这样
Closure cl = new MethodClosure(this, "method")
....
然后调用闭包的不同方法来定义body等
【问题讨论】:
-
为什么?就是想。可能有更好的解决方案
-
@tim_yates 纯学术。因为应该可以做到。