I m trying to call clojure.walk/stringify-keys
on a map that might include record instances. Since stringify-keys is recursive, it attempts to convert the keys on my record, (since (map? record-var)
is true) which causes an error. Is there any way to tell if a var is a record rather than just a Clojure map? I
d like to provide my own implementation of stringify-keys
that is record-aware.
现有<条码>星号代码>的实施 原因如下:
(use [clojure.walk :only [stringify-keys]])
(defrecord Rec [x])
(let [record (Rec. "foo")
params {:x "x" :rec record}]
(stringify-keys params))
造成以下例外: 未支持的行动 例外 Can t 造成空洞:用户。 接收用户。 收入(单位:千美元)