summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library/scala/Stream.scala10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/library/scala/Stream.scala b/src/library/scala/Stream.scala
index 0c55bcbb16..db02cd89d8 100644
--- a/src/library/scala/Stream.scala
+++ b/src/library/scala/Stream.scala
@@ -435,17 +435,15 @@ trait Stream[+a] extends Seq[a] {
zip(Stream.from(0))
/** Prints elements of this stream one by one, separated by commas */
- def print { print(Console.out) }
- def print(out: java.io.PrintStream) { print(out, ", ") }
+ def print { print(", ") }
/** Prints elements of this stream one by one, separated by <code>sep</code>
* @param sep The separator string printed between consecutive elements.
*/
- def print(sep: String) { print(Console.out, sep) }
- def print(out: java.io.PrintStream, sep: String) {
+ def print(sep: String) {
def loop(s: Stream[a]) {
- if (s.isEmpty) out.println("Stream.empty")
- else { out.print(s.head); out.print(sep); loop(s.tail) }
+ if (s.isEmpty) Console.println("Stream.empty")
+ else { Console.print(s.head); Console.print(sep); loop(s.tail) }
}
loop(this)
}