Why don't you have a variable as a key in a map symbol?
For instance,
x = "foo" %{foo => 1} **(CompileError) iex:11: illegal use of variable x in map key Obviously, it builds a map at compile time, which might be more efficient, but why doesn't it return to the runtime constructor, like most languages ββwith data structure literals? It is interesting to know if there is something about the characteristics of the cards in Elixir that I miss.
Adding to the confusion in this post by Google Groups over a year ago, where Jose Valim says:
Variable keys in maps will be available in the next Erlang release. But that was a year ago, now, and I cannot find any other references to this. What was the Erlang version for? I'm running 18 right now, and it's definitely still out of place.