I can walk the top-level of the following map using walk
in Clojure:
(use 'clojure.walk)
(walk (fn [[k v]] (println (type k) k v)) identity {:a 1 :b {:c 3}})
Result:
clojure.lang.Keyword :b {:c 3}
clojure.lang.Keyword :a 1
{}
(This works in a very similar way to map
)
But when I use postwalk
- it blows up trying to do destructuring:
(postwalk (fn [[k v]] (println (type k) k v)) {:a 1 :b {:c 3}})
Result:
UnsupportedOperationException nth not supported on this type: Keyword clojure.lang.RT.nthFrom (RT.java:857)