这是indexWhere
方法中的错误,还是对下面示例中的前四行有有意义的解释?
scala> List(1, 1, 4, 4, 4).indexWhere(_ > 3, -4)
res0: Int = -2
scala> List(1, 1, 4, 4, 4).indexWhere(_ > 3, -3)
res1: Int = -1
scala> List(1, 1, 4, 4, 4).indexWhere(_ > 3, -2)
res2: Int = 0
scala> List(1, 1, 4, 4, 4).indexWhere(_ > 3, -1)
res3: Int = 1
scala> List(1, 1, 4, 4, 4).indexWhere(_ > 3, 0)
res4: Int = 2
scala> List(1, 1, 4, 4, 4).indexWhere(_ > 3, 1)
res5: Int = 2
scala> List(1, 1, 4, 4, 4).indexWhere(_ > 3, 2)
res6: Int = 2
scala> List(1, 1, 4, 4, 4).indexWhere(_ > 3, 3)
res7: Int = 3
scala> List(1, 1, 4, 4, 4).indexWhere(_ > 3, 4)
res8: Int = 4
scala> List(1, 1, 4, 4, 4).indexWhere(_ > 3, 5)
res9: Int = -1