File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
src/library/scala/collection/immutable Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -748,6 +748,17 @@ sealed abstract class Stream[+A] extends AbstractSeq[A] with LinearSeq[A] with L
748748
749749 override protected [this ] def writeReplace (): AnyRef =
750750 if (headDefined && tailDefined) new LazyListOps .SerializationProxy [A , Stream ](this ) else this
751+
752+ /** Prints elements of this stream one by one, separated by commas. */
753+ @ deprecated(""" Use print(stream.force.mkString(", ")) instead""" )
754+ @ inline def print (): Unit = Console .print(this .force.mkString(" , " ))
755+
756+ /** Prints elements of this stream one by one, separated by `sep`.
757+ * @param sep The separator string printed between consecutive elements.
758+ */
759+ @ deprecated(" Use print(stream.force.mkString(sep)) instead" )
760+ @ inline def print (sep : String ): Unit = Console .print(this .force.mkString(sep))
761+
751762}
752763
753764@ deprecated(" Use LazyList (which has a lazy head and tail) instead of Stream (which has a lazy tail only)" , " 2.13.0" )
You can’t perform that action at this time.
0 commit comments