Hello!
I have been working with Elixir on production level for 6 months. I find myself regularly doing pattern matching similar to this way:
%{"id" => id,firstname: firstname, ...} = person_map
I come from a Javascript background and recently destructing was added to JS that pretty much looks like pattern matching in Elixir with the difference that I was able to do this in JS:
{ id, firstName } = personObject
please don't mind the camel case, I know how sensitive Elixir developers are to that 😄I was wondering if there was a way to make pattern matching like that in Elixir, for example the code above will be something like this:
%{ id, firstname, ...} = person_map
Maybe make that possible only on atom map keys to avoid converting between strings and atoms, or add a macro that does that.
I would love to hear your opinion, it's something that is done all the time on pattern matching and honestly I'm a little jealous JS can do that but Elixir `the mother of pattern matching` can't!