我想知道是否有人能(用一些简单的例子)向我解释Groovy中的with{}和identify{}块之间的区别。
实际上,没有一个,它们做的是相同的事情。从Groovy文档中:
identity
Allows the closure to be called for the object reference self.
Synonym for 'with()'.