Consider the following Scala code:
object MainObject {
def main(args: Array[String]) {
import Integer.{
parseInt => atoi
}
println(atoi("5")+2);
println((args map atoi).foldLeft(0)(_ + _));
}
First println works fine and outputs 7, but the second one, attempting to map array of strings against a function atoi doesn't work,with error "value atoi is not a member of object java.lang.Integer"
What's the difference?