开发者

Does Scala offer functionality similar to Pretty Print in Python?

Does Scala offer function开发者_StackOverflowality similar to Pretty Print pprint in Python?


No, it doesn't. Except for XML, that is -- there's a pretty printer for that, which generates interpreter-readable data.

In fact, it doesn't even have a way to print interpreter-readable data, mainly because of how strings are represented when converted to string. For instance, List("abc").toString is List(abc).

Add to that, there's no facility at all that will break them based on width, or ident nested collections.

That said, it is doable, within the same limits as pprint.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜