groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <>
Subject Re: Using reserved words on Groovy Config files
Date Mon, 08 Aug 2016 13:52:26 GMT

On 08.08.2016 15:19, Facundo Farias wrote:
> Hello there!
> Because we have external dependencies, we have to use some reserved
> words on a Groovy file that will be parsed by the ConfigSlurper. We had
> to use quotation marks, and the strange thing is: in the first level, it
> works (as it can be seen on the IntelliJ screenshot, it is taken as a
> variable), but then if we have at least one level of nesting, then it
> fails (as can be sen on the screenshot, is not underlined).

"it" is not a reserved keyword as such. It is the implicit and optional 
parameter for a closure. So on the top level you have no it, in {it}, 
you have the implicit it, {foo->} has no it, it has an explcit foo, 
{foo=null->} has an implicit foo, {->} does not have any parameter and 
then of course no "it" as well. I don't know if using {-> everywhere 
would suit you better?

bye Jochen

View raw message