This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-20
Channels
- # announcements (1)
- # babashka (74)
- # beginners (84)
- # bristol-clojurians (3)
- # cider (2)
- # clara (14)
- # cljdoc (18)
- # cljsrn (7)
- # clojure (29)
- # clojure-australia (4)
- # clojure-europe (34)
- # clojure-italy (3)
- # clojure-nl (5)
- # clojure-seattle (1)
- # clojure-uk (33)
- # clojuredesign-podcast (2)
- # clojurescript (33)
- # code-reviews (17)
- # core-async (10)
- # cursive (8)
- # datomic (21)
- # depstar (45)
- # dirac (4)
- # duct (10)
- # emacs (1)
- # fulcro (8)
- # jackdaw (2)
- # jobs (1)
- # kaocha (11)
- # leiningen (2)
- # off-topic (8)
- # pathom (35)
- # pedestal (3)
- # protorepl (13)
- # rdf (39)
- # re-frame (23)
- # reagent (2)
- # releases (1)
- # remote-jobs (6)
- # reveal (2)
- # rewrite-clj (18)
- # shadow-cljs (51)
- # sim-testing (2)
- # spacemacs (2)
- # tools-deps (37)
thank you, i'm trying that out now
that got me on the right path, thank you
my next issue is trying to create a new map node and then insert values into it from the surrounding node
i have maps that have a :choices
key that is sometimes a list or vector, and I'd like to wrap it in a map. from :choices existing-list
to something like :choices {:buttons existing-list}
(n/map-node)
seems to work to create the node, but then I can't use z/assoc
to insert key value pairs
throws an "rewrite_clj.node.seq.SeqNode cannot be cast to clojure.lang.IFn"
error
any suggestions?
@nbtheduke Sometimes I find it easier to just use the raw nodes instead of zippers, so I grab the :children
and manually rewrite them and assoc them back in
huh, okay. i'll see if i can figure out how to do that. thanks
@nbtheduke This is the primary approach when writing clj-kondo hooks: https://github.com/borkdude/clj-kondo/blob/master/doc/hooks.md
ha there isn't a lot of documentation, so i've just been poring over the generated docs and trying things out. my code looks wack, so this is all great info
@nbtheduke if it helps, here's also a lib I made for rewriting config files: https://github.com/borkdude/rewrite-edn
but it should make things easier than working directly with rewrite-clj if you only need to assoc or update-in etc
nice! did you implement maintaining whitespace as well? your examples look like it
that's very cool