After experimenting with Groovy’s AST Browser and noticing that Groovy’s grammar allows closures as annotation values, “pniederw” coded an AST transformation that allows you to pass closures as annotation values. Check out how to empower annotations with Groovy closures. If you are a programmer who is no stranger to Groovy you’ll find this AST transformation procedure to be quite interesting I think. The author also gives you a quick explanation as to how AST transformations allow you connect to the Groovy compiler and actually take part in the program’s compilation. Plenty of code snippets are provided and it’s a nice little tutorial.
Groovy-Annotation Closures
Previous post: Internet Access Singapore
Next post: Future Text

