This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-05-09
Channels
- # announcements (23)
- # babashka (7)
- # beginners (69)
- # biff (5)
- # calva (12)
- # cider (10)
- # cljfx (9)
- # clojure (60)
- # clojure-austin (1)
- # clojure-europe (14)
- # clojure-korea (2)
- # clojure-losangeles (2)
- # clojure-madison (1)
- # clojure-nl (1)
- # clojure-norway (23)
- # clojure-uk (7)
- # clojuredesign-podcast (16)
- # clojurescript (40)
- # datomic (8)
- # gratitude (4)
- # mount (3)
- # nrepl (2)
- # off-topic (38)
- # pathom (3)
- # releases (1)
- # ring (8)
- # shadow-cljs (7)
Is there a command that will run my project (lein) and give me a repl into it as it's running? My -main doesn't return, so running it myself from a new repl doesn't seem to be an option. (This seems really basic but I'm also really new to this...)
Sound like what you are looking for is the command: Calva: Start a Project REPL and Connect (aka Jack-In). Not sure what to do when your -main
doesn’t return, but maybe connecting to the jack-in started repl, with something like lein repl :connect
in a terminal, and run -main
from there.
I've tried that, and it gives me the repl prompt, but doesn't run my -main
, and if I do that myself (-main)
, it doesn't return so I can't eval anything else (without quitting the app).
I kinda want to do a lein run
and then connect to that, but that doesn't seem to work either.
> if I do that myself (-main)
, it doesn’t return so I can’t eval anything else (without quitting the app).
That’s why I suggested doing that from a terminal.
Oh magic!!!
You can probably make lein run
work too, if you embed the repl in your app: https://nrepl.org/nrepl/1.1/usage/server.html#embedding-nrepl
That's true too. Is that essentially what's going on anyway, where the lein run :connect
is in its own thread?
Yes, it’s a matter of what you find most convenient. If you do it from the repl, you can bake it in as part of a https://calva.io/connect-sequences/. using the afterCLJReplJackInCode
setting there. Then you would only need to run the jack-in command and you would get the REPL connected and -`main` running.