[erlang-questions] Finding inconsistencies in record definitions and pretty printing records

Ulf Wiger (TN/EAB) <>
Tue Oct 14 17:51:07 CEST 2008


Joe Armstrong skrev:
> 
> For a production version some improvements are necessary:
> 
>      - ...
>      - improve pretty printer

Therer is already a good pretty printer of records in OTP:
io_lib_pretty:print(Term, Column, LineLength, Depth, RecDefFun)

where Column is typically 1, LineLength = 30 in the shell,
and RecDefFun = fun(Tag, N_fields) -> [Field_name] | no

See shell.erl for how it's used.

I played around with it here:
http://ulf.wiger.net/weblog/2007/11/20/extending-the-erlang-shell-part-1/

BR,
Ulf W



More information about the erlang-questions mailing list