I am struggling with Elixir's List, Tuple, Keyword List etc. Whats wrong with this list?
This works
iex> [1, one: "one"] #=> [1, {:one, "one"}]
But this doesnt
iex> [one: "one", 1] #=> Syntax error before 1
That's just how the Elixir syntax is defined in the parser: the identifier : expr
syntax (corresponds roughly to the kw
rule in the parser linked before) is only accepted at the end of a list literal.