var A = List(5,7,9,10,11,13) def myreverse(A: List[Int]) = (List[Int]() /: A) { (A,a) => a::A} println(myreverse(A))