Skip to content

Instantly share code, notes, and snippets.

@xyhp915
Forked from shamsimam/core_util.clj
Created June 19, 2023 04:13
Show Gist options
  • Save xyhp915/3b34db732f58cf1effdc8fb4f16822cc to your computer and use it in GitHub Desktop.
Save xyhp915/3b34db732f58cf1effdc8fb4f16822cc to your computer and use it in GitHub Desktop.
deselect-keys: Complement to clojure.core.select-keys
(ns core-util
(:require [clojure.set :as set]))
(defn deselect-keys
"Returns a map containing only those entries in map whose key is not in ks"
[m ks]
(->> (set/difference (set (keys m)) (set ks))
(select-keys m)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment