A Scala call by name example

Shows a nice Scala call-by-name example. The definition of a call-by-name method:

def whileLoop (cond: => Boolean) (stat: => Unit): Unit

Calling the call-by-name method:

var i = 0
whileLoop(i < 10) {
  println(i)
  i += 1
} // whileLoop