Ref: setction 9.4 about defining new control sctructures
I changed the "twice" example and overloaded the method. When calling it, compiler throws error and I had to type cast the function literal. Can someone please throw some light on why it is happenning sow
def twice ( op: Int=> Int, x: Int) = { println("twice with Int") op (op(x))
} def twice ( op: Double=> Double, x: Double) = { println("twice with Double") op (op(x))