Elixir List Syntax error -


i struggling elixir's list, tuple, keyword list etc. whats wrong list?

this works

iex> [1, one: "one"] #=> [1, {:one, "one"}] 

but doesnt

iex> [one: "one", 1] #=> syntax error before 1 

that's how elixir syntax defined in parser: identifier : expr syntax (corresponds kw rule in parser linked before) accepted @ end of list literal.


Comments