How can I get the nested keys of a map in clojure?

后端 未结 11 1159
梦如初夏
梦如初夏 2020-12-15 10:59

if my structure is

{ :a :A
  :b :B
  :c {
       :d :D
     }
  :e {
       :f {
            :g :G
            :h :H
          }
     }
}

I

11条回答
  •  甜味超标
    2020-12-15 11:20

    Here is a generic solution for known collection types, including maps (look for "Key Paths" on the Readme page for usage examples).

    It handles mixed types as well (sequential types, maps and sets), and the API (protocols) can be extended to other types.

提交回复
热议问题