10 ms·
There are a few more concerning proplists/keyword lists: [{:x, "y"}], [x: "y"], ["x": "y"], and x: "y" are the same thing (if in args). Erlang dictates one synt
by dqv 5y ago
There are a few more concerning proplists/keyword lists: [{:x, "y"}], [x: "y"], ["x": "y"], and x: "y" are the same thing (if in args). Erlang dictates one syntax for this instead ([{x, <<"y">>}]) (ok you COULD say that technically 'x' works too)
The pinning operator x = :x; {^x, y} = {x, "y"}
Exceptions are slightly different.
There are a few others that made me realize "oh shit I need to learn Erlang first."
- linkdd 5y agoMy point was that Erlang and Elixir aren't that different. You can totally not use the syntactic sugar for proplists, it will still work the same. Therefore saying "you need to learn 2 languages" isn't correct. It's like saying Javascript/Typescript are 2 different languages. Well yes, but if you're fluent with Javascript, you'll be able to read typescript, and if you're fluent with Typescript, chances are that you are fluent with Javascript too. But I agree that one should learn Erlang first, because most of the documentation about Elixir seems to assume that you already know Erlang/OTP.