-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
~m{a: 1} generates atom instead of string #15
Comments
i dug through the code (tests more specifically) and found that the syntax that does work is |
Hi, sorry to have missed you while this was open and you were struggling. I'm not 100% clear what your initial goal was: if you want the map The goal of shortermaps is when your variable names correspond to the keys of a map; so if you had: iex> a = 1
...> ~M{a}
%{:a => 1}
# -or-
...> ~m{a}
%{"a" => 1} in short, Please feel free to re-open if you think there's an issue to fix here. |
oh no, i did indeed supply a bad example that didn't explain my motive. i want to pattern match. let's say there's an incoming map like
i want to extract both keys, but if
I'm expecting that sigil to return a map with two string keys, but actually
does this make more sense? edit: I did at one point figure out by reading the tests that the expected syntax for this is |
thanks for the library. i had my homegrown thing which wasn't half as powerful.
there's a bug when using alt names:
So in
~m{a}
the key will be a string and in~m{a: 1}
the key will be an atom.The text was updated successfully, but these errors were encountered: