
seen from Türkiye
seen from Saudi Arabia
seen from United States

seen from United States

seen from Malaysia
seen from United States

seen from United States
seen from United States

seen from United States
seen from United States

seen from United States

seen from Lithuania
seen from Malaysia
seen from China

seen from United Kingdom
seen from United Kingdom
seen from United Kingdom
seen from Russia
seen from Brazil
seen from United States
Groovy Common Extensions on Maven
Last week I pushed my groovy-common-extensions project to maven via sonatype using the brilliant Gradle Nexus plugin by @bmuschko
What's new in Groovy 2.0: inject with default initialValue
Traditionally in Groovy, the inject method takes an initial value and a Closure to execute over all elements in the delegate. For example to calculate the product of a series of Integers, you would need to set the initial value to 1 so that then multiplying this with each element in turn gets you the desired result, ie:
In Groovy 2.0 (and also 1.8.7) there is another form of inject which will take the first element in the collection as the initialValue, and then iterate over the rest of the collection.
What's new in Groovy 2.0: takeWhile and dropWhile
There are loads of major changes in Groovy 2.0 such as Static type-checking, Static Compilation, Modularity and invokeDynamic. For a run down on these and the other major changes and additions, you can read Guillaume Laforge's article on InfoQ here.
I'm going to briefly cover some of the smaller additions that might not get publicity elsewhere.
First up, we have the two new Collection methods from Andrew Taylor; takeWhile and dropWhile which have also been added to Groovy 1.8.7.