Closed andrejsm closed 7 years ago
Ahh, never mind, found support for modifiers already exists https://hexdocs.pm/shorter_maps/ShorterMaps.html#sigil_M/2-modifiers. Readme on Github does not list support for modifiers, though.
Thanks for the careful look; the omission in the README documentation is worth fixing.
Out of curiosity, do you commonly use ~W
in some places, and intentionally use ~w
in others? If so, what use case causes you to differentiate?
I use lower case ~w
only, but never had to use interpolation, though.
Did some grepping and found out that mostly I've used ~w
with get_in/2
:
foo = get_in(bar, ~w(foo bar baz))
With this avoiding to write ["foo", "bar", "baz"]
.
Have you considered to use modifiers instead of having lower and upper case sigils? Like Elixir's Sigil_W for example. ShorterMaps could have
a
ands
. Wherea
stands for atoms (default) ands
for strings.Like this:
I'm suggesting this as most of Elixir's sigils, except Sigil_D, Sigil_T and Sigil_N, have lower case sigil to output interpolated and escaped characters.