Fork me on GitHub
#rewrite-clj
<
2022-09-17
>
lread00:09:25

You could try to do the work of analyzing ns forms yourself, but I think you might be able to reuse (or at least borrow from) something that exists.

jpmonettas00:09:53

yeah, I have some ideas, but not sure how to do it yet. Was super easy before the conditionals since I was just moving the zipper over the requires and imports and editing symbols

jpmonettas00:09:57

I'm not sure, but isn't something like (z/of-file some-file :clj) useful to have? where the zipper constructors accept a parameter so the built zipper walks as it was read in :clj or :cljs etc?

lread00:09:28

Yup. Like Alex suggested in the clojure channel, you could also eval. I think I took the approach for https://github.com/lread/test-doc-blocks a while back… but I’d probably look at clj-kondo data analysis first.

jpmonettas00:09:14

I'll take a look tomorrow at all those ideas, thanks!

jpmonettas00:09:03

and thanks for creating rewrite-clj, is super useful!

lread00:09:12

Here’s https://github.com/lread/test-doc-blocks/blob/main/src/lread/test_doc_blocks/impl/amalg_ns.clj. It’s a bit fuzzy in my brain now and not necessarily a good idea.

👍 1
lread00:09:49

Oh I am but a humble adoptive parent of rewrite-clj. It was created by rundis (rewrite-cljs) and xsc (rewrite-clj).

lread00:09:42

Check back here tomorrow, I expect others will chime in with their ideas.

jpmonettas00:09:56

will do, thanks again!

lread00:09:34

My pleasure!

lread03:09:51

@jpmonettas, it dawned on me to wonder how the flow-storm-debugger might be doing this sort of thing... https://github.com/jpmonettas/flow-storm-debugger... there I found you! simple_smile

jpmonettas16:09:47

haha yeah, I'm trying to bring back self instrumentation to it