Can I disable printing lists of small integers as strings in Erlang shell?

前端 未结 7 982

The Erlang shell \"guesses\" whether a given list is a printable string and prints it that way for convenience. Can this \"convenience\" be disabled?

相关标签:
7条回答
  • 2020-11-27 21:38

    As of Erlang/OTP R16B, you can use the function shell:strings/1 to turn this on or off. Note that it also affects printing of things that are actually meant to be strings, such as "foo" in the following example:

    1> {[8,9,10], "foo"}.
    {"\b\t\n","foo"}
    2> shell:strings(false).
    true
    3> {[8,9,10], "foo"}.   
    {[8,9,10],[102,111,111]}
    
    0 讨论(0)
提交回复
热议问题