Browse files

added support for associative destrucuring for seqs by pouring them i…

…nto a map first, thus supporting associative destruring of & args
  • Loading branch information...
1 parent 67864eb commit 29389970bcd41998359681d9a4a20ee391a1e07c @richhickey richhickey committed Mar 23, 2010
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/clj/clojure/core.clj
View
3 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))

0 comments on commit 2938997

Please sign in to comment.