Fork me on GitHub
#cursive
<
2017-01-08
>
paulspencerwilliams11:01:11

Hi. I might be mistaken, but I thought Cursive allowed 'Sending' arbitary commands from namespaces to the repl without loading the commands containing NS first? I create a new NS, type in (+ 1 2) and send it to the repl

paulspencerwilliams11:01:15

(+ 2 1)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: + in this context, compiling:(/Users/will/src/bookmenow/test/bookmenow/test/wat.clj:3:1) 

notanon18:01:26

@paulspencerwilliams when i switch my repl to another ns, i get a bug like that Paul , suddenly it cant find clojure.core stuff

notanon18:01:01

i've been working around by using lein's

:repl-options { :init-ns myns.core }
which will start the repl in myns.core

notanon18:01:19

not sure if that's your problem or not though paul

notanon18:01:35

there's a keymap you can set called "Send top form to REPL" that sends the top-most self-contained s-expression under your curse to the repl. I use this all the time. i believe the option for whether you evaluate in the repl's namespace or the namespace of where you sent the code from is an option under settings somewhere. i choose to evaluate in the ns the repl is already in.

notanon18:01:55

I replicated my issue, not sure if it's exactly the one you're having Paul.

Starting nREPL server...
C:\dev\jdk\bin\java -Dfile.encoding=Cp1252 -XX:-OmitStackTraceInFastThrow ...
Connecting to local nREPL server...
Clojure 1.9.0-alpha14
nREPL server started on port 49659 on host 127.0.0.1 - 
*ns*
=> #object[clojure.lang.Namespace 0x4a3b4ff5 "c4e.datomic"]
(+ 1 1 1)
=> 3
(in-ns 'c4e.core)
=> #object[clojure.lang.Namespace 0x43d49221 "c4e.core"]
(+ 1 1 1)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: + in this context, compiling:(C:\Users\notanon\AppData\Local\Temp\form-init4674551064871749428.clj:1:1) 

notanon18:01:27

You can see that I can find +, then i switch ns suddenly I can't find the symbol + any longer. This doesn't happen between every ns switch, for this project it seems to be my core ns that is the issue. In other projects I couldn't switch to anything else without the issue.

notanon19:01:34

i probably should have reported this a couple months ago when i noticed it 😞 sorry

notanon19:01:35

i never really had a problem using :repl-options { :init-ns myns.core } in my project.clj to just start in the ns i wanted, but i'm sure not everyone is happy with that arrangement