Fork me on GitHub
#protorepl
<
2019-11-14
>
lance achterhof21:11:46

I have a question about what I'm seeing with proto-repl. I'm very new to clojure, so I apologize for any incorrect terminology I may use. I have my environment set up like https://gist.github.com/jasongilman/d1f70507bed021b48625, and went to start working through clojure for the brave and true. I created the first clojure project, opened it in atom, then opened a repl, but none of the functions would work - they would autocomplete, but the output was an Unable to resolve symbol. I tried using the ctr-alt, o shortcut on the namespace, but that didn't fix the issue. However, if I use the ctr-alt-, n shortcut on it, it lists the functions, and then they execute successfully in the repl. Can anyone explain what's going on?

seancorfield21:11:32

@laachterhof The first thing I'll mention is that ProtoREPL is not being maintained these days and it is incompatible with the latest versions of some common Atom plugins, such as Ink -- so that will cause you problems in various ways.

seancorfield21:11:41

Second, Jason's "opinionated" guide sets three refresh-related options which can cause a lot of problems for folks just getting started with Clojure and ProtoREPL -- I strongly recommend unchecking "all the refresh check boxes".

seancorfield21:11:18

I stopped using ProtoREPL about a year ago and switched to Chlorine instead, which is very actively maintained, but it uses a Socket REPL rather than nREPL so you need to start your REPL in a slightly different way. I much prefer the Socket REPL because it is built into Clojure itself, and it doesn't require any dependencies or plugins -- and you can start up any Clojure process/application with a Socket REPL connected and thus use Atom to investigate (and update!) the live running process.

seancorfield21:11:06

Re-reading your sequence of operations more closely, I think if you do ctrl-alt-, f -- load file into REPL -- after opening the file, then the other stuff might work. Most of the operations assume you've eval'd the whole file in the running REPL -- that's how find definition and several other things work. That's true of nearly all Clojure tooling: you don't get a lot of functionality until your code has actually been compiled (which happens when it is read into the REPL process, either via load file or via evaluating form "send block to REPL").

seancorfield21:11:46

If you end up switching to Chlorine, there's a dedicated #chlorine channel for questions there.

lance achterhof21:11:33

Thanks for the responses - I was just pointed at proto-repl and that guide, and didn't realized its unmaintained. And I'm pretty sure you're correct about why I was seeing what I was seeing - I'd assumed opening the ns would have done whatever (eval in this case) to make everything available, but your load file suggestion worked, so I'm assuming when I was using the list shortcut it ended up doing that. I'll give chlorine a look - thanks again!

4