Martin C. Martin | 15 May 14:51

Re: [groovy-dev] I'll give a Groovy presentation at the Jazoon'08


Aaron Digulla wrote:
> Quoting Dierk König <dierk.koenig@...>:
> 
>> | In a builder, you can omit the parens for "method" calls:
>> |
>> |     builder.html {
>> |         ...
>> |     }
>>
>> Where is the problem, i.e. what does not work that you
>> expected to work?
> 
> It's inconsistent style. When I write code, I find that I waste time 
> when I have to think how to format something. That's why I'm always 
> trying to find a consistent style *first* which I can push into my 
> fingertips to get my brain free for the thinking.

I think the problem here may be more a lack of documentation than 
anything else.  The rule is pretty simple: if an identifier is followed 
by a {, then the identifier is considered a function that takes a single 
argument, the Closure.  (I can't remember whether the { has to be on the 
same line as the identifier or not.)

It takes a little getting used to, but I think its measured in days.  As 
Dierk has said, this hasn't really caused lasting confusion for most people.

Best,
Martin

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Gmane