Fork me on GitHub
#cider
<
2019-05-23
>
brandon14904:05:48

hi, I'm just getting started with clojure/cider, and I'm having a weird problem that I don't know how to solve

brandon14904:05:11

Whenever I switch to a new namespace, I don't have any functions defined. I can't even run (+ 1 1)

brandon14904:05:33

I get an error reading

Syntax error compiling at (invyte:localhost:32961(clj)*:49:19).
Unable to resolve symbol: + in this context

brandon14904:05:58

but works fine if I run (clojure.core/+ 1 1)

dominicm06:05:32

@brandon149 how are you switching namespace?

dotemacs09:05:12

Seeing that GitHub is now starting to offer sponsorship feature for developers, where 100% of donations go to the developer, it might be an interesting feature for CIDER donations: https://github.com/sponsors

jr0cket11:05:19

@bozhidar There is a waitlist for https://github.com/sponsors so suggest getting yourself added soon. It looks very promising. I've signed up and also nominated you as someone to sponsor.

mgrbyte09:05:09

@dominicm This happens for me too using (in-ns 'some-ns), is there a way to do that w/out loosing clojure.core & clojure.repl? (the not having any vars defined when switch ns @brandon149 mentioned)

dominicm09:05:11

@mgrbyte if you in-ns to a namespace that doesn't exist, that will happen. You need to require or create-ns

mgrbyte09:05:58

the ns exists, and I can see symbols from the one I switch to, but clojure.core + .repl vars do not.

dominicm09:05:52

The .repl ones do not, but the core ones should

bozhidar09:05:32

If a namespace was loaded before switching to it everything will behave formally. The REPL utils are auto-required in user, but not in other namespaces.

mgrbyte09:05:34

.core don't either for me 🤔

mgrbyte09:05:54

ah, require'ing first works

borkdude09:05:25

@bozhidar Github now supports creating a “sponsor” button: go to settings and then Sponsorships

borkdude09:05:34

@bozhidar it might be a nice idea for CIDER.

mgrbyte09:05:45

going to look at how that autoloading of REPL utils works, because I want that for all namesapces that I use in the REPL.

borkdude09:05:05

I’ve also experimented with this for clj-kondo, just to see how it works. I’ve setup an opencollective account, but I’m not sure how that works. you can only get money out of that if you have expenses like travel?

bozhidar09:05:20

> going to look at how that autoloading of REPL utils works, because I want that for all namesapces that I use in the REPL.

bozhidar09:05:38

It’s called cider-repl-require-repl-utils.

bozhidar09:05:14

Frankly, I don’t think that’s very useful in CIDER because it has its own replacements of every function there and I never use it for anything. But I assume not everyone knows this. 🙂

bozhidar09:05:51

E.g. I don’t get why you’d need something like doc, apropos and source.

bozhidar09:05:09

> I’ve also experimented with this for clj-kondo, just to see how it works. I’ve setup an opencollective account, but I’m not sure how that works. you can only get money out of that if you have expenses like travel?

bozhidar09:05:26

You can submit whatever expenses (e.g. invoices for development work you’ve done).

bozhidar09:05:45

In the end you approve your own expenses if you’re the only person in the collective. 🙂

bozhidar09:05:06

> @bozhidar Github now supports creating a “sponsor” button: go to settings and then Sponsorships

borkdude09:05:18

that seems nice 😉

bozhidar09:05:28

I’ll check it out! Thanks to you and @dotemacs for bringing this up!

mgrbyte09:05:53

> E.g. I don’t get why you’d need something like doc, apropos and source. Probably just because I've not learnt/remembered. Mostly I type (doc symbol) a lot, but as you say, C-d d (cider-doc) works without needing to require clojure.repl 👍 #must-teach-fingers (thanks btw!)

alexyakushev10:05:50

I've had issues several times when running multiple threads over a debug-compiled function.

alexyakushev10:05:12

The most annoying one is that sometimes after I'm out of the debugger (with either q or c), the REPL remains hung up. Apparently, some CountDownLatch didn't clear. In such cases, I had to restart the REPL.

alexyakushev10:05:54

Obviously, I'm not asking for adequate multi-threading debugging (I don't think anyone knows how that should look like). But is it possible to have a foolproof of some sorts that would allow only one thread enter the debugger at the same time?

bozhidar11:05:57

Thanks! I’m already on the waiting list.

bozhidar11:05:04

Let’s see how this is going to play out.

bozhidar11:05:26

> Obviously, I’m not asking for adequate multi-threading debugging (I don’t think anyone knows how that should look like). But is it possible to have a foolproof of some sorts that would allow only one thread enter the debugger at the same time?

bozhidar11:05:35

I’m afraid I barely remember this part of the code, but I assume we can figure something out. @vspinu and @malabarba are way more knowledgable there. We could certainly use more help with the debugger’s maintenance.

malabarba12:05:24

I think that's doable. Tbh, the nrepl side of the debugger is actually fully thread-functional. It keeps track of all the requests it's waiting for is a safe way. The part that gets confused is the emacs side. If you receive two input requests, the latest one override the first one and you loose the ability to reply to the previous one.

malabarba12:05:44

Preventing the nrepl from sending new requests once it's already waiting for one should be a small change.

bozhidar12:05:54

@malabarba Can you open some ticket with an overview of what needs to be done? I assume you won’t be able to fix this yourself, but with enough info we might be able to get someone else to tackle this.

malabarba12:05:03

Sure, I'll write something up.

cch122:05:15

I’m would like to understand the model behind jacking into both a clj and cljs repl… I’ve got a project using clojure-cli that has a figwheel-main cljs repl that I can start from the command line and a clojure repl that I can start from the command line. I cannot determine how to include the figwheel dependencies only on the cljs repl (using something like -Afig). To have it loaded in both repls is easy (in .dir-locals.el: (cider-clojure-cli-global-options . "-A:dev")) -but that smells. Is it possible to specify cli options that are only applied to the cljs repl?