Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display Clojure version in REPL?

Such as:

(println clojure-version) 

?

like image 277
qrest Avatar asked Aug 24 '10 20:08

qrest


People also ask

How do I open 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 run a Clojure code?

Create a new Clojure project with Leiningen. Build the project to create an executable JAR file. Execute the JAR file. Execute code in a Clojure REPL.

What is main Clojure?

main namespace. The clojure. main namespace provides functions that allow Clojure programs and interactive sessions to be launched via Java's application launcher tool java .

How do you abruptly stop execution in the REPL?

You can just press ctrl-d (*nix) or ctrl-z (Windows) to exit the REPL.


2 Answers

Even shorter :

user> (clojure-version) "1.2.0-beta1" user>  

Oops, I have to upgrade...

like image 67
Peter Tillemans Avatar answered Sep 22 '22 10:09

Peter Tillemans


Very close.

user> (println *clojure-version*) {:major 1, :minor 2, :incremental 0, :qualifier } nil 

Most builtin "global" variables like this have Common Lisp-style asterisk "earmuffs".

like image 39
Brian Carper Avatar answered Sep 25 '22 10:09

Brian Carper