328 • Developing Essbase Applications: Advanced Techniques for Finance and IT Professionals
Groovy’s dynamic nature, its ability to execute code passed in as a command line
argument, the presence of closures , and its general “less is more” approach to syntax
are all factors in allowing us this syntactic freedom. However, the biggest driver is ease
of use, both in writing and reading code. Consider this line:
[6, 3, 4, 8, 2, 7].findAll{ it % 2 == 0 }.each{ println it }
We are back to nding the even numbers in an array, this time printing 6, 4, 8, and
2 on separate lines. ere is a decent amount of work happening here. ere are two
method calls and two closures. One of the closures returns a value. Still, it is pretty
easy to see what is going ...