Thanks, that inspired me to look around. I didn't figure out how to hijack
the defrecord macro, but I was able to write something based upon the code
there:
(def reader-map
(let [records (filter #(re-find #"^map-" (str (key %)))
(ns-publics *ns*))
splat (fn [pai
Instead of trying to do it that way, how about just a thin layer of macrology
around defrecord? Within the def-record-reader firm you have access to all the
info you need for each reader, without extensive code-walking etc
--
--
You received this message because you are subscribed to the Goog
I use a default reader to do something like what you're asking for in my
'tagged' library. You could hack a similar default reader that restricted
itself just to your favorite namespaces. That way you don't have to
explicitly track all your defrecord classes.
https://github.com/miner/tagged
I'm trying to come up with a function that will take a namespace containing
Record definitions and convert it into a :readers map for EDN parsing.
Right now, I'm just doing it manually, but as the number of records grows,
this feels sillier and sillier. I haven't found anything in the core
libr