io_lib:format and ++

Hal Snyder hal@REDACTED
Tue Feb 19 07:27:36 CET 2002


I don't think io_lib:format is returning a flat character string.

We have:

1> "hello " ++ "there".
"hello there"

but:

2> io_lib:format("hello ~s", ["there"]).
[104,101,108,108,111,32,"there"]


So, cooking long strings with io_lib:format() gave me a surprise when
the next thing to happen was a regexp:split, which does care about
depth.

Bug, or confused programmer?

This is with otp_src_R8B-20011015-SNAPSHOT.



More information about the erlang-questions mailing list