We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f75d47e commit 93c795fCopy full SHA for 93c795f
src/clj/clojure/core.clj
@@ -3932,7 +3932,7 @@
3932
(let [gmap (gensym "map__")
3933
defaults (:or b)]
3934
(loop [ret (-> bvec (conj gmap) (conj v)
3935
- (conj gmap) (conj `(if (seq? ~gmap) (apply hash-map ~gmap) ~gmap))
+ (conj gmap) (conj `(if (seq? ~gmap) (clojure.lang.PersistentHashMap/create ~gmap) ~gmap))
3936
((fn [ret]
3937
(if (:as b)
3938
(conj ret (:as b) gmap)
test/clojure/test_clojure/special.clj
@@ -22,3 +22,8 @@
22
; var
23
; fn
24
25
+(deftest multiple-keys-in-destructuring
26
+ (let [foo (fn [& {:keys [x]}] x)
27
+ bar (fn [& options] (apply foo :x :b options))]
28
+ (is (= (bar) :b))
29
+ (is (= (bar :x :a) :a))))
0 commit comments