Command Expression based DSL
1.8 or 2.0
Jochen "blackdrag" Theodorou
2009 2010-1203-11 23
Last update by:
So the Groovy notation would be a bit more verbose, but not much.
To be evaluated: Mixed case with explicit parentheses
A possible supported case is also when mixing method calls with explicit parentheses within that extended command expression.
The benefit would be to allow the ability to also be able to call methods not taking parameters, as well as allowing an odd number of "elements" (ie. a method name or a parameter).
m1 a m2 b m3() m1 a m2() m3 b m1() m2 a m3 b
would be respectively equivalent to:
m1(a).m2(b).m3() m1(a).m2().m3(b) m1().m2(a).m3(b)
Note that the method calls with explicit parentheses could also take a number of arguments.
For instance, this is also a valid mixed command expression:
m1 a m2(1, 2, 3) m3 b