O'Reilly logo

Groovy in Action, Second Edition by Dierk König and Paul King with Guillaume Laforge, Hamlet D'Arcy, Cédric Champeau, Erik Pragt, and Jon Skeet

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

Chapter 9. Compile-time metaprogramming and AST transformations

This chapter covers

  • Removing redundancy and verbosity with Groovy’s metaprogramming annotations
  • Writing your own compiler extensions using the AST transformations feature
  • Compile-time metaprogramming testing, tools, and pitfalls

It is my firm belief that all successful languages are grown and not merely designed from first principles.

Bjarne Stroustrup, The Design and Evolution of C++

The previous chapter covered dynamic programming with Groovy, where the behavior of a type or even an individual object can change while the program is executing. You don’t always need the behavior to vary that dynamically though—sometimes you want only to be able to apply common patterns in ...

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