Table of Contents
The 1.8.1 release of Groovy is primarily a bug fix release but also comes with the new features outlined below.
A feature found in other scripting languages like Perl or Awk is to be able to have a begin / end method when processing a file line by line. The groovy command supports this mode of operation, but didn't support the begin / end methods. (this feature is actually going to be available in 1.7.11 and 1.8.1, but time ran short for inclusion in the 1.8 final release)
More concretely, if you have a text file named dummy.txt, and you want to count the number of lines it contains, you could do this on the command-line:
Shown for a batch size of 20:
Named parameters (into maps or domain objects) are also supported:
Named ordinal parameters (into maps or domain objects) are also supported: