No "clojure --version" switch

106 views
Skip to first unread message

Alan Thompson

unread,
May 7, 2019, 11:50:39 PM5/7/19
to clojure
Seems we should have the "--version" switch that is pretty universal.  Right now, the best one can do is 

> clojure --eval "(clojure-version)"
"1.10.0"

which is hard for a new user to figure out.  Jira ticket?

Alan

se...@corfield.org

unread,
May 8, 2019, 3:18:20 AM5/8/19
to clo...@googlegroups.com

Or just type:

 

              clojure

or:

              clj

 

And it announces the version and starts a REPL – which is documented usage.

 

I think one of the “issues” here is that clojure / clj are scripts that have an inherent version behind them (clojure -Sdescribe) but the version of Clojure that they run with is context-dependent. deps.edn can specify any Clojure back to … Clojure 1.1 it seems:

 

seanc@DESKTOP-QU2UJ1N:~$ clojure -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.1.0"}}}'

Clojure 1.1.0

user=> *clojure-version*

{:major 1, :minor 1, :incremental 0, :qualifier ""}

user=>

 

Given that, I think that a –version option on clojure would be misleading since it is not reporting the version of the clojure / clj scripts.

 

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAN67zA0yrhNhfx2vwH%3D-oy1kbJPA0EyGwwvg%2BFX3kyV4tgz3Qg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

 

Jesús Gómez

unread,
May 8, 2019, 10:13:20 AM5/8/19
to clo...@googlegroups.com
Just as an example of how other language manage that difference between REPL and the Interpreter: Ruby...

 $ irb -v
 irb 0.9.6(09/06/30)

 $ ruby -v
 ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-linux]



Alex Miller

unread,
May 8, 2019, 11:31:49 AM5/8/19
to Clojure
I would echo the other comments here. What user question are we trying to answer? The scripts are not written in Clojure, but use a Clojure program to compute the classpath, then launch your Clojure program. The version used for the first is largely irrelevant to you and probably more confusing than useful.

Having a helper for the version used in the second is possibly useful and would be happy to consider that. This could be done either in clojure.main (CLJ) or in the Clojure scripts (TDEPS). I guess I would probably lean towards the former.

Alex Miller

unread,
May 8, 2019, 11:51:42 AM5/8/19
to clo...@googlegroups.com
Actually, reporting the Clojure AND Java version would be even better.

> On May 8, 2019, at 6:31 AM, Alex Miller <al...@puredanger.com> wrote:
>
> I would echo the other comments here. What user question are we trying to answer? The scripts are not written in Clojure, but use a Clojure program to compute the classpath, then launch your Clojure program. The version used for the first is largely irrelevant to you and probably more confusing than useful.
>
> Having a helper for the version used in the second is possibly useful and would be happy to consider that. This could be done either in clojure.main (CLJ) or in the Clojure scripts (TDEPS). I guess I would probably lean towards the former.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/cvVPFpTkTaQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/d679ae95-13f3-41a7-a3ba-f90a5839ba8d%40googlegroups.com.

Alan Thompson

unread,
May 8, 2019, 4:49:12 PM5/8/19
to clojure
Jira CLJ-2508 created.
> You received this message because you are subscribed to the Google Groups "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/EC7DC405-6718-4AED-87E9-6A31336E182B%40puredanger.com.

Alex Miller

unread,
May 8, 2019, 5:13:23 PM5/8/19
to clo...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages