我开始学习 Scala,但发现了一个令人困惑的问题map。我的代码是这样的:
val mymap = Map(1 -> "james",2 -> "justin")
println(mymap.view.mapValues(x => "hi" + x))
println(mymap.view.mapValues(x => x.toUpperCase))
Run Code Online (Sandbox Code Playgroud)
但结果是
MapView(<not computed>)
MapView(<not computed>)
Run Code Online (Sandbox Code Playgroud)
我正在使用,view.mapValues因为.map已弃用。我需要阅读有关此内容的任何建议或文档吗?