arthur
01/25/2017, 4:46 PMonEach()? What does this give a developer that you can’t get from forEach()?
I don’t think it is clear to a new developer to the language that calling onEach() returns the iterable instance for the next statement in the chain. In the example above I would just call forEach() in the following way:
.forEach { f ->
println(“Moving $f to $outputDir”)
moveFile(f, File(outputDir, f.toRelativeString(inputDir)))
}