title: Need help understanding currying using groovy closures?
body: <p>I am trying to understand how currying works in functional programming. I have gone through <a href="http://en.wikipedia.org/wiki/Currying" rel="nofollow noreferrer">wiki</a> and a couple of questions about the same on SO. </p>
  
  <p><a href="https://stackoverflow.com/questions/3623956/need-help-understanding-lambda-currying">Need help understanding lambda (currying)</a></p>
  
  <p><a href="https://stackoverflow.com/questions/36314/what-is-currying">What is &#39;Currying&#39;?</a></p>
  
  <p>I understand that currying is all about splitting a function that takes n arguments into n  or less functions with one argument each. I theoretically comprehend it but I am not able to connect the dots while coding for the same. Perhaps it is my lack of knowledge in functional programming  languages or C# (as many answers in the above questions deal with). </p>
  
  <p>Anyway, I understand groovy &amp; java. So I tried to get an outline for the standard <code>add(a,b)</code> function in groovy but I couldn't finish it. </p>
  
  <pre><code>def closure = { arg -&gt;
     // ??
  }
  
  def add(anotherClosure , a){
      return closure // ??
  }
  </code></pre>
  
  <p>Can someone help me understand currying using groovy closures?</p>