using closures in scala
//returns a function which captures a value
object add {
//optional :Int => Int
def capt(x:Int) = {
(y:Int) => x + y
}
}
object HelloWorld {
def main(args: Array[String]): Unit = {
val clos = add.capt(8);
println(clos(3));
}
}
HelloWorld.main(Array());