title: Scala Passing Function with Argument
body: <p>The Scala example for passing a function to another function lacks the case where the passed function (timeFlies) takes an argument (x).</p>
  
  <pre><code>object Timer {
    def oncePerSecond(callback: (Int) =&gt; Unit) {
      while (true) { callback(x); Thread sleep 1000 }
    }
    def timeFlies(x: int) {
      println("time flies like an arrow...")
    }
    def main(args: Array[String]) {
      oncePerSecond(timeFlies(5))
    }
  }
  </code></pre>
  
  <p>How can I make the above code work?</p>
  
  <p>Edit: I added an x in the oncepersecond to clarify the goal is to pass the integer.</p>