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

Add Keyword.delete/3 for deleting explicit values. #1981

Merged
merged 1 commit into from
Jan 9, 2014

Conversation

christhekeele
Copy link
Contributor

No description provided.

@josevalim
Copy link
Member

Should we also add it to Dict?

@christhekeele
Copy link
Contributor Author

I don't think so. This PR is kind of part of a general push I want to make for a more useful Keyword module.

My reasoning is a bit verbose and I might post it on the mailing list, but essentially:

  • Dicts create strong associations between values and references to them
  • Keywords create weak ones
  • Dicts shouldn't need by-value access: the key can and should stand in for the value
  • Keywords could be more useful with by-value functions: the key is not enough
  • Right now Keywords only have all-by-key or first-by-key
  • They're essentially second-class citizens as improper Dicts
  • By-value functions give them a use-case of their own
  • If you need Dict.delete/3, you're using Dict wrong
  • Fin

josevalim pushed a commit that referenced this pull request Jan 9, 2014
Add Keyword.delete/3 for deleting explicit values.
@josevalim josevalim merged commit 1b3cdbc into elixir-lang:master Jan 9, 2014
@josevalim
Copy link
Member

Agreed.

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

Successfully merging this pull request may close these issues.

None yet

2 participants