Erlang shell pretty print depth

非 Y 不嫁゛ 提交于 2020-01-12 03:19:33

问题


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)]).

... but I'd prefer to configure the shell to do what I want.


回答1:


An alternative to io:format("~p", [Term]) is the shell built in function rp(Term) which does exactly that.




回答2:


This post on extending the Erlang shell seems to show how to do what you want, but it's a bit more in-depth than just changing a line in a config file. Your best bet is probably to use the io:format("~p~n",[lists:seq(1,1000)]). approach.



来源:https://stackoverflow.com/questions/5434248/erlang-shell-pretty-print-depth

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!