https://clojureverse.org/t/building-a-tool-for-refactoring-renaming-namespaces-moving-functions/5216
Hello. I am new to rewrite-clj
and I have never used zippers before. I have loaded a clojure file with z/of-file
and I would like to extract a list of all symbols used in that file. Is a recursion with z/next
the right way to do it?
Also note that you don't necessarily need to use the zipper stuff. In clj-kondo I work with the raw nodes and don't touch the zippers at all.
but tl;dr, I think z/next
is indeed the thing you want
@witek i have written a simple external tool (graal native-image binary) that uses rewrite-clj* to modify clj* source. it is more a proof of concept than anything, but the repository also contains integration code for emacs, vscode, and atom. if you're interested in taking a look, it's at: https://github.com/sogaiu/adorn
@witek let us know how it goes. The @plexus video that @borkdude refers to is this one: https://lambdaisland.com/blog/2018-11-26-art-tree-shaping-clojure-zip
@borkdude I went for zippers because I want to change symbols and write them back.