diff options
author | Paul Phillips <paulp@improving.org> | 2009-11-19 20:31:46 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-11-19 20:31:46 +0000 |
commit | 04a99160c27257565438b58e814c885283521358 (patch) | |
tree | 55696ed37c7172f2938fe4f212949cee28dc1728 /src/library | |
parent | 1e1c87c234826279a58c97bc5124f2e76ab58dce (diff) | |
download | scala-04a99160c27257565438b58e814c885283521358.tar.gz scala-04a99160c27257565438b58e814c885283521358.tar.bz2 scala-04a99160c27257565438b58e814c885283521358.zip |
Deprecation patrol exercises the new capabiliti...
Deprecation patrol exercises the new capabilities in Tuple2.zipped among
other exciting no-ops.
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/collection/immutable/List.scala | 48 | ||||
-rw-r--r-- | src/library/scala/reflect/Print.scala | 7 |
2 files changed, 26 insertions, 29 deletions
diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala index 3287204c58..4eb2d4ccf1 100644 --- a/src/library/scala/collection/immutable/List.scala +++ b/src/library/scala/collection/immutable/List.scala @@ -306,7 +306,7 @@ sealed abstract class List[+A] extends LinearSeq[A] * @return this list without the elements of the given list * <code>that</code>. */ - @deprecated("use `diff' instead") + @deprecated("use `list1.toSet -- list2` instead") def -- [B >: A](that: List[B]): List[B] = { val b = new ListBuffer[B] var these = this @@ -324,7 +324,7 @@ sealed abstract class List[+A] extends LinearSeq[A] * @return this list without occurrences of the given object * <code>x</code>. */ - @deprecated("use `diff' instead") + @deprecated("use `filterNot (_ == x)` instead") def - [B >: A](x: B): List[B] = { val b = new ListBuffer[B] var these = this @@ -360,13 +360,13 @@ sealed abstract class List[+A] extends LinearSeq[A] var left2 = l2 while (!left1.isEmpty && !left2.isEmpty) { - if(lt(left1.head, left2.head)) { - res += left1.head - left1 = left1.tail - } else { - res += left2.head - left2 = left2.tail - } + if(lt(left1.head, left2.head)) { + res += left1.head + left1 = left1.tail + } else { + res += left2.head + left2 = left2.tail + } } res ++= left1 @@ -382,12 +382,12 @@ sealed abstract class List[+A] extends LinearSeq[A] var left = lst while (!left.isEmpty) { - res1 += left.head - left = left.tail - if (!left.isEmpty) { - res2 += left.head - left = left.tail - } + res1 += left.head + left = left.tail + if (!left.isEmpty) { + res2 += left.head + left = left.tail + } } (res1.toList, res2.toList) @@ -397,15 +397,15 @@ sealed abstract class List[+A] extends LinearSeq[A] /** Merge-sort the specified list */ def ms(lst: List[A]): List[A] = lst match { - case Nil => lst - case x :: Nil => lst - case x :: y :: Nil => - if (lt(x,y)) - lst - else - y :: x :: Nil - - case lst => + case Nil => lst + case x :: Nil => lst + case x :: y :: Nil => + if (lt(x,y)) + lst + else + y :: x :: Nil + + case lst => val (l1, l2) = split(lst) val l1s = ms(l1) val l2s = ms(l2) diff --git a/src/library/scala/reflect/Print.scala b/src/library/scala/reflect/Print.scala index ab9ffdc99b..5b773e69b4 100644 --- a/src/library/scala/reflect/Print.scala +++ b/src/library/scala/reflect/Print.scala @@ -103,11 +103,8 @@ object Print extends Function1[Any, String] { case reflect.MethodType(formals, resultType) => formals.map(Print).mkString("(", ", ", ")") + " => " + Print(resultType) case reflect.PolyType(typeParams, typeBounds, resultType) => - (List.map2(typeParams, typeBounds) - ((tp, tb) => "[" + Print(tb._1) + " :> " + Print(tp) + " :> " + Print(tb._2) + "]")). - mkString("[", ", ", "]") + " -> " + Print(resultType) - // val z = (typeParams, typeBounds).zip map { case (tp, tb) => "[" + Print(tb._1) + " :> " + Print(tp) + " :> " + Print(tb._2) + "]" } - // z.mkString("[", ", ", "]") + " -> " + Print(resultType) + val z = (typeParams, typeBounds).zip map { case (tp, tb) => "[" + Print(tb._1) + " :> " + Print(tp) + " :> " + Print(tb._2) + "]" } + z.mkString("[", ", ", "]") + " -> " + Print(resultType) case _ => "???" } |