Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you save your Clojure REPL's state (or, effectivelly, can you program complex programs using REPL?)

After defining variables, functions, etc., can you save what you have done on the REPL too an text .clj file?

like image 969
MaiaVictor Avatar asked Jun 25 '12 17:06

MaiaVictor


People also ask

Does Clojure have 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.

How does the Clojure REPL work?

So a ClojureScript REPL consists of two parts: the first part is written in Clojure, it handles the REPL UI, and takes care of compiling ClojureScript to JavaScript. This JavaScript code then gets handed over to the second part, the JavaScript environment, which evaluates the code and hands back the result.

How do I start Clojure REPL?

To start a REPL session in Eclipse, click the Menu option, go to Run As → Clojure Application. This will start a new REPL session in a separate window along with the console output. Conceptually, REPL is similar to Secure Shell (SSH).

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).


1 Answers

most people work with the repl through an editor such ad Eclipse/Emacs/vim and that editor has the ability to save the repl, though without some diligence on the developers part this will likely be an incomplete record of what happened. Some of the state of the repl may have come from loading files etc which will be in a different state.

So the short answer is typically not.

like image 102
Arthur Ulfeldt Avatar answered Nov 15 '22 07:11

Arthur Ulfeldt