本文介绍了Erlang外壳漂亮打印深度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
erlang shell截断长期条款,例如:
The erlang shell truncates long terms, for example:
6> lists:seq(1,1000).
[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,
23,24,25,26,27,28,29|...]
我怎么不这样做呢?或者至少在截断术语之前增加深度。我知道我可以这样做...
How do I make it not do that? Or at least increase the depth before it truncates the term. I know I could do something like...
io:format("~p~n",[lists:seq(1,1000)]).
...但我宁愿配置shell来做我想要的。
... but I'd prefer to configure the shell to do what I want.
推荐答案
替代 io:format(〜p,[Term])
是内置函数 rp(Term)
的shell,它正是这样做的。
An alternative to io:format("~p", [Term])
is the shell built in function rp(Term)
which does exactly that.
这篇关于Erlang外壳漂亮打印深度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!