diff options
author | mihaylov <mihaylov@epfl.ch> | 2007-02-06 16:43:58 +0000 |
---|---|---|
committer | mihaylov <mihaylov@epfl.ch> | 2007-02-06 16:43:58 +0000 |
commit | f1c170f25f647a790126d66cab576d349b16c9b9 (patch) | |
tree | bd5da921ebc712a17be97c0c7b49baecc7253850 /src | |
parent | a27f9a3b43732372c5e48159d188036fe323e561 (diff) | |
download | scala-f1c170f25f647a790126d66cab576d349b16c9b9.tar.gz scala-f1c170f25f647a790126d66cab576d349b16c9b9.tar.bz2 scala-f1c170f25f647a790126d66cab576d349b16c9b9.zip |
Removed the PrintStream version of Stream.print
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/Stream.scala | 10 |
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) } |