I would like to be able to create inserts in the data structure of the tree (for example, someone who makes comments on Disqus, Hacker News, etc.). And it would be nice to do it in a smart functional way.
Example
(def cmts [{:name "Abi" :id 1 :text "Great question" :children nil} {:name "Bib" :id 2 :text "What about zippers?" :children [{:name "Linus" :id 3 :text "I don't understand how to and insert children at a certain id with them" :children nil}]}])
The problem is how to insert a comment like this
(add-comment cmts :name "Iba" :text "I think so too!" :in-reply-to 1)
in some concise / elegant way.
Or: what would be easier to solve the problem?
source share