diff options
author | michelou <michelou@epfl.ch> | 2007-04-27 13:12:42 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2007-04-27 13:12:42 +0000 |
commit | 21c8ba1830a367c20d41a29be6d3f0d18a4a3a39 (patch) | |
tree | 7b69f45ea341aa4e0228cf60e5ec4c156a2c0629 /src/library | |
parent | b1d88408776eb4e93546ca5c78b17d2bed7b88f4 (diff) | |
download | scala-21c8ba1830a367c20d41a29be6d3f0d18a4a3a39.tar.gz scala-21c8ba1830a367c20d41a29be6d3f0d18a4a3a39.tar.bz2 scala-21c8ba1830a367c20d41a29be6d3f0d18a4a3a39.zip |
added method upto
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/runtime/RichInt.scala | 6 |
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) |