summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2007-04-27 13:12:42 +0000
committermichelou <michelou@epfl.ch>2007-04-27 13:12:42 +0000
commit21c8ba1830a367c20d41a29be6d3f0d18a4a3a39 (patch)
tree7b69f45ea341aa4e0228cf60e5ec4c156a2c0629 /src
parentb1d88408776eb4e93546ca5c78b17d2bed7b88f4 (diff)
downloadscala-21c8ba1830a367c20d41a29be6d3f0d18a4a3a39.tar.gz
scala-21c8ba1830a367c20d41a29be6d3f0d18a4a3a39.tar.bz2
scala-21c8ba1830a367c20d41a29be6d3f0d18a4a3a39.zip
added method upto
Diffstat (limited to 'src')
-rw-r--r--src/library/scala/runtime/RichInt.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/library/scala/runtime/RichInt.scala b/src/library/scala/runtime/RichInt.scala
index ef6f330e71..60264226c3 100644
--- a/src/library/scala/runtime/RichInt.scala
+++ b/src/library/scala/runtime/RichInt.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -18,6 +18,8 @@ final class RichInt(x: Int) extends Proxy with Ordered[Int] {
// Ordered[Int]
def compare (y: Int): Int = if (x < y) -1 else if (x > y) 1 else 0
+ def upto(y: Int): List[Int] = List.range(x, y + 1)
+
def until(y: Int): Iterator[Int] = Iterator.range(x, y)
def to(y: Int): Iterator[Int] = Iterator.range(x, y + 1)