how to run clojure files in Eclipse

106 views
Skip to first unread message

Shiplu Mokaddim

unread,
Jun 29, 2012, 12:19:25 PM6/29/12
to clojured...@googlegroups.com
Hello,

I have installed clojure plugins in eclipse so that I can start developing apps on clojure.  I am currently in the learning phase. I need to know how can i run a clojure file with a Keyboard shortcut or a single mouse button click in eclipse.

Currently I am running this way,

  1. I press Ctrl+F11, It launches the REPL
  2. Then in the REPL I call the function name. For example (hello "world"). I have to type it in literaly in the REPL
What I am looking for. 

  1. I want to press a short cut key 
  2. The output after evaluating the current file should be displayed
How can I achieve this?

Nick Klauer

unread,
Jun 29, 2012, 11:03:27 PM6/29/12
to clojured...@googlegroups.com
 On my Mac, it's Cmd+Enter.


Note the output of the expression that the cursor is under (= 1 3) is evaluated in the REPL below.

shiplu

unread,
Jun 30, 2012, 2:57:48 AM6/30/12
to clojured...@googlegroups.com
On Sat, Jun 30, 2012 at 9:03 AM, Nick Klauer <Kla...@gmail.com> wrote:
 On my Mac, it's Cmd+Enter.

Thanks Nick. I figured it out later. Its Ctrl+Alt+S. If I press these buttons the current file is evaluated in REPL and the output is shown. All in a single shot. Thats what I wanted.
 
--
Shiplu.Mokadd.im
ImgSign.com | A dynamic signature machine

Innovation distinguishes between follower and leader

Nick Klauer

unread,
Jun 30, 2012, 12:10:03 PM6/30/12
to clojured...@googlegroups.com
Excellent.  FWIW, I wasn't aware that you could execute single expressions in the REPL, so I found a new shortcut to use, too. :)

-Nick

shiplu

unread,
Jun 30, 2012, 12:30:32 PM6/30/12
to clojured...@googlegroups.com
On Sat, Jun 30, 2012 at 10:10 PM, Nick Klauer <Kla...@gmail.com> wrote:
Excellent.  FWIW, I wasn't aware that you could execute single expressions in the REPL, so I found a new shortcut to use, too. :)


At the learning phase of clojure this technique is very much helpful. I tried other editor too. But didn't found it. May jEdit, Clooj have these functionality but It took some time and I couldn't wait any longer. Switched to eclipse and i found this quite faster than those editors.

Softaddicts

unread,
Jun 30, 2012, 2:33:33 PM6/30/12
to clojured...@googlegroups.com
Just make sure you are in the good namespace (<ctrl><alt>n) when you
reevaluate a selection, you may end up being confused a bit otherwise :)

Luc
> --
> You received this message because you are subscribed to the Google Groups "counterclockwise-users" group.
> To view this discussion on the web visit https://groups.

google.com/d/msg/clojuredev-users/-/Iu5aLem52AoJ.
> To post to this group, send email to clojured...@googlegroups.com.
> To unsubscribe from this group, send email to clojuredev-use...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/clojuredev-users?hl=en.
>
>
--
Softaddicts<lprefo...@softaddicts.ca> sent by ibisMail from my ipad!

Laurent PETIT

unread,
Jun 30, 2012, 4:04:45 PM6/30/12
to clojured...@googlegroups.com
Hello,

Le 30 juin 2012 à 20:33, Softaddicts <lprefo...@softaddicts.ca> a écrit :

> Just make sure you are in the good namespace (<ctrl><alt>n) when you
> reevaluate a selection, you may end up being confused a bit otherwise :)

Really, it's been a while since this should just work: evaluating a
selection changes temporarily the namespace (just for the evaluation).

If this does not work for you in some context, feel free to open a bug.

Softaddicts

unread,
Jun 30, 2012, 6:09:01 PM6/30/12
to clojured...@googlegroups.com
I will have to retest, pretty sure I got trapped a few days ago, I was redefining
a function repeatedly (adding a trace) without effect until I explicitly changed the name space.

I'll recheck tonight and see if it's a code 13 issue or a real problem.
Since this hapened, I systematically change to the proper name space.
I'll switch that behaviour off and see if it happens again.

Luc

Softaddicts

unread,
Jul 6, 2012, 12:12:55 PM7/6/12
to clojured...@googlegroups.com
Hi,

Turned off this habit and so far. <ctrl> enter works as expected.

I think I got abused by the lack of feedback in the repl when a namespace does not
load following a compilation error or runtime load problem.

I have to double check the console view to make sure the load/reload went on smoothly. Is there a way to get in the repl window a consistant indicator that a
reload or load failed ? Of course, there is already a feedback when the load
completes successfully (in green) but not much when it failed.

I found myself being fooled by this, not switching to the console window
and keeping hammerng stuff in the repl in vain.

Even on my 22 inch screen, it's not obvious to place windows so I can have
my "third" eye monitoring the console output while gazing at the repl output
and the code I am messing with.
My eye sight maybe on the downhill, is there a visual cue that I am missing ?
Or do I need a larger screen ? :) What size ? > 30 inches ?

Luc

> I will have to retest, pretty sure I got trapped a few days ago, I was redefining
> a function repeatedly (adding a trace) without effect until I explicitly changed the name space.
> > I'll recheck tonight and see if it's a code 13 issue or a real problem.
> Since this hapened, I systematically change to the proper name space.
> I'll switch that behaviour off and see if it happens again.
> > Luc
> > > > Hello,

Laurent PETIT

unread,
Jul 6, 2012, 12:28:34 PM7/6/12
to clojured...@googlegroups.com
There should indeed be a feedback.

Can you please file an issue ?

Rhx,

Laurenr
Reply all
Reply to author
Forward
0 new messages