简体   繁体   English

在Groovy中使用vs识别块

[英]With vs Identify Block in Groovy

我想知道是否有人可以通过一些简单的例子向我解释Groovy中with {}和identify {}块之间的区别。

Actually, there isn't one, they do the same thing. 实际上,没有人会做同样的事情。 From the Groovy docs : Groovy文档

identity

Allows the closure to be called for the object reference self. 
Synonym for 'with()'.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM