From 21c8ba1830a367c20d41a29be6d3f0d18a4a3a39 Mon Sep 17 00:00:00 2001 From: michelou Date: Fri, 27 Apr 2007 13:12:42 +0000 Subject: added method upto --- src/library/scala/runtime/RichInt.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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) -- cgit v1.2.3