开发者

Erlang shell pretty print depth

开发者 https://www.devze.com 2023-02-19 14:07 出处:网络
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,

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.


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


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.

0

精彩评论

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

关注公众号