In this example I’ll explain closures in Groovy. According to Sabesta’s nice book Concepts of Programming Languages, defining a closure is a simple matter: “a closure is a subprogram and the referencing environment where it was defined.” But explaining it is not that simple. Sabesta explains the closure as a subprogram that can be assigned to ...