I was reading through the Enum module functions and copying them into the repl to get a feel for how they work. I pasted the following into the repl from the documentation.
A list containing only integers that represent printable ASCII is indistinguishable from an Erlang charlist.
The REPL uses inspect which tries to pick the correct representation based on the values in the list: if none of them are unprintable, they are displayed as a charlist - because 'hello' is more readable than a list of numbers:
Is there a global charlists option in iex? I almost never really want iex to display a charlist instead of a list of ints, so I would much rather have to opt into displaying as charlist.
A charlist is a list of characters, i.e. like this: ['a', 'b', 'c'] and a char is basically an integer, so the repl gets confused with how to display a list of ints.
Gah, I forgot to hit the reply button and several people have already answered, but I’m going to hit the button anyway so I can feel smart and good about myself…