Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop execution of function in Clojure without exiting REPL?

Is it possible in a Clojure REPL to stop the execution of a function without terminating the REPL session? How can I do this?

I'm using lein repl in bash, if it matters. I'm using Leiningen 1.7.1

like image 439
Eric Wilson Avatar asked Feb 11 '13 14:02

Eric Wilson


People also ask

How do you stop an execution in REPL?

There is no way to stop execution. On those versions CTRL-C will lead to termination of the whole scala REPL. The change was introduced with Scala 2.9.

How do I get out of Clojure REPL?

You can exit the REPL by typing Ctrl+D (pressing the Ctrl and D keys at the same time).

What is Clojure REPL?

What is a REPL? A Clojure REPL (standing for Read-Eval-Print Loop) is a programming environment which enables the programmer to interact with a running Clojure program and modify it, by evaluating one code expression at a time.


1 Answers

Have you tried just Ctrl-C ? It should work in your case.

Update. I've downgraded to Leiningen version 1.7.1. And it really quits repl by Ctrl-C. You should upgrade lein as Bozhidar Batsov said.

like image 74
mobyte Avatar answered Jun 13 '23 14:06

mobyte