title: Grails config file closure definition
body: <p>I'm writing a config file for grails app where I want to define redirect patterns.
  I've written a config script RedirectMappingsConfig.groovy:</p>
  
  <pre><code>import java.util.regex.Pattern
  
  def c = {pattern, goto, path -&gt;
      if (pattern instanceof Pattern &amp;&amp; pattern.matcher(path).matches()) {
          return goto
      }
      return false
  }
  
  def redirectFromTo = [
          c.curry(Pattern.compile('/si/reference.*'), '/enterprise-solutions/references-and-partners#references'),
          c.curry(Pattern.compile('/si/kontakt.*'), '/contact-us'),
          c.curry(Pattern.compile('/si/zaposlitve.*'), '/careers'),
          c.curry(Pattern.compile('/aa'), '/')
  ]
  </code></pre>
  
  <p>This list will be read in a filter which will perform redirect if some pattern matches request uri.</p>
  
  <p>Problem: application does not compile, the error is:</p>
  
  <pre><code>Compilation error: startup failed:
  RedirectMappingsConfig.groovy: 3: unexpected token: pattern @ line 3, column 10.
     def c = {pattern, goto, path -&gt;
              ^
  </code></pre>
  
  <p>Any idea what is wrong with the syntax?
  I'm using grails 2.1.1.</p>