Fork me on GitHub

I'd like to use MAP-VALS but ignore one specific key in the passed in map


how would I do this?

Chris O’Donnell14:07:48

@luxbock: If you don't need to rebuild, you could do (view #(dissoc % :key))

Chris O’Donnell14:07:22

You could also define your own navigator to do it, which shouldn't be too hard


I do need the key present in the returned result


Yeah I was wondering if there had been an easy way to do it with the builtins


I think rather than building a navigator for this specific use case I would rather just wrap the whole thing with dissoc and assoc

Chris O’Donnell14:07:29

(transform [ALL #(not= :a (first %)) LAST] inc {:a 0 :b 1 :c 2})

Chris O’Donnell14:07:56

@luxbock: definitely not as efficient as using assoc and dissoc, but it does work


Yeah, thanks, I think I'll end up doing it manually because this function gets called a ton