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

Joe Armstrong erlang@REDACTED
Tue Oct 14 21:59:44 CEST 2008


Thanks - so now I can hack this to fetch RecDefFun at run-time :-)

/Joe


On Tue, Oct 14, 2008 at 5:51 PM, Ulf Wiger (TN/EAB)
<ulf.wiger@REDACTED> wrote:
> 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