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 H MORE ON CLOSURES

Chapter 9 introduced closures and demonstrated their importance when iterating over collections. We also described general aspects of closures including closure parameters. Here, we consider other details concerning closures including default parameters, the distinction between closures and methods, and closures and scope rules. We also tabulate and describe the methods for Lists, Maps, and Ranges that take a closure as parameter.

H.1 CLOSURES AND AMBIGUITY

Example 06 in Chapter 9 outlined how a closure appearing as the final actual parameter to a method call may be removed from the list of actual parameters and placed immediately following the closing parenthesis. If meth represents a method with three parameters: ...

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