// // program to sum integers from file, where filename is a command-line argument // if (args.length < 1) { println("need command-line argument (name of file)") } else { val source = scala.io.Source.fromFile(args(0)) println("sum is " + source.getLines.map(_.toInt).sum) source.close }