Welcome! Please see the About page for a little more info on how this works.

0 votes
ago in Clojure by
(def m (java.util.HashMap. {:a 1 :b 2}))

(def select-a (selector {:keys [a] :select s}))
(def excess-a (selector {:keys [a] :excess e}))

(select-a m)
;; => {:a 1}

(excess-a m)
;; => ClassCastException: class java.util.HashMap cannot be cast to class clojure.lang.IPersistentMap
;; Expected `{:b 2}`.

Reproduced on Clojure 1.13.0-alpha10.

Please log in or register to answer this question.

...