Open amnaredo opened 3 years ago
Yeah you should be using
scala> pprint.pprintln(new Object)
java.lang.Object@1ec8ad64
PPrint
it usually used as a typeclass to allow pretty-printing, e.g.
def log[T: PPrint](t: T) = {
...
pprintln(t)
...
}
The apply method on its companion is handy for constructing it, but generally shouldn't be used unless you're doing something special
Original Author: lihaoyi
Ah, ok. I was a bit confused because the website features an example that seems to use PPrint as a function:
scala> PPrint(new Object())
res35: String = java.lang.Object@54f880c0
How should I go about pretty printing something to a String instead of stdout?
Original Author: samuela
For that you can use pprint.tokenize
.
If the docs are outdated I should go fix it...
Original Author: lihaoyi
My
build.sbt
looks something likeAnd then
Am I missing something?
ID: 153 Original Author: samuela