This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-16
Channels
- # ai (5)
- # announcements (47)
- # aws (11)
- # babashka (20)
- # beginners (85)
- # biff (1)
- # calva (72)
- # cider (9)
- # clj-kondo (37)
- # cljfx (9)
- # cljs-dev (1)
- # clojars (2)
- # clojure (61)
- # clojure-berlin (2)
- # clojure-europe (189)
- # clojure-nl (1)
- # clojure-norway (17)
- # clojure-uk (2)
- # clojurescript (51)
- # conjure (3)
- # cursive (4)
- # data-science (6)
- # datomic (6)
- # events (5)
- # fulcro (16)
- # gratitude (9)
- # holy-lambda (9)
- # introduce-yourself (6)
- # lsp (13)
- # malli (8)
- # membrane (2)
- # off-topic (47)
- # pedestal (11)
- # re-frame (15)
- # reitit (1)
- # releases (2)
- # rewrite-clj (6)
- # rum (4)
- # shadow-cljs (2)
- # tools-deps (3)
- # xtdb (25)
- # yada (13)
hi everybody! I'm trying to use rewrite-clj to rewrite my lib (ns ...) forms in a build step before creating my jar. It was pretty easy until I found (ns ...) forms with conditionals, which are parsed as (read-string "..."). What is the best way of renaming namespaces in :requires and :imports that also works with conditionals? The use case is that I need to duplicate namespaces to enable a debugger I'm writing to be able to instrument itself.
Welcome @jpmonettas!
thanks!
https://github.com/benedekfazekas/mranderson does this kind of thing but for different reasons. It uses rewrite-clj to move namespaces. Can’t remember if it deals with reader conditionals.
yeah I know about MrAnderson but I don't think it works for my case. But now you mention it I could take a look and try to see if I can steal some ideas from it in case it works with conditionals
But… clj-kondo also uses a version of rewrite-clj internally https://github.com/clj-kondo/clj-kondo/tree/master/analysis. I’ve been thinking of using it for MrAnderson to quickly local namespaces and their uses. The thing I’m not sure about yet is the import references.