下面代码中 <- 子句的含义是什么?像作业吗?
class Nested {
var filesHere = (new java.io.File(".")).listFiles()
def fileLines(file: java.io.File) =
scala.io.Source.fromFile(file).getLines().toList
def grep(pattern: String) =
for (
file <- filesHere
if (file.getName.endsWith(".scala"));
line <- fileLines(file)
if line.trim().matches(pattern)
) println(file + ": " + line.trim)
}