Skip to content
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

Discussion regarding Keywords being part of the Dict protocol #274

Closed
josevalim opened this issue Apr 29, 2012 · 0 comments
Closed

Discussion regarding Keywords being part of the Dict protocol #274

josevalim opened this issue Apr 29, 2012 · 0 comments

Comments

@josevalim
Copy link
Member

Today, Elixir has Keywords lists and a Keyword module that behaves as a Dict, but it is not really a Dict since it can contain duplicated entries and the keys are limited to be atoms.

Even though, should Keywords be part of the Dict protocol? My feeling right now is no since I still haven't written any code where one would accept both keywords or dictionaries as argument. They seem to have distinct use cases. For example, keywords are usually written by the developer. Dicts instead are used when parsing external data or storing internal information in a more efficient way.

I don't expect a conclusion to this discussion now, but at least we can leave it documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant