Guillaume Laforge | 16 May 12:09
Picon
Gravatar

Re: [groovy-user] Oddities in the grammar that effect DSL writing

On Fri, May 16, 2008 at 12:04 PM, Jochen Theodorou <blackdrag@...> wrote:
> Russel Winder schrieb:
>>
>> On Thu, 2008-05-15 at 03:51 -0700, melix wrote:
>
> [...]
>>
>> Perhaps it might be helpful if I point out that this is exactly the sort
>> of way that functional programming languages, e.g. Haskell, do things.
>>
>> Also of course:
>>
>>        foo a.prop ( 2 / 3 ) c { println it }
>>
>> is equivalent to
>>        foo ( a.prop , 2 / 3 , c , { println it } )
>>
>> if you want to be really consistent :-)
>
> sure, I see that... but what about:
>
> foo a.prop(2/3) c { println it }
>
> is it now:
>
> foo ( a.prop ( 2 / 3 ) , c , { println it } )
>
> ? I am not saying this or that is bad, I just want to remark, that if that
> is true, then we are going to add whitespace sensitivity here.

Yeah, that would feel weird to seperate c from the closure, when it
really reads like the closure is passed into c.
I don't think this rule would be ideal and easily mentally parseable.

--

-- 
Guillaume Laforge
Groovy Project Manager
G2One, Inc. Vice-President Technology
http://www.g2one.com

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

    http://xircles.codehaus.org/manage_email


Gmane