jastrachan | 8 Jul 09:25 2004

Re: [groovy-dev] static binding subsystem for better performance

On 8 Jul 2004, at 00:30, Chris Poirier wrote:
> Hi James,
>> Maybe we should use a magic type name of 'any' to indicate that you
>> definitely want to be dynamically typed?
> My shortlist for the next time I have some groovy time:
>  1) add "any" as a keyword and make type required on method and
>     member declarations (thus eliminating numerous ambiguities and
>     the "def" keyword)

Good call - if this fixes ambiguity lets do it. Can we list the 
ambiguities first so we know what they are & can put them somewhere on 
the wiki so we remember why we're doing this

>  2) changing the statement terminator to EOL from semicolon (with
>     automatic line continuation at trailing operators, a la Ruby)

I'm not sure about the line continuation part; there's always a way to 
wrap things over multiple lines if people really wanna do that.


coll.each {

could be done as


sure its 1 more character than using a line continuation but hey, folks 
should use the groovy way, { on the same line :)

>  3) making the leading | on closure parameter lists required.

I chatted to John at J1 and it might be we can come up with syntax 
rules so that we only use 1 | by default and only use a leading | (or 
parenthesis) to be explicit when there could be ambiguity.

BTW next time you've some parser hacking time I'd like to support $foo 
inside Strings...

println "hello $user how are you $today"

i.e. $ followed by identifier.