Fork me on GitHub
#calva
<
2019-08-26
>
Sasho15:08:08

Hello 🙂 While I’m in a file, how can I switch to another namespace and evaluate forms in this namespace. I tried this: 1. Start a repl. 2. Connect Calva to a running repl. 3. Evaluate a given file with some custom namespace. 4. Now, if I’m in the file and evaluate the form (println *ns*), in the output, I see that the current namespace is the one of the file. 5. How can I switch to the user namespace? I tried evaluating (in-ns 'user) and (ns user), but after both, when I again printed the current namespace, it was still the old value.

pez15:08:23

Calva is pretty insisting on evaluating the code in the file in the namespace of the file (and also has this idea that the first ns form determines the namespace).

Sasho17:08:41

Ah, thank you, Peter!

pez15:08:19

You might get away with rebinding *ns*

Daniel Hines18:08:20

Does anyone have any example repos of Calva+Shadow+NodeJS?

pez18:08:13

There is Calva. 😀

Daniel Hines18:08:34

I'll give it a shot! The instructions look good in the "How to Contribute" doc

pez18:08:22

Cool! We should move more code to the cljs side just because it's so fun.

gerred19:08:34

@pez That build is working great for me 👍

gerred19:08:30

my only aside there is main opts might be something I would want, but like I said, the constraints there are difficult enough to get right IMO that maybe another workaround (direct REBL integration?) is a better option.

pez20:08:25

We can always add dealing with main opts later. However, @slack1038 and I are working with a bigger take on jack-in customization, and I think that might mean we have some new settings cooking where these custom aliases would fit. So we need to discuss that a bit, to avoid introducing settings we need to deprecate quickly.

pez20:08:22

I am not a fan of holding back features waiting for vaporware, but here at least you already have that build, and we will hopefully be ready to send out some test builds of this new jack-in feature soon.

🎉 8