O'Reilly logo

Groovy Programming by John Savage, Kenneth Barclay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

APPENDIX J ADVANCED CLOSURES

Chapter 9 introduced closures as parametric code blocks that can be referenced and passed as method parameters. An important example of the latter was closures given as parameters to methods that iterated through collections. We saw how methods such as each and findAll can be used to describe some processing to be performed on all the elements of a collection.

In this appendix, we further explore closures by observing that they can also be returned from methods or from other closures. Closures as return values from other closures provide a very powerful framework that can be applied to a variety of problems. For example, we may wish to define the constraints that apply to individual objects, the relationships that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required