[erlang-questions] io:format vs io_lib:format

Anthony Shipman als@REDACTED
Sat Aug 25 21:10:32 CEST 2007


On Saturday 25 August 2007 15:11, Maximillian Dornseif wrote:
> I  understand that io:format and io_lib:format are to erlang what printf
> and sprintf are to C. So I wonder why I get different results from them.
> What am I missing here?
...........
>
> The obvious solution is to use lists:flatten(io_lib:format(...)) but why?
>
> Regards
>
> Maximillian Dornseif

The io_lib documentation says:

There is no guarantee that the character lists returned from some of the 
functions are flat, they can be deep lists. lists:flatten/1 can be used for 
flattening deep lists.
-- 
Anthony Shipman                    Mamas don't let your babies 
als@REDACTED                   grow up to be outsourced.



More information about the erlang-questions mailing list