根据该方法的Scala 文档Range.end
,它返回“范围的唯一结尾”。那么为什么它为 theto
和until
符号返回相同的值呢?例如:
Welcome to Scala version 2.9.2 (Java HotSpot(TM) Server VM, Java 1.7.0).
Type in expressions to have them evaluated.
Type :help for more information.
scala> (1 to 10).end
res0: Int = 10
scala> (1 until 10).end
res1: Int = 10
不应该res0 == 11
吗?