object HelloWorld { def main(args: Array[String]) { println(sum((x=>x),1,3) } def sum(f: Int => Int)(a: Int, b: Int): Int = { def loop(a: Int, acc: Int): Int = { if (a > b) acc else loop(???, ???) } loop(a, 0) } }
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more