object Main extends App { def f(x: Int) = x + 2; def y(x: Int => Int) = x(10) val answer = y(f) println(answer)}
Standard input is empty
12
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!