groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel.Sun" <sun...@apache.org>
Subject Re: Help with Groovy syntax
Date Fri, 25 May 2018 13:58:12 GMT
Hi Chris,

      If the last parameter of method is a closure, we can write code like
as follows:

someMethod("abc") {
    // this is a closure
}

the above code is equal to

someMethod("abc", {
    // this is a closure
})

As you can see, the former code is much more readable and groovy ;-)

Cheers,
Daniel.Sun






--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Users-f329450.html

Mime
View raw message