summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/immutable/Range.scala
diff options
context:
space:
mode:
authorRex Kerr <ichoran@gmail.com>2014-09-30 12:31:40 -0700
committerRex Kerr <ichoran@gmail.com>2014-09-30 12:31:40 -0700
commit4df705745cd2a14de8830ec74c2ec7b5f973ce71 (patch)
tree334d53def17c361c143b3cbf13524f7331f86901 /src/library/scala/collection/immutable/Range.scala
parentce7f9f00c2d649f3f9ff3ad11fb2ac91b9094ed3 (diff)
downloadscala-4df705745cd2a14de8830ec74c2ec7b5f973ce71.tar.gz
scala-4df705745cd2a14de8830ec74c2ec7b5f973ce71.tar.bz2
scala-4df705745cd2a14de8830ec74c2ec7b5f973ce71.zip
SI-6192 Range: to, until and end are confusing
Added some documentation explaining what the role of `end` is.
Diffstat (limited to 'src/library/scala/collection/immutable/Range.scala')
-rw-r--r--src/library/scala/collection/immutable/Range.scala8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/library/scala/collection/immutable/Range.scala b/src/library/scala/collection/immutable/Range.scala
index 720dfeed59..3ae8a2c342 100644
--- a/src/library/scala/collection/immutable/Range.scala
+++ b/src/library/scala/collection/immutable/Range.scala
@@ -33,7 +33,13 @@ import scala.collection.parallel.immutable.ParRange
* `init`) are also permitted on overfull ranges.
*
* @param start the start of this range.
- * @param end the exclusive end of the range.
+ * @param end the end of the range. For exclusive ranges, e.g.
+ * `Range(0,3)` or `(0 until 3)`, this is one
+ * step past the last one in the range. For inclusive
+ * ranges, e.g. `Range.inclusive(0,3)` or `(0 to 3)`,
+ * it may be in the range if it is not skipped by the step size.
+ * To find the last element inside a non-empty range,
+ use `last` instead.
* @param step the step for the range.
*
* @author Martin Odersky