nrepl

bozhidar 2023-04-13T07:08:02.441529Z

@pez It does this only for the initial namespace, which is usually user.

bozhidar 2023-04-13T07:08:47.561589Z

No one has complained, so I can only hope this works fine. 😄

pez 2023-04-13T07:14:23.918629Z

I think it could partly be because there is seldom much reason to use those utilities directly when in an environment like CIDER. To me, I seldom spend much time in the user namespace so having the utilities available only there wouldn’t bring me much joy. Anyway, I implemented the same default in Calva now. It could get weird with some namespaces to have it always happen. https://clojurians.slack.com/archives/CBE668G4R/p1681337488164959

bozhidar 2023-04-13T07:25:31.079329Z

Indeed. When add-lib is part of Clojure I guess CIDER and Calva will just provide wrappers for working with it, so I doubt many people will have to use it directly in the REPL.

Alex Miller (Clojure team) 2023-04-13T14:00:24.037329Z

one common style of working is to leave your interactive repl in user but eval from the editor most of the time - I do that in Cursive and Calva

Alex Miller (Clojure team) 2023-04-13T14:00:57.160659Z

Some people actually work entirely in user, but I'm not sure that's very common :)

pez 2023-04-13T14:01:30.857479Z

Your interactive repl being started outside Calva, I take it?

Alex Miller (Clojure team) 2023-04-13T14:05:04.892639Z

I use jack-in

pez 2023-04-13T14:12:54.680829Z

The interactive REPL is the output/repl window? I can’t make that stay in user as I evaluate things in various files. What am I missing here? 😃

Alex Miller (Clojure team) 2023-04-13T14:31:15.843459Z

maybe I use it so infrequently that I'm imagining it :)

😂 1
Alex Miller (Clojure team) 2023-04-13T14:31:33.685999Z

this is the peril of using multiple editors all the time

pez 2023-04-13T14:49:17.339689Z

So, essentially, Calva makes that workflow impossible, because of the convenience of helping you switch namespace. I wonder if we should fix that…

Alex Miller (Clojure team) 2023-04-13T15:07:32.926469Z

I'm not asking for anything :)

pez 2023-04-13T15:17:27.363409Z

Not saying you are. It is more that I just became aware of a workflow I have shut down. 😃 Not that I think Calva needs to support all workflows, and this one is supported if you start an interactive REPL in a terminal and connect to it. Jack-in is convenience, after all. But anyway, I prefer to take such decisions consciously.

cfleming 2023-04-13T22:32:18.655369Z

So if I understand correctly, when you eval in a REPL from an editor, does Calva switch the ns for that REPL before evaluating? Cursive binds *ns* dynamically for the scope of the eval, so only the single form sent from the editor is in that ns, and the REPL stays where the user left it.

pez 2023-04-13T22:40:57.712619Z

Yes. Calva switches the ns of the REPL. It has not always done this, but at some point that was what most people did manually anyway.

cfleming 2023-04-13T22:43:05.021529Z

FWIW I think dynamically binding is a really nice experience 🙂

pez 2023-04-13T22:54:46.991449Z

I think in Calva it mostly doesn’t matter. Users don’t fiddle around at the REPL prompt much. Once I get around to replace the prompt with a web view I think it’ll open up for other ways to make it clear in which ns something was evaluated and we can switch back to letting the prompt stay in whatever ns the user left it.

cfleming 2023-04-13T22:29:25.783299Z

I’m a bit late to this, but Cursive does require repl-requires if it exists.