Today I saw another topic about “why does elixir prints my list as
Printing lists as chars make sense in Erlang where this is the default string type, but in Elixir I guess it is useless, and confusing for all people that did never program with Erlang before.
What was the motivation to keep this behaviour in Elixir? What do you think about making
charlists: :as_lists the default wherever it is configurable?
Error messages coming from Erlang are the reason for keeping this behaviour.
But that doesn’t prevent to let the REPL to print charlists as lists by default. Or are there many erlang functions that return error tuples with an error message? It has been a long time since I have not written Erlang code, but as far as I can remember the modules that I use often return tuples as error reasons.
TBH it’s a tricky thing - the current default gets a fair few confused novices, but I can imagine getting just as many “I typed
iex and it printed out
[97, 98, 99] wtf” posts if it was the opposite…
Hmmm that is a very good point :D;
In that case maybe I can just redefine the Inspect.Options module in my .iex files
This, but not only for manually created charlists, but any erlang function returning charlists.