title: How to return callback parameter value from its caller?
body: <p>I am using a function from third party code, which looks like this:</p>
  
  <pre><code>scala&gt; def willCallback(fun: Function1[Int, Unit]) {
       | doWork()
       | fun(1)
       | }
  willCallback: (fun: Int =&gt; Unit)Unit
  </code></pre>
  
  <p>In my code, I define a function and would like it to return the callback function parameter, to achieve this:</p>
  
  <pre><code>scala&gt; def callbackResult():Int = {
       |   willCallback( (i:Int) =&gt; {
       |     // What do I put here 
       |     // to make the return value of callbackResult to be i?
       |   })
       | }
  </code></pre>
  
  <p>What can I do to make it work?</p>
  
  <p>Thanks.</p>