[erlang-bugs] example of io_lib:fread/2

Serge Aleynikov saleyn@REDACTED
Fri Apr 11 12:53:45 CEST 2008


Sebastian Egner wrote:
> Hi there,
> 
> This is not a bug report, but an Erlang beginner here spent a long time 
> staring at the output:
> 
>     1> io_lib:fread("Uptime: ~d", "Uptime: 100").
>     {ok,"d",[]}
> 
> Maybe a candidate for an example that comes with io_lib:fread/2...
> 
> Cheers,
> 
> Sebastian.

This is not really the io_lib:fread/2 issue.  Try this:

1> [100].
"d"

When a list is printed in the shell if it contains all integers being 
printable characters, they are printed as a string.

Serge



More information about the erlang-bugs mailing list