[erlang-questions] io:format question

Daniil Churikov ddosia@REDACTED
Tue Feb 3 16:49:11 CET 2015


Does anybody know why `Format' param of `io:format' and friends disallows
`iodata'?
I test it and it kinda works (when you do not pass control sequences):


1> io:format("The quick brown fox jumps over the lazy dog~n").
The quick brown fox jumps over the lazy dog
ok

2> io:format(["The quick brown fox jumps over the lazy dog~n"]).
The quick brown fox jumps over the lazy dog~nok

3> io:format(["The quick brown fox jumps over the lazy dog\n"]).
The quick brown fox jumps over the lazy dog
ok

4> io:format(["The quick brown fox jumps over the lazy dog: ~p ~p ~n"],
[foo, bar]).
** exception error: bad argument
     in function  io:format/3
        called as io:format(<0.25.0>,
                            ["The quick brown fox jumps over the lazy dog:
~p ~p ~n"],
                            [foo,bar])
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150203/97045d8b/attachment.htm>


More information about the erlang-questions mailing list