This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-24
Channels
- # announcements (30)
- # asami (9)
- # babashka (37)
- # beginners (120)
- # calva (26)
- # cider (3)
- # clara (9)
- # clj-commons (7)
- # clj-kondo (17)
- # cljsrn (2)
- # clojure (32)
- # clojure-europe (56)
- # clojure-nl (1)
- # clojure-norway (13)
- # clojure-uk (4)
- # clojurescript (34)
- # conjure (1)
- # copenhagen-clojurians (8)
- # core-async (21)
- # cursive (2)
- # datahike (2)
- # datascript (5)
- # events (4)
- # fulcro (32)
- # graalvm (10)
- # heroku (3)
- # introduce-yourself (1)
- # jobs (2)
- # lsp (3)
- # luminus (1)
- # malli (8)
- # meander (15)
- # minecraft (1)
- # nrepl (2)
- # off-topic (57)
- # pathom (2)
- # polylith (35)
- # reagent (6)
- # reitit (8)
- # releases (1)
- # rewrite-clj (7)
- # shadow-cljs (21)
- # timbre (4)
- # tools-build (1)
- # tools-deps (33)
- # vrac (8)
No problemo @yogthos, it is getting to be a rather lengthy doc. Lemme know if you happen to find anything confusing in docs and I’ll try to make things clearer.
a few more examples of doing different transforms could be handy, for example I needed to inject new require statements, and this is what I settled on
(defn append-requires [zloc requires ctx]
(let [zloc-ns (z/find-value zloc z/next 'ns)
zloc-require (z/up (z/find-value zloc-ns z/next :require))
updated-require (reduce
(fn [zloc child]
;;TODO formatting
(if (require-exists? (z/sexpr zloc) child)
zloc
(z/append-child zloc child)))
zloc-require
requires)]
(loop [z-loc updated-require]
(if-let [parent (z/up z-loc)]
(recur parent)
z-loc))))