rewrite-clj 2019-12-16

@witek has joined the channel

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?

@witek There is a very good talk by @plexus on the subject of zippers. I recommend watching it first

❤️ 1

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

@jfntn has joined the channel

@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

❤️ 1

@borkdude I went for zippers because I want to change symbols and write them back.