practicalli / practicalli/clojure
Updating only existing keys in a map
Nobody has claimed this yet.
- Dominant language
- Makefile
- Stars
- 117
- Forks
- 36
- PR merge metrics
- No merged PRs in 30d
Description
Does anything already exist to do the following, basically doing update but ignoring ops on non-existant keys
(defn update-existing
[m k f & args]
(if (contains? m k)
(apply update m k f args)
m))
3 replies
a function that does this is in medley
https://github.com/weavejester/medley/blob/master/src/medley
and in Void, more tightly focused on map manipulation: https://github.com/dvlopt/void.cljc
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the proposed update-existing function in the issue and compare the linked medley and Void implementations. Then inspect the repository for an existing map-manipulation entry point; done means determining whether this project should add or document such a function, with any needed tests identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100