And if memory serves right, there exist a couple of libraries that implement shorthand map syntax, which means that it is even less likely to be added to the core language.
For instance there is shorter_maps <https://hex.pm/packages/shorter_maps> which uses the `~M` sigil to build shorter maps, which would make your example: `~M{var_a, var_b}`. I believe there are other libraries that do something similar as well. ~Marten/Qqwy On Saturday, August 10, 2019 at 4:54:29 PM UTC+2, Gustavo Honorato wrote: > > Hello Everyone! I'm following Elixir community for a long time and > recently I decided to start my first Elixir project, and I'm really > enjoying it. Thanks for bringing us this awesome tool. > > I noticed that many times I write the following pattern matching for maps: > > test "test descritption", %{var_a: var_a, var_b: var_b} do > # Test case here > end > > This happens mostly on test cases and it's really boring. My suggestion is > to add a shorthand matcher (like the shorthand object destruction in > Javascript). The test case could be rewritten like: > > test "test descritption", %{var_a, var_b} do > # Test case here > end > > Kindly regards, > Gustavo > -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/0374f3ce-0246-4928-bcfc-09f53085d796%40googlegroups.com.
