What does : => A syntax mean in method parameter declaration? [duplicate]
问题 This question already has answers here : By-name parameter vs anonymous function (5 answers) Closed 11 months ago . So, reading the Scala tour about implicit classes in Scala, I came across this piece of code: object Helpers { implicit class IntWithTimes(x: Int) { def times[A](f: => A): Unit = { def loop(current: Int): Unit = if(current > 0) { f loop(current - 1) } loop(x) } } } What is troubling me here is the def times[A](f: => A): Unit = { line. What is going on here? The part of the