--
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.
For more options, visit https://groups.google.com/groups/opt_out.
That said, it is very likely usage of the Keyword module will soon have to be replaced by Dict. Today, all the functionality is there, so it is kind of a direct replacement.
--
I thought the idea in the Map proposal was to introduce new Erlang Map-specific syntax, which would be more efficient and also allow being used in patterns. If so, it would require adding some equivalent new Map-specific syntax in Elixir as well, which would not be dependent on the Dict interface.
I thought the idea in the Map proposal was to introduce new Erlang Map-specific syntax, which would be more efficient and also allow being used in patterns. If so, it would require adding some equivalent new Map-specific syntax in Elixir as well, which would not be dependent on the Dict interface.Yes, this is also going to happen. We can only know exactly how though after the Erlang proposal stabilizes.
So, does this mean that the Keyword module is definitely going away, no matter what?
So, does this mean that the Keyword module is definitely going away, no matter what?
It is very likely unless they drastically change the current Maps EEP.
--
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.
For more options, visit https://groups.google.com/groups/opt_out.
--
So it will still work. The only difference is that to interact with it, we will use the Dict module instead of the Keyword module. In terms of source code, a s/Keyword/Dict replacement in the code base is all required to get up to date.
--
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.
For more options, visit https://groups.google.com/groups/opt_out.
Will you be adding get_values/2 to Dict?
which is arguably a more intuitive approach for this task.BTW, with new maps you will be able to write (syntax notwithstanding)
People.sort_by "name": :asc, "state": :desc, "age": :asc
How about renaming keyword to multimap, then? removing the restriction that the key must be an atom and adding get_values/2. It could be an implementation of multidict :-)
How about renaming keyword to multimap, then? removing the restriction that the key must be an atom and adding get_values/2. It could be an implementation of multidict :-)
--
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.
For more options, visit https://groups.google.com/groups/opt_out.
If we can come up with legitimate use-cases for the above functions that are common in Elixir code, we should probably keep Keyword but not advertise it as a Dict. It is already special and it's better keep it that way.
And no, I don't think Elixir needs builtin support for multimaps.
--
--
This would be suboptimal. Knowing that keyword lists are lists of tuples actually makes them more flexible. You can use functions from Enum to iterate them seemlessly, you can use some functions from List too.
List.Dict actually supports repeating keys:
Now this, I think, is broken. While it's convenient to create "dicts" with the short keyword syntax, I would much rather prefer List.Dict support only orddicts.
Hello everyone!The Erlang community has for long been hinting at having a native Maps/Dict/Hash implementation in the language and a proposal has been written from the OTP Team at Ericsson about it. I recommend everyone to take a look at it:https://github.com/psyeugenic/eep/blob/egil/maps/eeps/eep-0043.mdWhile there is still a lot of room open for discussion, this announcement is important because it settles down many things we have left open in Elixir. I will outline some broad strokes to see if everyone is agreement.1) The current keywords syntax is not going anywhere. if(this, do: that) will still be a direct translation too: if(this, [{:do,that}])A lot of Elixir and Erlang libraries will still expect a list of tuples and we are not going away from it.2) The Keyword module (not the syntax) will be fully replaced by Dict. Why?The reason we have kept Keyword around is because we didn't know if the Maps proposal was going to support only atoms as keys (as the Keyword module) or any other data structure. If the Erlang team had decided for an Atom-only key approach, the Keyword module would be able to encompass our current solution and the new approach. However, since the Erlang team is settled on supporting any data type, it means the Keyword module becomes unnecessary.
That said, it is very likely usage of the Keyword module will soon have to be replaced by Dict. Today, all the functionality is there, so it is kind of a direct replacement.
3) I still haven't thought about which syntax Maps are going to have in Elixir. My main concern right now is that the language will have enough room to support maps as a first class citizen and I think we are well covered. :)Keep in mind that there is no need to go ahead and change your codebases yet. I just want to clear that those changes may happen soon and I will keep everyone updated on the topic as we have more news from the OTP team.
Feedback is welcome!