Skip to content

Commit c70fbf7

Browse files
authored
Merge pull request scala#6727 from xuwei-k/sys-process-package-example
fix scala.sys.process package object examples
2 parents e33743f + 56d9b5b commit c70fbf7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/library/scala/sys/process/package.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ package scala.sys {
2525
*
2626
* {{{
2727
* import scala.sys.process._
28-
* "ls" #| "grep .scala" #&& Seq("sh", "-c", "scalac *.scala") #|| "echo nothing found" lineStream
28+
* "ls" #| "grep .scala" #&& Seq("sh", "-c", "scalac *.scala") #|| "echo nothing found" lazyLines
2929
* }}}
3030
*
3131
* We describe below the general concepts and architecture of the package,
@@ -92,7 +92,7 @@ package scala.sys {
9292
*
9393
* - Return status of the process (`!` methods)
9494
* - Output of the process as a `String` (`!!` methods)
95-
* - Continuous output of the process as a `Stream[String]` (`lineStream` methods)
95+
* - Continuous output of the process as a `LazyList[String]` (`lazyLines` methods)
9696
* - The `Process` representing it (`run` methods)
9797
*
9898
* Some simple examples of these methods:
@@ -106,10 +106,10 @@ package scala.sys {
106106
* val dirContents = "ls".!!
107107
*
108108
* // This "fire-and-forgets" the method, which can be lazily read through
109-
* // a Stream[String]
110-
* def sourceFilesAt(baseDir: String): Stream[String] = {
109+
* // a LazyList[String]
110+
* def sourceFilesAt(baseDir: String): LazyList[String] = {
111111
* val cmd = Seq("find", baseDir, "-name", "*.scala", "-type", "f")
112-
* cmd.lineStream
112+
* cmd.lazyLines
113113
* }
114114
* }}}
115115
*
@@ -163,12 +163,12 @@ package scala.sys {
163163
* }
164164
*
165165
* // This "fire-and-forgets" the method, which can be lazily read through
166-
* // a Stream[String], and accumulates all errors on a StringBuffer
167-
* def sourceFilesAt(baseDir: String): (Stream[String], StringBuffer) = {
166+
* // a LazyList[String], and accumulates all errors on a StringBuffer
167+
* def sourceFilesAt(baseDir: String): (LazyList[String], StringBuffer) = {
168168
* val buffer = new StringBuffer()
169169
* val cmd = Seq("find", baseDir, "-name", "*.scala", "-type", "f")
170-
* val lineStream = cmd lineStream_! ProcessLogger(buffer append _)
171-
* (lineStream, buffer)
170+
* val lazyLines = cmd lazyLines_! ProcessLogger(buffer append _)
171+
* (lazyLines, buffer)
172172
* }
173173
* }}}
174174
*

0 commit comments

Comments
 (0)