Here are some more notes from GC1 (Groovy Conference no.1), some of them might be inaccurate, subsequently changed or just plain wrong, but I might as well share what notes I did take...
Ideas for the specification
whitespace?
whitespace is significant, but it is significant as it applies to 'no dumb expression statement (NDES)' rule
macros?
macros are going to be implemented under the covers, but may not be exposed to user in first syntax spec, indeed 'while' might even be implemented as a macro under the covers...
builders?
builders have turned into lovely things :-)
builders are now intended to be included within the EBNF
this seems to have been achieved by changing the words around :-)
with (MyBuilder) { myPanel { myThing }}
or something
parens?
parens are optional, but again before you leave the planet... only on simple statements, not on expressions
escaping nested closures?
escaping nested closures involved break / return keywords
break without label would break out of tightest closure
break with label would treat closure just like while statement break (+ same with continue)
return would always return from the method (that the closure was called from?)
not sure I remember discussions about breaking with a value..?
I have published jstrachan's scribblings here
here are a few of my favourite things...
'with' keyword
with myFoo.bar.mooky { wibble = 12; wobble = 13}
equiv to...
myFoo.bar.mooky.wibble = 12; myFoo.bar.mooky.wobble=13;
and reused for builder syntax
with myFoo { bar { mooky {new Weeble()}}}
(syntax probably not quite like that)
'?.' operator
foo?.bar
equiv to
(foo != null) ? foo.bar : null
the question mark indicates that foo is questionable, i.e. it could be null, it could be any type etc... (i.e. no compile time errors if property bar doesn't exist on foo)
Anyway, just gives you an idea of some of the topics under discussion, none of it is set in stone. Look forward to comments :-)