I am trying to call clojure.walk/stringify-keyson a map which may include instances of records. Since stringify-keys is recursive, it tries to convert the keys to my record (since (map? record-var)is true), which causes an error. Is there a way to find out if var is a record, not just a Clojure card? i d would like to provide my own implementation stringify-keysthat recognizes records.
The current implementation stringify-keyscalls the following:
(use '[clojure.walk :only [stringify-keys]])
(defrecord Rec [x])
(let [record (Rec. "foo")
params {:x "x" :rec record}]
(stringify-keys params))
This throws the following exception: UnsupportedOperationException Unable to create an empty: user.Rec user.Rec (NO_SOURCE_FILE: 1)
source
share