_Comment made by: ragge_
The current patch for CLJ-1778 does not address this issue.
The idea seems sound to me, if we're map destructuring a value that's
already a map (as determined by {{map?}}), we don't need to create a
new one by calling {{seq}} and {{HashMap/create}}, unless there's a
really good reason it should be exactly that map implementation (I
don't see one).
I don't think the current patch is OK though as it makes an
(unneccessary) breaking change to the behaviour of map destructuring.
Previously, destructuring a non-seqable value returned nil, but with
patch, {{seq}} is always called on value and for non-seqble types this
will instead throw an exception. It should be trivial to change the
patch to retain the original behaviour.
1.8.0-master:
user=> (let [{:keys [x]} (java.util.Date.)] x)
nil
with 0001-Enable-destructuring-of-seq-map-types.patch:
user=> (let [{:keys [x]} (java.util.Date.)] x)
IllegalArgumentException Don't know how to create ISeq from: java.util.Date clojure.lang.RT.seqFrom (RT.java:528)