メソッドのScalaドキュメントによると、Range.end
「範囲の排他的な終わり」を返します。では、なぜto
と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
?