Skip to content

Discussion regarding Keywords being part of the Dict protocol #274

@josevalim

Description

@josevalim

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions