[erlang-questions] R12 and io_lib_pretty.erl

Nicolas Thauvin nthauvin@REDACTED
Fri Mar 28 14:03:43 CET 2008


Hi,

   Some of our applications have a strange behavior in OTP R12B1 when using  
io(_lib):format

R11B5 :
1>io:format("~100p~n",[{example,lists:seq(1,30)}]).
{example,[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,30]}
ok

R12B1 :
1>io:format("~100p~n",[{example,lists:seq(1,30)}]).
{example,[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,30]}
ok

=> A line break occurs despite the 100 columns width

The reason is 'defined' the top of io_lib_pretty.erl :
-define(MAXCS, 60).

This new limit breaks some things: in our case, we write a long comment in  
the first line of a file to be opened using file:consult/1. With the line  
break, a part of the comment is seen as a (bad) file content...

Questions are:
- Why MAXCS ?
- Is there an (easy) workaround to retrieve R11 behavior ?
- Shouldn't it be mentionned in the "Potential incompatibilities" ?

Thanks,

-- Nicolas Thauvin



More information about the erlang-questions mailing list