Saturday, April 11, 2015

How to stop printing integer lists as character in Erlang

Erlang used to guess whether a given list is in a printable string format and print the list as a character list. This can be happened even related with binary lists. From Erlang version R16B, function is introduced to control this behavior.

shell:string(true).   - This is the default setting (Prints integer lists as character where possible)
shell:string(false). - Prints integer lists as it is without converting it into characters.

When you call this function from a one Erlang node, change will affect to all visible nodes globally. So remember to set it to default when the requirement is over. 

Labels: , , , ,