2 ms·
you are conviently forgetting one thing: The equivalent of "hello world" in erlang is <<"hello world">> Not the best. Keyword lists in erlang are unpret
by dnautics 6y ago
you are conviently forgetting one thing:
The equivalent of "hello world" in erlang is
<<"hello world">>
Not the best. Keyword lists in erlang are unpretty
m:f(value, [{foo, <<"bar">>}, {baz, 47}])
Where in elixir you would do:
:m.f(value, foo: "bar", baz: 47)
- dmitriid 6y ago> The equivalent of "hello world" in erlang is is "hello world". Edit: I know that "" in Elixir is binaries which are <<>> in Erlang. In Erlang "hello world" is really a list of ["h", "e", "l", "l", ...]. What was surprising to me is how rarely that matters (unless you actually do a lot of text processing). And the functions that matter (like I/O) deal with io_lists anyway. And since strings in Elixir are binaries, when you actually need to work with binaries, you're back to the same/similar syntax: <<0:1, 0:1, 1:1, 1:1>> == <<3:4>> %% Erlang <<0::1, 0::1, 1::1, 1::1>> == <<3::4>> ## Elixir > Keyword lists in erlang are unpretty Keyword lists in Elixir are nice, that's true.