summaryrefslogtreecommitdiff
path: root/src/clj
diff options
context:
space:
mode:
authorChristophe Grand <christophe@cgrand.net>2009-08-05 11:50:05 +0200
committerRich Hickey <richhickey@gmail.com>2009-08-05 11:05:15 -0400
commit11bbfdfdb500156afd9ebb36bf452bcb96b3708d (patch)
tree20fe15a33ea66c5ca48d50dbce806a62dcccddfa /src/clj
parent99f0929bd26fdeecb65cde860a88d3cf2974e359 (diff)
First cut at TransientHashMap
Signed-off-by: Rich Hickey <richhickey@gmail.com>
Diffstat (limited to 'src/clj')
-rw-r--r--src/clj/clojure/core.clj9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj
index a275236d..3974204e 100644
--- a/src/clj/clojure/core.clj
+++ b/src/clj/clojure/core.clj
@@ -4348,6 +4348,15 @@
(recur ret (first kvs) (second kvs) (nnext kvs))
ret))))
+(defn dissoc!
+ "Returns a transient map that doesn't contain a mapping for key(s)."
+ ([#^clojure.lang.ITransientMap map key] (.without map key))
+ ([#^clojure.lang.ITransientMap map key & ks]
+ (let [ret (.without map key)]
+ (if ks
+ (recur ret (first ks) (next ks))
+ ret))))
+
(defn pop!
"Removes the last item from a transient vector. If
the collection is empty, throws an exception. Returns coll"