Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Evaluation in Clojure REPL with CounterClockwise and Eclipse

I normally use Emacs but was inspired to try CCW + Eclipse again. I have a Clojure test project with a source file src/user.clj with the following contents:

(ns user)

(println "hi")

I have a REPL which I started with Window->Show View->Other->Clojure Views->REPL.

When I select the println expression (all of '(println "hi")') and hit Command-enter, the expression itself gets echoed in the REPL window, but no output occurs. Similar with expressions like '(take 10 (range))'.

If I type the expression in the REPL directly, and hit Enter, I get

=> (take 10 (range))

but there doesn't seem to be any additional output of the evaluation.

Thanks for any ideas. I looked over the docs but nothing obvious jumped out at me.

like image 511
JohnJ Avatar asked Jan 16 '23 15:01

JohnJ


1 Answers

You need to be connected to a REPL to get a response.

There are two options:

  • Connect to an existing REPL
  • Run your project as a Clojure application and automatically connect to it's REPL.

To connect to an existing REPL, you can use Window -> Connect to REPL.

To run your project, Right click your project; Run As -> Clojure Application. If that's not an option, Right Click -> Configure -> As Clojure Application

like image 56
deterb Avatar answered Jan 31 '23 00:01

deterb