This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-31
Channels
- # announcements (4)
- # aws (1)
- # babashka (52)
- # beginners (178)
- # boot (4)
- # cider (2)
- # clj-kondo (10)
- # cljs-dev (39)
- # clojure (744)
- # clojure-europe (12)
- # clojure-germany (6)
- # clojure-india (56)
- # clojure-italy (5)
- # clojure-nl (60)
- # clojure-spec (9)
- # clojure-sweden (14)
- # clojure-uk (36)
- # clojuredesign-podcast (6)
- # clojurescript (11)
- # community-development (5)
- # core-async (4)
- # data-science (6)
- # datomic (6)
- # emacs (7)
- # events (4)
- # exercism (33)
- # fulcro (11)
- # funimage (2)
- # graalvm (29)
- # java (1)
- # joker (3)
- # lambdaisland (15)
- # malli (2)
- # meander (55)
- # mid-cities-meetup (1)
- # nrepl (8)
- # observability (4)
- # off-topic (2)
- # pathom (5)
- # re-frame (31)
- # shadow-cljs (73)
- # spacemacs (18)
- # sql (27)
- # test-check (14)
- # testing (1)
- # tools-deps (5)
- # xtdb (13)
Hi! I want to create a UI that modifies Clojure functions. Basically in the UI there should be a text editor containing a specific function's (or defmethod) body. On save that function body should change in the selected project. Is NREPL the correct tool for this? I was thinking of having an NREPL start in the Clojure application, and the UI would communicate through that. Is that a viable option or would I have to use a different method?
I don't think NREPL can actually change the code in the file. But maybe it can help with finding function locations and such?
Well, you can do pretty much everything with a REPL, so while it’s main purpose is to eval code, there’s no limit to what that code can do. It’d be pretty easy to figure out where something is defined simply by checking it’s metadata.
Oh wow. I didn't even know function definitions have meta data. (well I should've, since I do use ^:private
quite a bit)
So if I were to attach to an NREPL in a specific project, I could check the metadata like you said
Well, this might answer my question on defmethods at least: https://stackoverflow.com/questions/52861401/dynamically-get-the-source-strings-of-clojure-multimethod-implementation