Skip to content

Commit

Permalink
added support for associative destrucuring for seqs by pouring them i…
Browse files Browse the repository at this point in the history
…nto a map first, thus supporting associative destruring of & args
  • Loading branch information
richhickey committed Mar 23, 2010
1 parent 67864eb commit 2938997
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/clj/clojure/core.clj
Expand Up @@ -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))
Expand Down

0 comments on commit 2938997

Please sign in to comment.