if my structure is
{ :a :A
:b :B
:c {
:d :D
}
:e {
:f {
:g :G
:h :H
}
}
}
I
This answer of mine is just to illustrate how NOT to do it since it is still procedural.
(defn keys-in [data] (genkeys [] data))
(defn genkeys [parent data]
(let [mylist (transient [])]
(doseq [k (keys data)]
(do
(if ( = (class (k data)) clojure.lang.PersistentHashMap )
(#(reduce conj! %1 %2) mylist (genkeys (conj parent k ) (k data) ))
(conj! mylist (conj parent k ) )
)))
(persistent! mylist)))