Last active
August 29, 2015 13:59
-
-
Save gakuzzzz/10814618 to your computer and use it in GitHub Desktop.
Is Stream#addString correct?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scala> Iterator.iterate(0)(_ + 1).take(10).addString(new StringBuilder, ",") | |
res7: StringBuilder = 0,1,2,3,4,5,6,7,8,9 | |
scala> Stream.iterate(0)(_ + 1).take(10).addString(new StringBuilder, ",") | |
res8: StringBuilder = 0,? | |
scala> Iterator.iterate(0)(_ + 1).take(10).toString | |
res9: String = non-empty iterator | |
scala> Stream.iterate(0)(_ + 1).take(10).toString | |
res10: String = Stream(0, ?) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment