lud

lud

Change defaults printing of lists to ASCII chars

Today I saw another topic about “why does elixir prints my list as 'kjqzd' ?”

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?

Most Liked

hauleth

hauleth

Error messages coming from Erlang are the reason for keeping this behaviour.

al2o3cr

al2o3cr

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 'abc' in iex and it printed out [97, 98, 99] wtf” posts if it was the opposite…

lud

lud

Hmmm that is a very good point :D;

In that case maybe I can just redefine the Inspect.Options module in my .iex files

Last Post!

LostKobrakai

LostKobrakai

This, but not only for manually created charlists, but any erlang function returning charlists.

Where Next?

Popular in Discussions Top

AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31695 143
New
AstonJ
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
PragTob
Hey everyone, this has been brewing in my head some time and it came up again while reading Adopting Elixir. GenServers, supervisors et...
New
lorenzo
Hey everone! I created a prototype for my app using Nodejs for the api. But the framework I chose wasnt great (in general theresnt any g...
New
nburkley
AWS re:Invent is on at the moment with some interesting announcements. One new feature in particular is the Lambda Runtime API for AWS La...
New
tomekowal
Hey guys! I want to create a toy project that shows a chart of temperature over time and updates every 5 seconds. I feel LiveView is per...
New
marciol
Please, let me know if this kind of discussion already took place in another topic . Hi all, how do you consider if is better to build ...
New

Other popular topics Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31494 112
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

We're in Beta

About us Mission Statement