Say I have a nested structure in Clojure e.g.
(def res [:S [:AB [:A "a"] [:B "b"]]])
but with nested metadata on each/ any of the vectors.
e.g.
(defn meta-tree [t]
(if (sequential? t)
(cons (meta t) (map meta-tree (next t)))
t))
(meta-tree result)
;=> (#:instaparse.gll{:start-index 0, :end-index 2}
(#:instaparse.gll{:start-index 0, :end-index 2}
(#:instaparse.gll{:start-index 0, :end-index 1} "a")
(#:instaparse.gll{:start-index 1, :end-index 2} "b")))
How could I write that structure to transit so that all the nested metadata is preserved, and can be read the other side?