Curry and Groovy

No, this is not about a dish originating in the cuisine of the Indian Subcontinent. It’s about Groovy Closures. Yeah, science! Currying is the Groovy’s partial function application making clones of functions, fixing values for some of the parameters and producing new functions with smaller arity* – in other words: new function accepting less argument(s). It’s possible to fix one or more parameters […]

Grails SonarQube in a box

I’ve been working with a number of initiatives aimed for code quality in Grails projects. I’ve found some great plugins like CodeNarc, GMetrics, … but before we talk about them and how to run in Grails projects I would like go through on how to expose those quality metrics in a fancy dashboard. Here comes […]

Groovy functional sugar: Trampoline

Based on Gr8-Docs, recursive algorithms are often restricted by the maximum stack height (physical limit). If you call a method that recursively calls itself too deep, you will eventually receive a StackOverflowException. An approach that helps in those situations is using Closure and trampoline capability. The trampoline() method on a closure is wrapped in TrampolineClosure […]