--
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 elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/15178352-82f1-402a-a982-c7c6a24a71b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/64e65257-2ae3-4fc7-b171-0d4116ac9fb3%40googlegroups.com.
--
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 elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAA1-O0wZF80G%2BOdrCWTEBCP9DN0m4hSz3SHBqbqS4YRgK1p%3DFw%40mail.gmail.com.
--
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 elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/f12929ed-2326-4e4d-abeb-0263a3070764%40googlegroups.com.
yes it's often tedious to do `foo: foo` but I prefer clarity over conciseness in this case.
This is going to be a big deal for Phoenix. In our channels where we're matching against the message, we have lines like this pervasively:def handle_in(event, %{"chat" => chat, "question_id" => question_id, "data" => data, "attachment" => attachment, ...}, socket) do...def handle_in(event, %{chat, question_id, data, attachment, ...}, socket) do...It's the same model in controllers, like this:def delete_question(conn, %{"survey_id" => survey_id, "question_id" => question_id, ...}) dodef delete_question(conn, %{survey_id, question_id, ...}) do
I'm opposed to a special syntax in Elixir itself. Aside from the confusion around two different behaviors (as Jose pointed out), there's even a third semantic case for %{foo,bar,baz} and that's "the map contains the keys (no assignments)".
I'm in favor of the sigil approach, or something similar, in a library. First, make it possible for people to use the syntax and then make it easy to use (ie, language builtin) as we get feedback from the community.
Just my 2 cents.
--
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 elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4%2B3PRAUX6uhLYWghestj_3netH8Nqk5Yg44d-ED_0iEMA%40mail.gmail.com.
--
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 elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/b4d4cba2-fc62-46e4-9f11-849c6eb139bb%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/c83868a5-fa77-4a60-abff-a8c95ba30fa0%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-core" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-core/NoUo2gqQR3I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAM_eapjx_xvgM5kmYWBDScYDKciPDKyB_ztTrOuQhkJGzp307A%40mail.gmail.com.
--
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 elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/2c511518-6e20-4ea3-932d-e60723e1cd07%40googlegroups.com.
import ShortMaps my_map = %{foo: 1, bar: 2, baz: 3} ~m(foo bar baz)a = my_map foo #=> 1
import ShortMaps name = "Meg" # String keys by default (or with the 's' modifier) ~m(name) #=> %{"name" => "Meg"} # Atom keys with the 'a' modifier ~m(name)a #=> %{name: "Meg"}
iex(1)> import ShortMaps nil iex(2)> name = "Meg" "Meg" iex(3)> ~m(^name)a = %{name: "Meg"} %{name: "Meg"} iex(4)> ~m(^name)a = %{name: "Megan"} ** (MatchError) no match of right hand side value: %{name: "Megan"}