Call By Value : 对函数实参求值,且仅求一次 Call By Name : => 函数实参在函数体内被用到时都会求值 var value = 0 def valueIncr() = { value+=1 value } def test1(a:Int) = a+a def test2(a: =>Int) = a+a test1(valueIncr()) res205: Int = 2 value res206: Int = 1 // valueIncr() 调用两次 // valueIncr() + valueIncr() test2(valueIncr()) res207: Int = 5 value res208: Int = 3