Book Image

Groovy for Domain-Specific Languages, Second Edition

By : Fergal Dearle
Book Image

Groovy for Domain-Specific Languages, Second Edition

By: Fergal Dearle

Overview of this book

Table of Contents (20 chapters)
Groovy for Domain-specific Languages Second Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Introduction to DSLs and Groovy
Index

Summary


In this chapter, we covered closures in some depth. We covered all of the important aspects of working with closures. We explored the various ways to call a closure and the means of passing parameters. We saw how we can pass closures as parameters to methods, and how this construct can allow us to appear to add mini DSL syntax to our code.

Closures are the real "power" feature of Groovy, and they form the basis of most of the DSLs that we will develop later in this book. In the next chapter, we will build on this knowledge of closures and take a look at some more of the power features of the Groovy language, including builders and metaprogramming with the ExpandoMetaClass classes.