2013-06-24 scalaで内積 scala var a=List(1,2,3,4); var v=List(2,3,4,5); a.zip(v).map{i=> i._1*i._2;}.sum res15: Int = 40