title: repeat action several times and collect the result
body: <p>I have an <code>action</code> which I need to do over an <code>object</code> several times and the collect the result of each <code>action</code> with that object. </p>
  
  <p>Basically it looks like this</p>
  
  <pre><code>def one_action = { obj -&gt;
      def eval_object = process(obj)
      eval_object.processed = true
      return eval_object
  }
  
  def multiple_actions = { obj, n, action -&gt;
      def result = []
      n.times {
          result &lt;&lt; action(obj)
      }
      return result
  }
  
  println multiple_actions(object, 10, one_action)
  </code></pre>
  
  <p>Is there a way to omit declaration of <code>def result = []</code> and return the list directly from the closure?</p>