当函数 clojure.walk/keywordize-keys 和 stringify-keys 被调用时,它们不尊重 Records。在数据结构上调用它们时,数据结构中的任何 Records 将被转换为普通 maps。
例如,
user> (defrecord X [a])
user.X
user> (assoc (X. 1) "thing" 2)
#user.X{:a 1, "thing" 2}
user> (clojure.walk/keywordize-keys (assoc (X. 1) "thing" 2))
{:a 1, :thing 2}
user> (type (clojure.walk/keywordize-keys (assoc (X. 1) "thing" 2)))
clojure.lang.PersistentArrayMap