Scala 3, Programming Scala.
eliminates the braces. This makes it easier to compare the differences. First, here is an examplemethod that takes a function argument, which takes no arguments: def times(n: Int)(f: => Unit): Unit = for i <- 0 until n do f // Use braces to define and pass the function: times(3) { println("one")