This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-12-23
Channels
- # adventofcode (4)
- # beginners (25)
- # biff (11)
- # clojure (2)
- # clojure-bay-area (1)
- # clojure-europe (5)
- # clojure-norway (2)
- # clojuredesign-podcast (4)
- # datalevin (2)
- # dev-tooling (34)
- # hyperfiddle (2)
- # missionary (5)
- # off-topic (3)
- # polylith (4)
- # rewrite-clj (13)
- # shadow-cljs (11)
- # tools-deps (1)
- # vim (1)
- # xtdb (5)
Hello everyone! I've been playing around with rewrite-clj a little and I noticed that nodes have a :seq-fn
property but I haven't seen any documentation on what it is. What is it?
What it is for, I’ve touched it a few times but have to look at the code to remember exactly… will do when I’m at the computer
> Internal implementation detail, not part of the public API. Hm, I understand. I’m trying to serialize the AST but in a way that allows reconstructing the source from the deserialized AST. This does not sound good though.
you can serialize the AST simply by calling str
, this will give you back the source code
Hm, I want to put the AST into a database and do queries on it. This would work well for very simple cases but if I‘m reading, say, an entire codebase, that won‘t help a lot.
Maybe for the database postwalk the AST and convert it to a more query-able structure?
For example, show me all the times a function was called or when this atom was mutated.
maybe the clj-kondo analysis will be more amenable to querying? https://github.com/clj-kondo/clj-kondo/blob/master/analysis/README.md