summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2010-03-23 09:18:46 -0400
committerRich Hickey <richhickey@gmail.com>2010-03-23 09:18:46 -0400
commit29389970bcd41998359681d9a4a20ee391a1e07c (patch)
tree9461d211280ba931d7ae555452d62e375aa514f1
parent67864eb0d91867ff03b87d6874be28f1476d27df (diff)
added support for associative destrucuring for seqs by pouring them into a map first, thus supporting associative destruring of & args
-rw-r--r--src/clj/clojure/core.clj3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj
index 1f46b487..630f7a7b 100644
--- a/src/clj/clojure/core.clj
+++ b/src/clj/clojure/core.clj
@@ -3012,7 +3012,8 @@
(fn [bvec b v]
(let [gmap (or (:as b) (gensym "map__"))
defaults (:or b)]
- (loop [ret (-> bvec (conj gmap) (conj v))
+ (loop [ret (-> bvec (conj gmap) (conj v)
+ (conj gmap) (conj `(if (seq? ~gmap) (apply hash-map ~gmap) ~gmap)))
bes (reduce
(fn [bes entry]
(reduce #(assoc %1 %2 ((val entry) %2))